KVM: arm64: PMU: Restore the host's PMUSERENR_EL0
authorReiji Watanabe <reijiw@google.com>
Sat, 3 Jun 2023 02:50:34 +0000 (19:50 -0700)
committerMarc Zyngier <maz@kernel.org>
Sun, 4 Jun 2023 16:19:36 +0000 (17:19 +0100)
commit8681f71759010503892f9e3ddb05f65c0f21b690
tree52e16a72cc9da8fced7575b727fe013d30b7eda8
parent40e54cad454076172cc3e2bca60aa924650a3e4b
KVM: arm64: PMU: Restore the host's PMUSERENR_EL0

Restore the host's PMUSERENR_EL0 value instead of clearing it,
before returning back to userspace, as the host's EL0 might have
a direct access to PMU registers (some bits of PMUSERENR_EL0 for
might not be zero for the host EL0).

Fixes: 83a7a4d643d3 ("arm64: perf: Enable PMU counter userspace access for perf event")
Signed-off-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230603025035.3781797-2-reijiw@google.com
arch/arm64/kvm/hyp/include/hyp/switch.h