* [PATCH] perf/x86/intel: Don't accidentally clear high bits in bdw_limit_period()
@ 2018-03-17 11:52 Dan Carpenter
2018-03-19 8:35 ` Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-03-17 11:52 UTC (permalink / raw)
To: kernel-janitors
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.
Fixes: 294fe0f52a44 ("perf/x86/intel: Add INST_RETIRED.ALL workarounds")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 41c68d337e84..f23f52b9de8e 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3210,7 +3210,7 @@ static u64 bdw_limit_period(struct perf_event *event, u64 left)
X86_CONFIG(.event=0xc0, .umask=0x01)) {
if (left < 128)
left = 128;
- left &= ~0x3fu;
+ left &= ~0x3fULL;
}
return left;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf/x86/intel: Don't accidentally clear high bits in bdw_limit_period()
2018-03-17 11:52 [PATCH] perf/x86/intel: Don't accidentally clear high bits in bdw_limit_period() Dan Carpenter
@ 2018-03-19 8:35 ` Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2018-03-19 8:35 UTC (permalink / raw)
To: kernel-janitors
On Sat, Mar 17, 2018 at 02:52:16PM +0300, Dan Carpenter wrote:
> 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.
Thanks Dan!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-19 8:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-17 11:52 [PATCH] perf/x86/intel: Don't accidentally clear high bits in bdw_limit_period() Dan Carpenter
2018-03-19 8:35 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox