From: Marc Zyngier <maz@kernel.org>
To: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: catalin.marinas@arm.com, pcc@google.com, will@kernel.org,
broonie@kernel.org, anshuman.khandual@arm.com,
joey.gouly@arm.com, yury.khrustalev@arm.com,
oliver.upton@linux.dev, frederic@kernel.org,
akpm@linux-foundation.org, surenb@google.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v9 03/10] arm64/kvm: expose FEAT_MTE_TAGGED_FAR feature to guest
Date: Wed, 18 Jun 2025 17:43:07 +0100 [thread overview]
Message-ID: <86ldppc86c.wl-maz@kernel.org> (raw)
In-Reply-To: <20250618084513.1761345-4-yeoreum.yun@arm.com>
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@arm.com> wrote:
>
> expose FEAT_MTE_TAGGED_FAR feature to guest.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.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,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2025-06-18 16:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 8:45 [PATCH v9 00/10] support FEAT_MTE_TAGGED_FAR feature Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 01/10] arm64/cpufeature: add " Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 02/10] arm64: report address tag when FEAT_MTE_TAGGED_FAR is supported Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 03/10] arm64/kvm: expose FEAT_MTE_TAGGED_FAR feature to guest Yeoreum Yun
2025-06-18 16:43 ` Marc Zyngier [this message]
2025-06-19 7:39 ` Yeoreum Yun
2025-06-24 16:33 ` Catalin Marinas
2025-06-24 17:02 ` Marc Zyngier
2025-06-18 8:45 ` [PATCH v9 04/10] tools/kselftest: add MTE_FAR hwcap test Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 05/10] kselftest/arm64/mte: register mte signal handler with SA_EXPOSE_TAGBITS Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 06/10] kselftest/arm64/mte: check MTE_FAR feature is supported Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 07/10] kselftest/arm64/mte: add address tag related macro and function Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 08/10] kselftest/arm64/mte: add verification for address tag in signal handler Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 09/10] kselftest/arm64/mte: refactor check_mmap_option test Yeoreum Yun
2025-06-18 8:45 ` [PATCH v9 10/10] kselftest/arm64/mte: add mtefar tests on check_mmap_options Yeoreum Yun
2025-07-02 18:34 ` [PATCH v9 00/10] support FEAT_MTE_TAGGED_FAR feature Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ldppc86c.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=frederic@kernel.org \
--cc=joey.gouly@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pcc@google.com \
--cc=surenb@google.com \
--cc=will@kernel.org \
--cc=yeoreum.yun@arm.com \
--cc=yury.khrustalev@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).