aboutsummaryrefslogtreecommitdiff
path: root/lib/memory-notifier-error-inject.c
diff options
context:
space:
mode:
authorMarc Zyngier <[email protected]>2023-08-20 10:01:08 +0100
committerMarc Zyngier <[email protected]>2023-08-22 13:35:51 +0100
commitb1f778a223a2a8ad6262e5233cfc3483bcf6e213 (patch)
tree856ac471c560ce076e04499093e3e034a108bf02 /lib/memory-notifier-error-inject.c
parent64b81000b60b70f10a5834023fe100902d9f7a57 (diff)
KVM: arm64: pmu: Resync EL0 state on counter rotation
Huang Shijie reports that, when profiling a guest from the host with a number of events that exceeds the number of available counters, the reported counts are wildly inaccurate. Without the counter oversubscription, the reported counts are correct. Their investigation indicates that upon counter rotation (which takes place on the back of a timer interrupt), we fail to re-apply the guest EL0 enabling, leading to the counting of host events instead of guest events. In order to solve this, add yet another hook between the host PMU driver and KVM, re-applying the guest EL0 configuration if the right conditions apply (the host is VHE, we are in interrupt context, and we interrupted a running vcpu). This triggers a new vcpu request which will apply the correct configuration on guest reentry. With this, we have the correct counts, even when the counters are oversubscribed. Reported-by: Huang Shijie <[email protected]> Suggested-by: Oliver Upton <[email protected]> Tested_by: Huang Shijie <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions