Commit 59dbc2a4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

perf/x86/intel: Don't accidentally clear high bits in bdw_limit_period()

commit e5ea9b54 upstream.

We intended to clear the lowest 6 bits but because of a type bug we
clear the high 32 bits as well.  Andi says that periods are rarely more
than U32_MAX so this bug probably doesn't have a huge runtime impact.
Signed-off-by: default avatarDan Carpenter <>
Signed-off-by: default avatarPeter Zijlstra (Intel) <>
Cc: Alexander Shishkin <>
Cc: Arnaldo Carvalho de Melo <>
Cc: H. Peter Anvin <>
Cc: Jiri Olsa <>
Cc: Kan Liang <>
Cc: Linus Torvalds <>
Cc: Peter Zijlstra <>
Cc: Sebastian Andrzej Siewior <>
Cc: Stephane Eranian <>
Cc: Thomas Gleixner <>
Cc: Vince Weaver <>
Fixes: 294fe0f5 ("perf/x86/intel: Add INST_RETIRED.ALL workarounds")
Link: default avatarIngo Molnar <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 227e2f91
......@@ -3194,7 +3194,7 @@ static unsigned bdw_limit_period(struct perf_event *event, unsigned left)
X86_CONFIG(.event=0xc0, .umask=0x01)) {
if (left < 128)
left = 128;
left &= ~0x3fu;
left &= ~0x3fULL;
return left;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment