diff options
author | 2023-11-09 18:28:51 -0800 | |
---|---|---|
committer | 2024-02-01 09:35:48 -0800 | |
commit | 004a0aa56edea3effc97bc90a620da1bcde5c63c (patch) | |
tree | 379a33ec1a69534c15209580c9debb48457ab0fd /tools/perf/scripts/python/export-to-postgresql.py | |
parent | KVM: x86/pmu: Move pmc_idx => pmc translation helper to common code (diff) | |
download | wireguard-linux-004a0aa56edea3effc97bc90a620da1bcde5c63c.tar.xz wireguard-linux-004a0aa56edea3effc97bc90a620da1bcde5c63c.zip |
KVM: x86/pmu: Snapshot and clear reprogramming bitmap before reprogramming
Refactor the handling of the reprogramming bitmap to snapshot and clear
to-be-processed bits before doing the reprogramming, and then explicitly
set bits for PMCs that need to be reprogrammed (again). This will allow
adding a macro to iterate over all valid PMCs without having to add
special handling for the reprogramming bit, which (a) can have bits set
for non-existent PMCs and (b) needs to clear such bits to avoid wasting
cycles in perpetuity.
Note, the existing behavior of clearing bits after reprogramming does NOT
have a race with kvm_vm_ioctl_set_pmu_event_filter(). Setting a new PMU
filter synchronizes SRCU _before_ setting the bitmap, i.e. guarantees that
the vCPU isn't in the middle of reprogramming with a stale filter prior to
setting the bitmap.
Link: https://lore.kernel.org/r/20231110022857.1273836-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions