From: Fuad Tabba <fuad.tabba@linux.dev>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Mark Rutland <mark.rutland@arm.com>,
Yicong Yang <yangyicong@hisilicon.com>,
Zhou Wang <wangzhou1@hisilicon.com>,
Arnd Bergmann <arnd@arndb.de>, Fuad Tabba <tabba@google.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 4/5] KVM: arm64: Enable ST64BV0 for guests with FEAT_LS64_ACCDATA
Date: Sun, 25 Oct 2026 07:51:37 +0000 [thread overview]
Message-ID: <20261025075138.2919734-5-fuad.tabba@linux.dev> (raw)
In-Reply-To: <20261025075138.2919734-1-fuad.tabba@linux.dev>
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@vger.kernel.org
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
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
next prev parent reply other threads:[~2026-10-25 7:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 7:51 [PATCH v2 0/5] KVM: arm64: Support FEAT_LS64_ACCDATA in guests Fuad Tabba
2026-10-25 7:51 ` [PATCH v2 1/5] arm64: Add override for ID_AA64ISAR1_EL1.LS64 Fuad Tabba
2026-10-25 7:51 ` [PATCH v2 2/5] KVM: arm64: Add ACCDATA_EL1 to the sysreg array Fuad Tabba
2026-10-25 7:51 ` [PATCH v2 3/5] KVM: arm64: Add context-switch of ACCDATA_EL1 Fuad Tabba
2026-10-26 15:41 ` Suzuki K Poulose
2026-10-26 17:09 ` Fuad Tabba
2026-10-26 17:32 ` Arnd Bergmann
2026-10-26 18:54 ` Fuad Tabba
2026-10-25 7:51 ` Fuad Tabba [this message]
2026-10-25 7:51 ` [PATCH v2 5/5] KVM: arm64: selftests: Add ACCDATA_EL1 to get-reg-list Fuad Tabba
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=20261025075138.2919734-5-fuad.tabba@linux.dev \
--to=fuad.tabba@linux.dev \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox