]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: nv: Save/Restore vEL2 sysregs
authorMarc Zyngier <maz@kernel.org>
Wed, 23 Oct 2024 14:53:15 +0000 (15:53 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 31 Oct 2024 02:42:30 +0000 (02:42 +0000)
commitb9527b38c66730061c245e353dab42ef7dda33c6
tree21c3821544ab56e583b306a17fb91718a647d87c
parent164b5e20cdf6038f1b38867d2f6252ec6f10c356
KVM: arm64: nv: Save/Restore vEL2 sysregs

Whenever we need to restore the guest's system registers to the CPU, we
now need to take care of the EL2 system registers as well. Most of them
are accessed via traps only, but some have an immediate effect and also
a guest running in VHE mode would expect them to be accessible via their
EL1 encoding, which we do not trap.

For vEL2 we write the virtual EL2 registers with an identical format directly
into their EL1 counterpart, and translate the few registers that have a
different format for the same effect on the execution when running a
non-VHE guest guest hypervisor.

Based on an initial patch from Andre Przywara, rewritten many times
since.

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241023145345.1613824-8-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h
arch/arm64/kvm/hyp/nvhe/sysreg-sr.c
arch/arm64/kvm/hyp/vhe/sysreg-sr.c