|
@@ -582,6 +582,24 @@ static __init int bts_init(void)
|
|
|
if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts)
|
|
|
return -ENODEV;
|
|
|
|
|
|
+ if (boot_cpu_has(X86_FEATURE_PTI)) {
|
|
|
+ /*
|
|
|
+ * BTS hardware writes through a virtual memory map we must
|
|
|
+ * either use the kernel physical map, or the user mapping of
|
|
|
+ * the AUX buffer.
|
|
|
+ *
|
|
|
+ * However, since this driver supports per-CPU and per-task inherit
|
|
|
+ * we cannot use the user mapping since it will not be availble
|
|
|
+ * if we're not running the owning process.
|
|
|
+ *
|
|
|
+ * With PTI we can't use the kernal map either, because its not
|
|
|
+ * there when we run userspace.
|
|
|
+ *
|
|
|
+ * For now, disable this driver when using PTI.
|
|
|
+ */
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
+
|
|
|
bts_pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_ITRACE |
|
|
|
PERF_PMU_CAP_EXCLUSIVE;
|
|
|
bts_pmu.task_ctx_nr = perf_sw_context;
|