OSDN Git Service

KVM: arm64: Hide PMU registers from userspace when not available
authorMarc Zyngier <maz@kernel.org>
Wed, 6 Jan 2021 17:22:27 +0000 (17:22 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 14 Jan 2021 11:02:51 +0000 (11:02 +0000)
commit11663111cd49b4c6dd27479774e420f139e4c447
treefbc93a72c8d17e9b3305a9ce31a11246634b66eb
parent45ba7b195a369f35cb39094fdb32efe5908b34ad
KVM: arm64: Hide PMU registers from userspace when not available

It appears that while we are now able to properly hide PMU
registers from the guest when a PMU isn't available (either
because none has been configured, the host doesn't have
the PMU support compiled in, or that the HW doesn't have
one at all), we are still exposing more than we should to
userspace.

Introduce a visibility callback gating all the PMU registers,
which covers both usrespace and guest.

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c