public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/x86/amd: Explicitly define PERF_COUNT_HW_REF_CPU_CYCLES as undefined.
@ 2016-04-27  1:19 Adam Borowski
  2016-04-27  8:03 ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Borowski @ 2016-04-27  1:19 UTC (permalink / raw)
  To: linux-kernel, Stephane Eranian, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, Borislav Petkov
  Cc: Adam Borowski

filter_events() relies on the value of 0 to remove events that are not
applicable, like this one.

UBSAN: Undefined behaviour in arch/x86/events/amd/core.c:132:30
index 9 is out of range for type 'u64 [9]'
UBSAN: Undefined behaviour in arch/x86/events/amd/core.c:132:9
load of address ffffffff81c021c8 with insufficient space
for an object of type 'const u64'

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
---
 arch/x86/events/amd/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
index 86a9bec..5fa1b8e 100644
--- a/arch/x86/events/amd/core.c
+++ b/arch/x86/events/amd/core.c
@@ -125,6 +125,7 @@ static const u64 amd_perfmon_event_map[] =
   [PERF_COUNT_HW_BRANCH_MISSES]			= 0x00c3,
   [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND]	= 0x00d0, /* "Decoder empty" event */
   [PERF_COUNT_HW_STALLED_CYCLES_BACKEND]	= 0x00d1, /* "Dispatch stalls" event */
+  [PERF_COUNT_HW_REF_CPU_CYCLES]		=      0,
 };
 
 static u64 amd_pmu_event_map(int hw_event)
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-28  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27  1:19 [PATCH] perf/x86/amd: Explicitly define PERF_COUNT_HW_REF_CPU_CYCLES as undefined Adam Borowski
2016-04-27  8:03 ` Ingo Molnar
2016-04-27  9:32   ` Adam Borowski
2016-04-27  9:35     ` [PATCH] perf/x86/amd: Set the size of event map array to PERF_COUNT_HW_MAX Adam Borowski
2016-04-28  8:24       ` [tip:perf/urgent] " tip-bot for Adam Borowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox