Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] KVM: arm64: Support FEAT_LS64_ACCDATA in guests
@ 2026-10-25  7:51 Fuad Tabba
  2026-10-25  7:51 ` [PATCH v2 1/5] arm64: Add override for ID_AA64ISAR1_EL1.LS64 Fuad Tabba
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Fuad Tabba @ 2026-10-25  7:51 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, kvmarm, linux-arm-kernel
  Cc: Catalin Marinas, Will Deacon, Joey Gouly, Suzuki K Poulose,
	Zenghui Yu, Steffen Eiden, Mark Rutland, Yicong Yang, Zhou Wang,
	Arnd Bergmann, Fuad Tabba, kvm, linux-kernel

Hi folks,

Changes since v1 [1]:
  - Support FEAT_LS64_ACCDATA in guests instead of capping
    ID_AA64ISAR1_EL1.LS64 at LS64_V. A saved VM keeps its level, so
    restore no longer has to accept older kernels' levels, and v1's
    set_id_regs patch goes. (Marc)
  - Add an arm64.nols64 option. (Marc)
  - Retitled the series to match.

On a host with FEAT_LS64_ACCDATA, KVM advertises ST64BV0 and ACCDATA_EL1
to guests but doesn't support either. A guest's ST64BV0 hits the WARN in
handle_other(), and every guest on a CPU shares ACCDATA_EL1.

Patches 2 and 3 are Marc's from 2024 [2], rebased. I changed patch 3
to switch ACCDATA_EL1 for guests only, and only when the new
ARM64_HAS_LS64_ACCDATA capability is set, for the reasons in its note.
Patch 4 sets HCRX_EL2.EnAS0. Patch 1 adds arm64.nols64 to disable LS64
on a host whose firmware leaves SCR_EL3.ADEn clear. It comes
first so that the option exists in every commit that switches
ACCDATA_EL1. All five carry Cc: stable. The get-reg-list patch carries
it because the test fails on a host with the feature once patch 2 is
in.

Tested on the FVP with arm_v8_7_accelerator_support_level at 3
(LS64_ACCDATA) in VHE, nVHE and protected mode, and at 4 (LS64WB) in
VHE, with cpuidle.off=1 so that idle doesn't reset ACCDATA_EL1 between
VMs. In my reproducer, one VM writes ACCDATA_EL1 and the next VM on the
same CPU reads it. Unpatched, it reads the first VM's value and ST64BV0
hits the WARN. Patched, the second VM reads 0 and ST64BV0 doesn't trap.

Based on Linux 7.3-rc3 (fd73f4a665989).

Cheers,
/fuad

[1] https://lore.kernel.org/all/20261023070110.1833446-1-fuad.tabba@linux.dev/
[2] https://lore.kernel.org/all/20240815125959.2097734-1-maz@kernel.org/

Fuad Tabba (3):
  arm64: Add override for ID_AA64ISAR1_EL1.LS64
  KVM: arm64: Enable ST64BV0 for guests with FEAT_LS64_ACCDATA
  KVM: arm64: selftests: Add ACCDATA_EL1 to get-reg-list

Marc Zyngier (2):
  KVM: arm64: Add ACCDATA_EL1 to the sysreg array
  KVM: arm64: Add context-switch of ACCDATA_EL1

 .../admin-guide/kernel-parameters.txt         |  3 +++
 arch/arm64/include/asm/kvm_emulate.h          |  3 +++
 arch/arm64/include/asm/kvm_host.h             |  3 +++
 arch/arm64/kernel/cpufeature.c                |  7 ++++++
 arch/arm64/kernel/pi/idreg-override.c         |  2 ++
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h    | 23 +++++++++++++++++++
 arch/arm64/kvm/sys_regs.c                     | 12 +++++++++-
 arch/arm64/tools/cpucaps                      |  1 +
 .../selftests/kvm/arm64/get-reg-list.c        |  2 ++
 9 files changed, 55 insertions(+), 1 deletion(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
-- 
2.47.3


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-10-26 18:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 4/5] KVM: arm64: Enable ST64BV0 for guests with FEAT_LS64_ACCDATA Fuad Tabba
2026-10-25  7:51 ` [PATCH v2 5/5] KVM: arm64: selftests: Add ACCDATA_EL1 to get-reg-list Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox