[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFO+sfuxQlpXtGvH@e129823.arm.com>
Date: Thu, 19 Jun 2025 08:39:29 +0100
From: Yeoreum Yun <yeoreum.yun@....com>
To: Marc Zyngier <maz@...nel.org>
Cc: catalin.marinas@....com, pcc@...gle.com, will@...nel.org,
broonie@...nel.org, anshuman.khandual@....com, joey.gouly@....com,
yury.khrustalev@....com, oliver.upton@...ux.dev,
frederic@...nel.org, akpm@...ux-foundation.org, surenb@...gle.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org
Subject: Re: [PATCH v9 03/10] arm64/kvm: expose FEAT_MTE_TAGGED_FAR feature
to guest
Hi Marc,
> In general, please use a patch title format that matches the one used
> for the subsystem. For KVM, that'd be "KVM: arm64: Expose ..."/
>
> On Wed, 18 Jun 2025 09:45:06 +0100,
> Yeoreum Yun <yeoreum.yun@....com> wrote:
> >
> > expose FEAT_MTE_TAGGED_FAR feature to guest.
> >
> > Signed-off-by: Yeoreum Yun <yeoreum.yun@....com>
> > ---
> > arch/arm64/kvm/sys_regs.c | 14 ++++++++++----
> > 1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> > index 76c2f0da821f..c8c92cb9da01 100644
> > --- a/arch/arm64/kvm/sys_regs.c
> > +++ b/arch/arm64/kvm/sys_regs.c
> > @@ -1586,7 +1586,7 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
> > const struct sys_reg_desc *r)
> > {
> > u32 id = reg_to_encoding(r);
> > - u64 val;
> > + u64 val, mask;
> >
> > if (sysreg_visible_as_raz(vcpu, r))
> > return 0;
> > @@ -1617,8 +1617,12 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
> > val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_MPAM_frac);
> > break;
> > case SYS_ID_AA64PFR2_EL1:
> > - /* We only expose FPMR */
> > - val &= ID_AA64PFR2_EL1_FPMR;
> > + mask = ID_AA64PFR2_EL1_FPMR;
> > +
> > + if (kvm_has_mte(vcpu->kvm))
> > + mask |= ID_AA64PFR2_EL1_MTEFAR;
> > +
> > + val &= mask;
>
> I don't think there is a need for an extra variable, and you could
> follow the pattern established in this file by writing this as:
>
> val &= (ID_AA64PFR2_EL1_FPMR |
> (kvm_has_mte(vcpu->kvm) ? ID_AA64PFR2_EL1_MTEFAR : 0));
>
> Not a big deal though.
Thanks for your suggestion. I'll apply this with STORE_ONLY patch too
in end of this day.
--
Sincerely,
Yeoreum Yun
Powered by blists - more mailing lists