linux-sg2042/arch/x86/events/intel
Kan Liang fd583ad156 perf/x86: Fix spurious NMI with PEBS Load Latency event
Spurious NMIs will be observed with the following command:

  while :; do
    perf record -bae "cpu/umask=0x01,event=0xcd,ldlat=0x80/pp"
                  -e "cpu/umask=0x03,event=0x0/"
                  -e "cpu/umask=0x02,event=0x0/"
                  -e cycles,branches,cache-misses
                  -e cache-references -- sleep 10
  done

The bug was introduced by commit:

  8077eca079 ("perf/x86/pebs: Add workaround for broken OVFL status on HSW+")

That commit clears the status bits for the counters used for PEBS
events, by masking the whole 64 bits pebs_enabled. However, only the
low 32 bits of both status and pebs_enabled are reserved for PEBS-able
counters.

For status bits 32-34 are fixed counter overflow bits. For
pebs_enabled bits 32-34 are for PEBS Load Latency.

In the test case, the PEBS Load Latency event and fixed counter event
could overflow at the same time. The fixed counter overflow bit will
be cleared by mistake. Once it is cleared, the fixed counter overflow
never be processed, which finally trigger spurious NMI.

Correct the PEBS enabled mask by ignoring the non-PEBS bits.

Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Fixes: 8077eca079 ("perf/x86/pebs: Add workaround for broken OVFL status on HSW+")
Link: http://lkml.kernel.org/r/1491333246-3965-1-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-04-14 10:31:39 +02:00
..
Makefile x86/perf/intel/rapl: Fix module name collision with powercap intel-rapl 2016-07-06 12:51:59 +02:00
bts.c perf/core: Keep AUX flags in the output handle 2017-03-16 09:51:10 +01:00
core.c perf/x86: Fix spurious NMI with PEBS Load Latency event 2017-04-14 10:31:39 +02:00
cqm.c cpu/hotplug: Cleanup state names 2016-12-25 10:47:44 +01:00
cstate.c x86/events: Remove last remnants of old filenames 2017-03-01 11:27:26 +01:00
ds.c perf/x86: Fix spurious NMI with PEBS Load Latency event 2017-04-14 10:31:39 +02:00
knc.c perf/x86/intel: Fix PEBS warning by only restoring active PMU in pmi 2016-03-08 12:18:32 +01:00
lbr.c perf/x86: Avoid exposing wrong/stale data in intel_pmu_lbr_read_32() 2017-04-14 10:18:00 +02:00
p4.c perf/x86/intel/p4: Trival indentation fix, remove space 2016-05-20 09:18:22 +02:00
p6.c perf/x86: Move perf_event.h to its new home 2016-02-17 10:11:36 +01:00
pt.c perf/x86/intel/pt: Allow the disabling of branch tracing 2017-03-30 09:53:49 +02:00
pt.h perf/x86/intel/pt: Allow the disabling of branch tracing 2017-03-30 09:53:49 +02:00
rapl.c x86/events: Remove last remnants of old filenames 2017-03-01 11:27:26 +01:00
uncore.c perf/x86/intel: Add Kaby Lake support 2017-02-11 21:28:23 +01:00
uncore.h x86/events: Remove last remnants of old filenames 2017-03-01 11:27:26 +01:00
uncore_nhmex.c perf/x86/intel/uncore: Clean up hardware on exit 2016-02-29 09:35:15 +01:00
uncore_snb.c perf/x86/uncore: Fix crash by removing bogus event_list[] handling for SNB client uncore IMC 2016-11-16 09:46:35 +01:00
uncore_snbep.c perf/x86/intel/uncore: Fix hardcoded socket 0 assumption in the Haswell init code 2017-01-11 12:13:21 +01:00