KVM: VMX: Adjust number of LBR records for PERF_CAPABILITIES at refresh
[linux-2.6-microblaze.git] / arch / x86 / kvm / vmx / vmx.h
index f57a527..24d58c2 100644 (file)
@@ -544,9 +544,12 @@ static inline struct x86_pmu_lbr *vcpu_to_lbr_records(struct kvm_vcpu *vcpu)
        return &vcpu_to_lbr_desc(vcpu)->records;
 }
 
-void intel_pmu_cross_mapped_check(struct kvm_pmu *pmu);
-bool intel_pmu_lbr_is_enabled(struct kvm_vcpu *vcpu);
+static inline bool intel_pmu_lbr_is_enabled(struct kvm_vcpu *vcpu)
+{
+       return !!vcpu_to_lbr_records(vcpu)->nr;
+}
 
+void intel_pmu_cross_mapped_check(struct kvm_pmu *pmu);
 int intel_pmu_create_guest_lbr_event(struct kvm_vcpu *vcpu);
 void vmx_passthrough_lbr_msrs(struct kvm_vcpu *vcpu);