diff options
author | Alexandru Elisei <alexandru.elisei@arm.com> | 2022-05-03 09:02:04 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-05-03 13:17:41 +0300 |
commit | a9e192cd4fc738469448803693c9dc730898b8f1 (patch) | |
tree | 70cf0659e4ea69ce0b3d66466867af8872f4994c /arch/arm64/kvm/sys_regs.h | |
parent | fd1264c4ca610a99d52c35a37e5551eec442723d (diff) | |
download | linux-a9e192cd4fc738469448803693c9dc730898b8f1.tar.xz |
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.h | 2 |
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; |