[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d5ed3b0-5e8f-572e-cee9-84d6c9d2410c@huawei.com>
Date: Thu, 3 Jun 2021 20:36:02 +0800
From: "wangyanan (Y)" <wangyanan55@...wei.com>
To: Quentin Perret <qperret@...gle.com>
CC: Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
"Alexandru Elisei" <alexandru.elisei@....com>,
<kvmarm@...ts.cs.columbia.edu>,
<linux-arm-kernel@...ts.infradead.org>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Catalin Marinas <catalin.marinas@....com>,
James Morse <james.morse@....com>,
Julien Thierry <julien.thierry.kdev@...il.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Gavin Shan <gshan@...hat.com>, <wanghaibin.wang@...wei.com>,
<zhukeqian1@...wei.com>, <yuzenghui@...wei.com>
Subject: Re: [PATCH v5 1/6] KVM: arm64: Introduce KVM_PGTABLE_S2_GUEST stage-2
flag
Hi Quentin,
On 2021/6/2 18:43, Quentin Perret wrote:
> Hi Yanan,
>
> On Thursday 15 Apr 2021 at 19:50:27 (+0800), Yanan Wang wrote:
>> diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h
>> index c3674c47d48c..a43cbe697b37 100644
>> --- a/arch/arm64/include/asm/kvm_pgtable.h
>> +++ b/arch/arm64/include/asm/kvm_pgtable.h
>> @@ -61,10 +61,12 @@ struct kvm_pgtable_mm_ops {
>> * @KVM_PGTABLE_S2_NOFWB: Don't enforce Normal-WB even if the CPUs have
>> * ARM64_HAS_STAGE2_FWB.
>> * @KVM_PGTABLE_S2_IDMAP: Only use identity mappings.
>> + * @KVM_PGTABLE_S2_GUEST: Whether the page-tables are guest stage-2.
>> */
>> enum kvm_pgtable_stage2_flags {
>> KVM_PGTABLE_S2_NOFWB = BIT(0),
>> KVM_PGTABLE_S2_IDMAP = BIT(1),
>> + KVM_PGTABLE_S2_GUEST = BIT(2),
> Assuming that we need this flag (maybe not given Marc's suggestion on
> another patch), I'd recommend re-naming it to explain _what_ it does,
> rather than _who_ is using it.
I agree with this.
> That's the principle we followed for e.g. KVM_PGTABLE_S2_IDMAP, so we
> should be consistent here as well.
But I think maybe we don't need the new flag anymore with Marc's suggestion.
Currently the CMOs right before installation or update of a PTE are
guest-specific.
So if we also take the new optional callbacks as guest specific, then a
new flag is
not necessary because we can check whether the callbacks have been
initialized
to determine if we are managing a guest S2 PTE.
Thanks,
Yanan
> Thanks,
> Quentin
> .
Powered by blists - more mailing lists