]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86/intel: Fix PEBSv3 record drain
authorPeter Zijlstra <peterz@infradead.org>
Wed, 7 Sep 2016 12:42:55 +0000 (14:42 +0200)
committerIngo Molnar <mingo@kernel.org>
Sat, 10 Sep 2016 09:15:39 +0000 (11:15 +0200)
commit617ba9560d777b444e0812189634ba206acfc716
treebd285322b8602641ffed3ccaa84036f46a90e032
parentf45f3ab7d798e17a71305018b9841ca1cf3ae7cb
perf/x86/intel: Fix PEBSv3 record drain

Alexander hit the WARN_ON_ONCE(!event) on his Skylake while running
the perf fuzzer.

This means the PEBSv3 record included a status bit for an inactive
event, something that _should_ not happen.

Move the code that filters the status bits against our known PEBS
events up a spot to guarantee we only deal with events we know about.

Further add "continue" statements to the WARN_ON_ONCE()s such that
we'll not die nor generate silly events in case we ever do hit them
again.

Reported-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Tested-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.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 <vince@deater.net>
Cc: stable@vger.kernel.org
Fixes: 576600aac4b0 ("perf/x86/intel/pebs: Add PEBSv3 decoding")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/intel/ds.c