[RFC PATCH v2 2/8] KVM: arm64: Add KVM_PGTABLE_WALK_HW_DBM for HW DBM support

Shameerali Kolothum Thodi shameerali.kolothum.thodi at huawei.com
Mon Sep 18 02:52:13 PDT 2023



> -----Original Message-----
> From: Oliver Upton [mailto:oliver.upton at linux.dev]
> Sent: 15 September 2023 23:06
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi at huawei.com>
> Cc: kvmarm at lists.linux.dev; kvm at vger.kernel.org;
> linux-arm-kernel at lists.infradead.org; maz at kernel.org; will at kernel.org;
> catalin.marinas at arm.com; james.morse at arm.com;
> suzuki.poulose at arm.com; yuzenghui <yuzenghui at huawei.com>; zhukeqian
> <zhukeqian1 at huawei.com>; Jonathan Cameron
> <jonathan.cameron at huawei.com>; Linuxarm <linuxarm at huawei.com>
> Subject: Re: [RFC PATCH v2 2/8] KVM: arm64: Add
> KVM_PGTABLE_WALK_HW_DBM for HW DBM support
> 
> Hi Shameer,
> 
> On Fri, Aug 25, 2023 at 10:35:22AM +0100, Shameer Kolothum wrote:
> > KVM_PGTABLE_WALK_HW_DBM - Indicates page table walk is for HW
> DBM
> >  related updates.
> >
> > No functional changes here. Only apply any HW DBM bit updates to last
> > level only. These will be used by a future commit where we will add
> > support for HW DBM.
> >
> > Signed-off-by: Shameer Kolothum
> <shameerali.kolothum.thodi at huawei.com>
> > ---
> >  arch/arm64/include/asm/kvm_pgtable.h |  3 +++
> >  arch/arm64/kvm/hyp/pgtable.c         | 10 ++++++++++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/arch/arm64/include/asm/kvm_pgtable.h
> b/arch/arm64/include/asm/kvm_pgtable.h
> > index d3e354bb8351..3f96bdd2086f 100644
> > --- a/arch/arm64/include/asm/kvm_pgtable.h
> > +++ b/arch/arm64/include/asm/kvm_pgtable.h
> > @@ -219,6 +219,8 @@ typedef bool (*kvm_pgtable_force_pte_cb_t)(u64
> addr, u64 end,
> >   * @KVM_PGTABLE_WALK_SKIP_CMO:		Visit and update table
> entries
> >   *					without Cache maintenance
> >   *					operations required.
> > + * @KVM_PGTABLE_WALK_HW_DBM:		Indicates that the attribute
> update is
> > + *					HW DBM related.
> >   */
> >  enum kvm_pgtable_walk_flags {
> >  	KVM_PGTABLE_WALK_LEAF			= BIT(0),
> > @@ -228,6 +230,7 @@ enum kvm_pgtable_walk_flags {
> >  	KVM_PGTABLE_WALK_HANDLE_FAULT		= BIT(4),
> >  	KVM_PGTABLE_WALK_SKIP_BBM_TLBI		= BIT(5),
> >  	KVM_PGTABLE_WALK_SKIP_CMO		= BIT(6),
> > +	KVM_PGTABLE_WALK_HW_DBM			= BIT(7),
> >  };
> 
> Rather than making this DBM specific, call it
> KVM_PGTABLE_WALK_FORCE_PTE
> and get rid of stage2_map_data::force_pte. Then it becomes immediately
> obvious what this flag implies.

Ok. Will change accordingly.

Thanks,
Shameer



More information about the linux-arm-kernel mailing list