[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240126085444.324918-14-xiong.y.zhang@linux.intel.com>
Date: Fri, 26 Jan 2024 16:54:16 +0800
From: Xiong Zhang <xiong.y.zhang@...ux.intel.com>
To: seanjc@...gle.com,
pbonzini@...hat.com,
peterz@...radead.org,
mizhang@...gle.com,
kan.liang@...el.com,
zhenyuw@...ux.intel.com,
dapeng1.mi@...ux.intel.com,
jmattson@...gle.com
Cc: kvm@...r.kernel.org,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
zhiyuan.lv@...el.com,
eranian@...gle.com,
irogers@...gle.com,
samantha.alt@...el.com,
like.xu.linux@...il.com,
chao.gao@...el.com,
xiong.y.zhang@...ux.intel.com
Subject: [RFC PATCH 13/41] KVM: x86/pmu: Add a helper to check if passthrough PMU is enabled
From: Mingwei Zhang <mizhang@...gle.com>
Add a helper to check if passthrough PMU is enabled for convenience as it
is vendor neutral.
Signed-off-by: Mingwei Zhang <mizhang@...gle.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
Powered by blists - more mailing lists