KVM: x86/pmu: Support full width counting
[linux-2.6-microblaze.git] / arch / x86 / kvm / vmx / capabilities.h
index 8903475..4bbd8b4 100644 (file)
@@ -18,6 +18,8 @@ extern int __read_mostly pt_mode;
 #define PT_MODE_SYSTEM         0
 #define PT_MODE_HOST_GUEST     1
 
+#define PMU_CAP_FW_WRITES      (1ULL << 13)
+
 struct nested_vmx_msrs {
        /*
         * We only store the "true" versions of the VMX capability MSRs. We
@@ -367,4 +369,13 @@ static inline bool vmx_pt_mode_is_host_guest(void)
        return pt_mode == PT_MODE_HOST_GUEST;
 }
 
+static inline u64 vmx_get_perf_capabilities(void)
+{
+       /*
+        * Since counters are virtualized, KVM would support full
+        * width counting unconditionally, even if the host lacks it.
+        */
+       return PMU_CAP_FW_WRITES;
+}
+
 #endif /* __KVM_X86_VMX_CAPS_H */