summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-11-12 18:15:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-25 19:45:54 +0300
commit5e2f14d77223ab7c0bae83f8f2ab3bde6a2bb028 (patch)
tree90960a620c4e0f56b09a4eb739fde8506826f729 /arch/x86
parent62634b43d3c4e1bf62fd540196f7081bf0885c0a (diff)
downloadlinux-5e2f14d77223ab7c0bae83f8f2ab3bde6a2bb028.tar.xz
perf/x86/intel/pt: Fix sampling using single range output
commit ce0d998be9274dd3a3d971cbeaa6fe28fd2c3062 upstream. Deal with errata TGL052, ADL037 and RPL017 "Trace May Contain Incorrect Data When Configured With Single Range Output Larger Than 4KB" by disabling single range output whenever larger than 4KB. Fixes: 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221112151508.13768-1-adrian.hunter@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/events/intel/pt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c
index 95234f46b0fb..d87421acddc3 100644
--- a/arch/x86/events/intel/pt.c
+++ b/arch/x86/events/intel/pt.c
@@ -1247,6 +1247,15 @@ static int pt_buffer_try_single(struct pt_buffer *buf, int nr_pages)
if (1 << order != nr_pages)
goto out;
+ /*
+ * Some processors cannot always support single range for more than
+ * 4KB - refer errata TGL052, ADL037 and RPL017. Future processors might
+ * also be affected, so for now rather than trying to keep track of
+ * which ones, just disable it for all.
+ */
+ if (nr_pages > 1)
+ goto out;
+
buf->single = true;
buf->nr_pages = nr_pages;
ret = 0;