aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/sys_regs.h
diff options
context:
space:
mode:
authorAlexandru Elisei <alexandru.elisei@arm.com>2022-05-03 06:02:04 +0000
committerMarc Zyngier <maz@kernel.org>2022-05-03 11:17:41 +0100
commita9e192cd4fc738469448803693c9dc730898b8f1 (patch)
tree70cf0659e4ea69ce0b3d66466867af8872f4994c /arch/arm64/kvm/sys_regs.h
parentKVM: arm64: Start trapping ID registers for 32 bit guests (diff)
downloadlinux-dev-a9e192cd4fc738469448803693c9dc730898b8f1.tar.xz
linux-dev-a9e192cd4fc738469448803693c9dc730898b8f1.zip
KVM: arm64: Hide AArch32 PMU registers when not available
commit 11663111cd49 ("KVM: arm64: Hide PMU registers from userspace when not available") hid the AArch64 PMU registers from userspace and guest when the PMU VCPU feature was not set. Do the same when the PMU registers are accessed by an AArch32 guest. While we're at it, rename the previously unused AA32_ZEROHIGH to AA32_DIRECT to match the behavior of get_access_mask(). Now that KVM emulates ID_DFR0 and hides the PMU from the guest when the feature is not set, it is safe to inject to inject an undefined exception when the PMU is not present, as that corresponds to the architected behaviour. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> [Oliver - Add AA32_DIRECT to match the zero value of the enum] Signed-off-by: Oliver Upton <oupton@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220503060205.2823727-7-oupton@google.com
Diffstat (limited to 'arch/arm64/kvm/sys_regs.h')
-rw-r--r--arch/arm64/kvm/sys_regs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h
index 0d31a12b640c..aee8ea054f0d 100644
--- a/arch/arm64/kvm/sys_regs.h
+++ b/arch/arm64/kvm/sys_regs.h
@@ -47,7 +47,7 @@ struct sys_reg_desc {
const char *name;
enum {
- AA32_ZEROHIGH,
+ AA32_DIRECT,
AA32_LO,
AA32_HI,
} aarch32_map;