Re: [PATCH v4 30/38] KVM: x86/pmu: Handle emulated instruction for mediated vPMU

2025-05-15 Thread Sean Christopherson
On Mon, Mar 24, 2025, Mingwei Zhang wrote: > static void kvm_pmu_incr_counter(struct kvm_pmc *pmc) > { > - pmc->emulated_counter++; > - kvm_pmu_request_counter_reprogram(pmc); > + struct kvm_vcpu *vcpu = pmc->vcpu; > + > + /* > + * For perf-based PMUs, accumulate software-emu

[PATCH v4 30/38] KVM: x86/pmu: Handle emulated instruction for mediated vPMU

2025-03-24 Thread Mingwei Zhang
From: Dapeng Mi Mediated vPMU needs to accumulate the emulated instructions into counter and load the counter into HW at vm-entry. Moreover, if the accumulation leads to counter overflow, KVM needs to update GLOBAL_STATUS and inject PMI into guest as well. Suggested-by: Sean Christopherson Sig