summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/vmx/vmx.h
diff options
context:
space:
mode:
authorLike Xu <like.xu@linux.intel.com>2021-02-01 08:10:31 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-02-04 13:27:24 +0300
commitc646236344e9054cc84cd5a9f763163b9654cf7e (patch)
tree09df32dacf9da772f2edc8f3896e4d7843a40f28 /arch/x86/kvm/vmx/vmx.h
parent9c9520ce883386dc3794c7d60204487ff1db09cb (diff)
downloadlinux-c646236344e9054cc84cd5a9f763163b9654cf7e.tar.xz
KVM: vmx/pmu: Add PMU_CAP_LBR_FMT check when guest LBR is enabled
Usespace could set the bits [0, 5] of the IA32_PERF_CAPABILITIES MSR which tells about the record format stored in the LBR records. The LBR will be enabled on the guest if host perf supports LBR (checked via x86_perf_get_lbr()) and the vcpu model is compatible with the host one. Signed-off-by: Like Xu <like.xu@linux.intel.com> Message-Id: <20210201051039.255478-4-like.xu@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/vmx.h')
-rw-r--r--arch/x86/kvm/vmx/vmx.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
index df61b0d09eb7..3836daf7d489 100644
--- a/arch/x86/kvm/vmx/vmx.h
+++ b/arch/x86/kvm/vmx/vmx.h
@@ -97,6 +97,7 @@ union vmx_exit_reason {
#define vcpu_to_lbr_records(vcpu) (&to_vmx(vcpu)->lbr_desc.records)
bool intel_pmu_lbr_is_compatible(struct kvm_vcpu *vcpu);
+bool intel_pmu_lbr_is_enabled(struct kvm_vcpu *vcpu);
struct lbr_desc {
/* Basic info about guest LBR records. */