KVM: arm64: nv: Ensure correct VL is loaded before saving SVE state
authorOliver Upton <oliver.upton@linux.dev>
Thu, 20 Jun 2024 16:46:44 +0000 (16:46 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 20 Jun 2024 19:02:40 +0000 (19:02 +0000)
commit2e3cf82063a00ea0629e03e223c7c6ba58718f12
tree4cd1fca3bf1eec10415b8682378ccae1a660ce02
parent9092aca9fe9aa986b573355affdd190710a906c0
KVM: arm64: nv: Ensure correct VL is loaded before saving SVE state

It is possible that the guest hypervisor has selected a smaller VL than
the maximum for its nested guest. As such, ZCR_EL2 may be configured for
a different VL when exiting a nested guest.

Set ZCR_EL2 (via the EL1 alias) to the maximum VL for the VM before
saving SVE state as the SVE save area is dimensioned by the max VL.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240620164653.1130714-8-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/fpsimd.c