]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Wire up CP15 feature registers to their AArch64 equivalents
authorOliver Upton <oupton@google.com>
Tue, 3 May 2022 06:02:01 +0000 (06:02 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 3 May 2022 10:14:33 +0000 (11:14 +0100)
commit21dbafd225c0bd93a8b1f89751eb56bc169b2f38
tree4ef07b22fdabd4138fef1271e63aa87712770a33
parente8c8c3f35837a98b1ec324de1653c37f420b8c9c
KVM: arm64: Wire up CP15 feature registers to their AArch64 equivalents

KVM currently does not trap ID register accesses from an AArch32 EL1.
This is painful for a couple of reasons. Certain unimplemented features
are visible to AArch32 EL1, as we limit PMU to version 3 and the debug
architecture to v8.0. Additionally, we attempt to paper over
heterogeneous systems by using register values that are safe
system-wide. All this hard work is completely sidestepped because KVM
does not set TID3 for AArch32 guests.

Fix up handling of CP15 feature registers by simply rerouting to their
AArch64 aliases. Punt setting HCR_EL2.TID3 to a later change, as we need
to fix up the oddball CP10 feature registers still.

Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220503060205.2823727-4-oupton@google.com
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/sys_regs.h