Messages in this thread Patch in this message | | | From | Xiong Zhang <> | Subject | [RFC PATCH 13/41] KVM: x86/pmu: Add a helper to check if passthrough PMU is enabled | Date | Fri, 26 Jan 2024 16:54:16 +0800 |
| |
From: Mingwei Zhang <mizhang@google.com>
Add a helper to check if passthrough PMU is enabled for convenience as it is vendor neutral.
Signed-off-by: Mingwei Zhang <mizhang@google.com> --- arch/x86/kvm/pmu.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/x86/kvm/pmu.h b/arch/x86/kvm/pmu.h index 51011603c799..28beae0f9209 100644 --- a/arch/x86/kvm/pmu.h +++ b/arch/x86/kvm/pmu.h @@ -267,6 +267,11 @@ static inline bool pmc_is_globally_enabled(struct kvm_pmc *pmc) return test_bit(pmc->idx, (unsigned long *)&pmu->global_ctrl); } +static inline bool is_passthrough_pmu_enabled(struct kvm_vcpu *vcpu) +{ + return vcpu_to_pmu(vcpu)->passthrough; +} + void kvm_pmu_deliver_pmi(struct kvm_vcpu *vcpu); void kvm_pmu_handle_event(struct kvm_vcpu *vcpu); int kvm_pmu_rdpmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data); -- 2.34.1
| |