]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: nv: Don't treat ZCR_EL2 as a 'mapped' register
authorOliver Upton <oliver.upton@linux.dev>
Fri, 26 Sep 2025 19:41:07 +0000 (12:41 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 13 Oct 2025 13:17:02 +0000 (14:17 +0100)
commited25dcfbc4327570b28f0328a8e17d121434c0ea
treededcdd29c322a240c6718e8904580cf8abf1568a
parent3a8660878839faadb4f1a6dd72c3179c1df56787
KVM: arm64: nv: Don't treat ZCR_EL2 as a 'mapped' register

Unlike the other mapped EL2 sysregs ZCR_EL2 isn't guaranteed to be
resident when a vCPU is loaded as it actually follows the SVE
context. As such, the contents of ZCR_EL1 may belong to another guest if
the vCPU has been preempted before reaching sysreg emulation.

Unconditionally use the in-memory value of ZCR_EL2 and switch to the
memory-only accessors. The in-memory value is guaranteed to be valid as
fpsimd_lazy_switch_to_{guest,host}() will restore/save the register
appropriately.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c