summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/intel_pt.h
diff options
context:
space:
mode:
authorLuwei Kang <luwei.kang@intel.com>2018-10-24 11:05:07 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2018-12-21 13:28:32 +0300
commit61be2998ca541f7d9f487479b2ec519d83328085 (patch)
tree6c6f53ba15963a0b25f60b8244617b5d337ecc14 /arch/x86/include/asm/intel_pt.h
parentf6d079ce867d679e4dffef5b3112c7634215fd88 (diff)
downloadlinux-61be2998ca541f7d9f487479b2ec519d83328085.tar.xz
perf/x86/intel/pt: Introduce intel_pt_validate_cap()
intel_pt_validate_hw_cap() validates whether a given PT capability is supported by the hardware. It checks the PT capability array which reflects the capabilities of the hardware on which the code is executed. For setting up PT for KVM guests this is not correct as the capability array for the guest can be different from the host array. Provide a new function to check against a given capability array. Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Luwei Kang <luwei.kang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/intel_pt.h')
-rw-r--r--arch/x86/include/asm/intel_pt.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/intel_pt.h b/arch/x86/include/asm/intel_pt.h
index fa4b4fd2dbed..00f4afb2b7de 100644
--- a/arch/x86/include/asm/intel_pt.h
+++ b/arch/x86/include/asm/intel_pt.h
@@ -26,9 +26,11 @@ enum pt_capabilities {
#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
void cpu_emergency_stop_pt(void);
extern u32 intel_pt_validate_hw_cap(enum pt_capabilities cap);
+extern u32 intel_pt_validate_cap(u32 *caps, enum pt_capabilities cap);
#else
static inline void cpu_emergency_stop_pt(void) {}
static inline u32 intel_pt_validate_hw_cap(enum pt_capabilities cap) { return 0; }
+static inline u32 intel_pt_validate_cap(u32 *caps, enum pt_capabilities capability) { return 0; }
#endif
#endif /* _ASM_X86_INTEL_PT_H */