Re: [PATCH v2 0/2] KVM: arm64: Prevent spurious PMU accesses when no

2021-03-02 Thread Marc Zyngier
On Tue, 9 Feb 2021 11:48:42 +, Marc Zyngier wrote:
> Yet another PMU bug that is only likely to hit under Nested Virt: we
> unconditionally access PMU registers without checking whether it
> actually is present.
> 
> Given that we already have a predicate for this, promote it to a
> static key, and use that in the world switch.
> 
> [...]

Applied to kvmarm-master/fixes, thanks!

[1/2] KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key
  commit: 502e5f9a6985898b5318ebb5978a54c3ebf3dfe1
[2/2] KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available
  commit: 7b85a9313e6cad22a66027151b6d54d1ce44543f

Cheers,

M.
-- 
Without deviation from the norm, progress is not possible.


___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm


[PATCH v2 0/2] KVM: arm64: Prevent spurious PMU accesses when no

2021-02-09 Thread Marc Zyngier
Yet another PMU bug that is only likely to hit under Nested Virt: we
unconditionally access PMU registers without checking whether it
actually is present.

Given that we already have a predicate for this, promote it to a
static key, and use that in the world switch.

Thanks to Andre for the heads up!

* From v1:
  - Fix compilation when CONFIG_ARM_PMU isn't selected

Marc Zyngier (2):
  KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key
  KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is
available

 arch/arm64/kernel/image-vars.h  |  3 +++
 arch/arm64/kvm/hyp/include/hyp/switch.h |  9 ++---
 arch/arm64/kvm/perf.c   | 10 ++
 arch/arm64/kvm/pmu-emul.c   | 10 --
 include/kvm/arm_pmu.h   |  9 +++--
 5 files changed, 26 insertions(+), 15 deletions(-)

-- 
2.29.2

___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm