diff options
author | Like Xu <likexu@tencent.com> | 2022-12-07 08:15:05 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-12-23 18:06:45 +0100 |
commit | 55c590adfe18b5380f7c4ae3696468bc5c916ee5 (patch) | |
tree | e9ea40a36c60cdd277d0b9015c590680912095d0 /arch/x86/kvm/irq_comm.c | |
parent | KVM: x86: Add proper ReST tables for userspace MSR exits/flags (diff) | |
download | linux-55c590adfe18b5380f7c4ae3696468bc5c916ee5.tar.xz linux-55c590adfe18b5380f7c4ae3696468bc5c916ee5.zip |
KVM: x86/pmu: Prevent zero period event from being repeatedly released
The current vPMU can reuse the same pmc->perf_event for the same
hardware event via pmc_pause/resume_counter(), but this optimization
does not apply to a portion of the TSX events (e.g., "event=0x3c,in_tx=1,
in_tx_cp=1"), where event->attr.sample_period is legally zero at creation,
thus making the perf call to perf_event_period() meaningless (no need to
adjust sample period in this case), and instead causing such reusable
perf_events to be repeatedly released and created.
Avoid releasing zero sample_period events by checking is_sampling_event()
to follow the previously enable/disable optimization.
Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20221207071506.15733-2-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/irq_comm.c')
0 files changed, 0 insertions, 0 deletions