diff options
| author | Oliver Upton <oliver.upton@linux.dev> | 2026-10-28 15:31:51 +0000 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-11-03 11:31:37 +0000 |
| commit | 8ee90ca40b10cc040544fdccf24b20115f46aa7d (patch) | |
| tree | beff45a5fe59af99ad60152c388a96dfde83d979 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | 9e29ea628848d29eea948200c4357f530b0e1768 (diff) | |
KVM: arm64: Pass the PMU events to the hyp vCPU of non-protected guests
Before every run, the host records in vcpu->arch.pmu.events which perf
counters to disable and enable around guest entry, and
__pmu_switch_to_guest() applies them at EL2. Since commit be66e67f1750
("KVM: arm64: Use the pKVM hyp vCPU structure in handle___kvm_vcpu_run()"),
protected mode runs the hyp vCPU instead, and flush_hyp_vcpu() never
copies the events into it. So the counters backing a non-protected
guest's PMU are never enabled, and every counter the guest reads stays
at 0, the cycle counter included. The host's counters that exclude
guests keep counting the guest as well.
Copy the events into the hyp vCPU of a non-protected guest on every run.
The events only exist with CONFIG_HW_PERF_EVENTS, so the copy is built
under it. Like mdcr_el2, they're host-controlled and never reach a
protected guest.
[Fuad: non-protected copy only, tested on the hyp vCPU, under
CONFIG_HW_PERF_EVENTS, new message]
Fixes: be66e67f1750 ("KVM: arm64: Use the pKVM hyp vCPU structure in handle___kvm_vcpu_run()")
Link: https://lore.kernel.org/all/20240305184840.636212-2-oliver.upton@linux.dev/
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Tested-by: Vincent Donnefort <vdonnefort@google.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Co-developed-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Link: https://patch.msgid.link/20261028153152.1740044-3-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions
