]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: arm64: nv: Apply RESx settings to sysreg reset values
authorMarc Zyngier <maz@kernel.org>
Sun, 12 Jan 2025 16:50:29 +0000 (16:50 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 14 Jan 2025 11:33:09 +0000 (11:33 +0000)
commit36f998de853cfad60508dfdfb41c9c40a2245f19
treebd2c147228f5d78365c7589ebfa7a99936ee5016
parentc139b6d1b4d27724987af5071177fb5f3d60c1e4
KVM: arm64: nv: Apply RESx settings to sysreg reset values

While we have sanitisation in place for the guest sysregs, we lack
that sanitisation out of reset. So some of the fields could be
evaluated and not reflect their RESx status, which sounds like
a very bad idea.

Apply the RESx masks to the the sysreg file in two situations:

- when going via a reset of the sysregs

- after having computed the RESx masks

Having this separate reset phase from the actual reset handling is
a bit grotty, but we need to apply this after the ID registers are
final.

Tested-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Link: https://lore.kernel.org/r/20250112165029.1181056-3-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_nested.h
arch/arm64/kvm/nested.c
arch/arm64/kvm/sys_regs.c