mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 11:11:26 +02:00
KVM: x86/pmu: Do a single atomic OR when reprogramming counters
Do a single atomic OR using the atomic overlay of reprogram_pmi bitmask, instead of one atomic set_bit() call per counter. Signed-off-by: Yosry Ahmed <yosry@kernel.org> Link: https://patch.msgid.link/20260527234711.4175166-8-yosry@kernel.org Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
103cd7deda
commit
e48810e06f
|
|
@ -213,13 +213,10 @@ static inline void kvm_pmu_request_counter_reprogram(struct kvm_pmc *pmc)
|
|||
static inline void kvm_pmu_request_counters_reprogram(struct kvm_pmu *pmu,
|
||||
u64 counters)
|
||||
{
|
||||
int bit;
|
||||
|
||||
if (!counters)
|
||||
return;
|
||||
|
||||
for_each_set_bit(bit, (unsigned long *)&counters, X86_PMC_IDX_MAX)
|
||||
set_bit(bit, pmu->reprogram_pmi);
|
||||
atomic64_or(counters, &pmu->__reprogram_pmi);
|
||||
kvm_make_request(KVM_REQ_PMU, pmu_to_vcpu(pmu));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user