From: Oliver Upton <oupton@kernel.org>
To: Zhou Wang <wangzhou1@hisilicon.com>
Cc: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org,
oliver.upton@linux.dev, joey.gouly@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com, arnd@arndb.de,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
yangyccccc@gmail.com, prime.zeng@hisilicon.com,
xuwei5@huawei.com
Subject: Re: [PATCH v7 6/7] KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest
Date: Fri, 7 Nov 2025 10:53:50 -0800 [thread overview]
Message-ID: <aQ5APpLg0Elv4YoH@kernel.org> (raw)
In-Reply-To: <20251107072127.448953-7-wangzhou1@hisilicon.com>
Hi Zhou,
On Fri, Nov 07, 2025 at 03:21:26PM +0800, Zhou Wang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> Using FEAT_{LS64, LS64_V} instructions in a guest is also controlled
> by HCRX_EL2.{EnALS, EnASR}. Enable it if guest has related feature.
>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
The ordering of this patch is incorrect as patch #5 has the side-effect
of exposing ID_AA64ISAR1_EL1.LS64 to KVM guests. This one should come
first instead.
Thanks,
Oliver
> ---
> arch/arm64/include/asm/kvm_emulate.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
> index bab967d65715..29291e25ecfd 100644
> --- a/arch/arm64/include/asm/kvm_emulate.h
> +++ b/arch/arm64/include/asm/kvm_emulate.h
> @@ -695,6 +695,12 @@ static inline void vcpu_set_hcrx(struct kvm_vcpu *vcpu)
>
> if (kvm_has_sctlr2(kvm))
> vcpu->arch.hcrx_el2 |= HCRX_EL2_SCTLR2En;
> +
> + if (kvm_has_feat(kvm, ID_AA64ISAR1_EL1, LS64, LS64))
> + vcpu->arch.hcrx_el2 |= HCRX_EL2_EnALS;
> +
> + if (kvm_has_feat(kvm, ID_AA64ISAR1_EL1, LS64, LS64_V))
> + vcpu->arch.hcrx_el2 |= HCRX_EL2_EnASR;
> }
> }
> #endif /* __ARM64_KVM_EMULATE_H__ */
> --
> 2.33.0
>
>
next prev parent reply other threads:[~2025-11-07 18:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 7:21 [PATCH v7 0/7] Add support for FEAT_{LS64, LS64_V} and related tests Zhou Wang
2025-11-07 7:21 ` [PATCH v7 1/7] KVM: arm64: Add exit to userspace on {LD,ST}64B* outside of memslots Zhou Wang
2025-11-07 11:48 ` Suzuki K Poulose
2025-11-07 11:49 ` Suzuki K Poulose
2025-11-11 2:12 ` Zhou Wang
2025-11-07 7:21 ` [PATCH v7 2/7] KVM: arm64: Add documentation for KVM_EXIT_ARM_LDST64B Zhou Wang
2025-11-07 7:21 ` [PATCH v7 3/7] KVM: arm64: Handle DABT caused by LS64* instructions on unsupported memory Zhou Wang
2025-11-07 7:21 ` [PATCH v7 4/7] arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1 Zhou Wang
2025-11-07 7:21 ` [PATCH v7 5/7] arm64: Add support for FEAT_{LS64, LS64_V} Zhou Wang
2025-11-07 12:05 ` Suzuki K Poulose
2025-11-11 3:40 ` Zhou Wang
2025-11-11 11:15 ` Marc Zyngier
2025-11-13 14:40 ` Zhou Wang
2025-11-13 16:26 ` Arnd Bergmann
2025-11-14 9:25 ` Zhou Wang
2025-11-14 9:37 ` Arnd Bergmann
2025-11-18 2:31 ` Zhou Wang
2025-11-18 7:36 ` Arnd Bergmann
2025-11-27 3:51 ` Zhou Wang
2025-11-27 15:37 ` Arnd Bergmann
2025-12-05 6:47 ` Zhou Wang
2025-12-05 7:09 ` Arnd Bergmann
2025-11-07 7:21 ` [PATCH v7 6/7] KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest Zhou Wang
2025-11-07 18:53 ` Oliver Upton [this message]
2025-11-11 3:43 ` Zhou Wang
2025-11-07 7:21 ` [PATCH v7 7/7] kselftest/arm64: Add HWCAP test for FEAT_{LS64, LS64_V} Zhou Wang
2025-11-07 9:21 ` Arnd Bergmann
2025-11-07 9:23 ` [PATCH v7 0/7] Add support for FEAT_{LS64, LS64_V} and related tests Arnd Bergmann
2025-11-07 18:57 ` Oliver Upton
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=aQ5APpLg0Elv4YoH@kernel.org \
--to=oupton@kernel.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=prime.zeng@hisilicon.com \
--cc=suzuki.poulose@arm.com \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=xuwei5@huawei.com \
--cc=yangyccccc@gmail.com \
--cc=yuzenghui@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.