]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Start trapping ID registers for 32 bit guests
authorOliver Upton <oupton@google.com>
Tue, 3 May 2022 06:02:03 +0000 (06:02 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 3 May 2022 10:14:34 +0000 (11:14 +0100)
commit04c9796be54d1a44439afaf6a23b5530800739b6
treea861aeb0ec17ab056714db7db853a6f71696e580
parentb41a17351de2d7d776f7d2ce66293a88f1a620c3
KVM: arm64: Start trapping ID registers for 32 bit guests

To date KVM has not trapped ID register accesses from AArch32, meaning
that guests get an unconstrained view of what hardware supports. This
can be a serious problem because we try to base the guest's feature
registers on values that are safe system-wide. Furthermore, KVM does not
implement the latest ISA in the PMU and Debug architecture, so we
constrain these fields to supported values.

Since KVM now correctly handles CP15 and CP10 register traps, we no
longer need to clear HCR_EL2.TID3 for 32 bit guests and will instead
emulate reads with their safe values.

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-6-oupton@google.com
arch/arm64/include/asm/kvm_arm.h
arch/arm64/include/asm/kvm_emulate.h