All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
  2018-03-20 11:15 ` [tip:perf/urgent] " tip-bot for Dan Carpenter
  0 siblings, 2 replies; 3+ 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] 3+ 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
  2018-03-20 11:15 ` [tip:perf/urgent] " tip-bot for Dan Carpenter
  1 sibling, 0 replies; 3+ 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] 3+ messages in thread

* [tip:perf/urgent] 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
@ 2018-03-20 11:15 ` tip-bot for Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Dan Carpenter @ 2018-03-20 11:15 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, peterz, linux-kernel, dan.carpenter, alexander.shishkin,
	tglx, acme, eranian, kan.liang, vincent.weaver, torvalds, mingo,
	bigeasy, jolsa

Commit-ID:  e5ea9b54a055619160bbfe527ebb7d7191823d66
Gitweb:     https://git.kernel.org/tip/e5ea9b54a055619160bbfe527ebb7d7191823d66
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Sat, 17 Mar 2018 14:52:16 +0300
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 20 Mar 2018 08:53:31 +0100

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

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: Dan Carpenter <dan.carpenter@oracle.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: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Fixes: 294fe0f52a44 ("perf/x86/intel: Add INST_RETIRED.ALL workarounds")
Link: http://lkml.kernel.org/r/20180317115216.GB4035@mwanda
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/events/intel/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 56457cb73448..9b18a227fff7 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -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;
 }

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

end of thread, other threads:[~2018-03-20 11:16 UTC | newest]

Thread overview: 3+ 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
2018-03-20 11:15 ` [tip:perf/urgent] " tip-bot for Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.