linux-stable/arch/x86/events/intel
Hugh Dickins 2c991e408d x86/events/intel/ds: Fix bts_interrupt_threshold alignment
Markus reported that BTS is sporadically missing the tail of the trace
in the perf_event data buffer: [decode error (1): instruction overflow]
shown in GDB; and bisected it to the conversion of debug_store to PTI.

A little "optimization" crept into alloc_bts_buffer(), which mistakenly
placed bts_interrupt_threshold away from the 24-byte record boundary.
Intel SDM Vol 3B 17.4.9 says "This address must point to an offset from
the BTS buffer base that is a multiple of the BTS record size."

Revert "max" from a byte count to a record count, to calculate the
bts_interrupt_threshold correctly: which turns out to fix problem seen.

Fixes: c1961a4631 ("x86/events/intel/ds: Map debug buffers in cpu_entry_area")
Reported-and-tested-by: Markus T Metzger <markus.t.metzger@intel.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@intel.com>
Cc: Andi Kleen <andi.kleen@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: stable@vger.kernel.org # v4.14+
Link: https://lkml.kernel.org/r/alpine.LSU.2.11.1807141248290.1614@eggly.anvils
2018-07-15 11:38:44 +02:00
..
bts.c x86,perf: Disable intel_bts when PTI 2018-01-14 11:42:10 +01:00
core.c perf/x86/intel: Don't enable freeze-on-smi for PerfMon V1 2018-04-25 21:41:22 +02:00
cstate.c perf/x86/cstate: Fix possible Spectre-v1 indexing for pkg_msr 2018-05-05 08:37:31 +02:00
ds.c x86/events/intel/ds: Fix bts_interrupt_threshold alignment 2018-07-15 11:38:44 +02:00
knc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lbr.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-15 01:15:52 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
p4.c x86: Mark various structures and functions as 'static' 2017-08-11 14:49:43 +02:00
p6.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-15 01:15:52 +01:00
pt.c perf/core: Fix bad use of igrab() 2018-05-25 08:11:10 +02:00
pt.h perf/x86/intel/pt: Allow the disabling of branch tracing 2017-03-30 09:53:49 +02:00
rapl.c perf/x86/intel: Add Cannon Lake support for RAPL profiling 2018-03-31 11:28:36 +02:00
uncore.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
uncore.h perf/x86/intel/uncore: Expose uncore_pmu_event*() functions 2018-05-31 12:36:28 +02:00
uncore_nhmex.c perf/x86/intel/uncore: Correct fixed counter index check for NHM 2018-05-31 12:36:28 +02:00
uncore_snb.c perf/x86/intel/uncore: Clean up client IMC uncore 2018-05-31 12:36:29 +02:00
uncore_snbep.c perf/x86/intel/uncore: Support IIO free-running counters on SKX 2018-05-31 12:36:28 +02:00