[PATCH v2 4/5] KVM: arm64: Enable ST64BV0 for guests with FEAT_LS64_ACCDATA
Yao Yuan
yaoyuan at linux.alibaba.com
Sun Nov 1 17:50:48 PST 2026
On Sun, Oct 25, 2026 at 07:51:37AM +0800, Fuad Tabba wrote:
> Since commit 58ce78667a641 ("arm64: Add support for FEAT_{LS64,
> LS64_V}"), a guest sees the host's ID_AA64ISAR1_EL1.LS64, but KVM only
> enables the FEAT_LS64 and FEAT_LS64_V instructions in HCRX_EL2. On a
> host with FEAT_LS64_ACCDATA, a guest's ST64BV0 therefore traps and hits
> the WARN_ON_ONCE() in handle_other().
>
> Set HCRX_EL2.EnAS0 when the guest has FEAT_LS64_ACCDATA, now that
> ACCDATA_EL1 is context-switched.
>
> Fixes: 58ce78667a641 ("arm64: Add support for FEAT_{LS64, LS64_V}")
> Cc: stable at vger.kernel.org
> Signed-off-by: Fuad Tabba <fuad.tabba at linux.dev>
lgtm.
Reviewed-by: Yuan Yao <yaoyuan at linux.alibaba.com>
> ---
> arch/arm64/include/asm/kvm_emulate.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
> index a3c1928bdf743..d07f72082531c 100644
> --- a/arch/arm64/include/asm/kvm_emulate.h
> +++ b/arch/arm64/include/asm/kvm_emulate.h
> @@ -712,6 +712,9 @@ static inline void vcpu_set_hcrx(struct kvm_vcpu *vcpu)
> if (kvm_has_feat(kvm, ID_AA64ISAR1_EL1, LS64, LS64_V))
> vcpu->arch.hcrx_el2 |= HCRX_EL2_EnASR;
>
> + if (kvm_has_feat(kvm, ID_AA64ISAR1_EL1, LS64, LS64_ACCDATA))
> + vcpu->arch.hcrx_el2 |= HCRX_EL2_EnAS0;
> +
> /*
> * NV3 is a host-specific extension, and we always use
> * it when present and that the guest uses NV. It may
> --
> 2.47.3
>
More information about the linux-arm-kernel
mailing list