[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-16f4641166b10e199f0d7b68c2c5f004fef0bda3@git.kernel.org>
Date: Sat, 13 Jul 2019 04:10:51 -0700
From: tip-bot for Kim Phillips <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: stable@...r.kernel.org, mliska@...e.cz, puwen@...on.cn,
linux-kernel@...r.kernel.org, vincent.weaver@...ne.edu,
namhyung@...nel.org, mingo@...nel.org, Gary.Hook@....com,
tglx@...utronix.de, alexander.shishkin@...ux.intel.com,
peterz@...radead.org, eranian@...gle.com, acme@...hat.com,
Janakarajan.Natarajan@....com, kim.phillips@....com,
Suravee.Suthikulpanit@....com, jolsa@...hat.com,
torvalds@...ux-foundation.org, hpa@...or.com, bp@...en8.de
Subject: [tip:perf/urgent] perf/x86/amd/uncore: Do not set 'ThreadMask' and
'SliceMask' for non-L3 PMCs
Commit-ID: 16f4641166b10e199f0d7b68c2c5f004fef0bda3
Gitweb: https://git.kernel.org/tip/16f4641166b10e199f0d7b68c2c5f004fef0bda3
Author: Kim Phillips <kim.phillips@....com>
AuthorDate: Fri, 28 Jun 2019 21:59:20 +0000
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Sat, 13 Jul 2019 11:21:26 +0200
perf/x86/amd/uncore: Do not set 'ThreadMask' and 'SliceMask' for non-L3 PMCs
The following commit:
d7cbbe49a930 ("perf/x86/amd/uncore: Set ThreadMask and SliceMask for L3 Cache perf events")
enables L3 PMC events for all threads and slices by writing 1's in
'ChL3PmcCfg' (L3 PMC PERF_CTL) register fields.
Those bitfields overlap with high order event select bits in the Data
Fabric PMC control register, however.
So when a user requests raw Data Fabric events (-e amd_df/event=0xYYY/),
the two highest order bits get inadvertently set, changing the counter
select to events that don't exist, and for which no counts are read.
This patch changes the logic to write the L3 masks only when dealing
with L3 PMC counters.
AMD Family 16h and below Northbridge (NB) counters were not affected.
Signed-off-by: Kim Phillips <kim.phillips@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: <stable@...r.kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Gary Hook <Gary.Hook@....com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Janakarajan Natarajan <Janakarajan.Natarajan@....com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Martin Liska <mliska@...e.cz>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Pu Wen <puwen@...on.cn>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Fixes: d7cbbe49a930 ("perf/x86/amd/uncore: Set ThreadMask and SliceMask for L3 Cache perf events")
Link: https://lkml.kernel.org/r/20190628215906.4276-1-kim.phillips@amd.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/events/amd/uncore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index 85e6984c560b..c2c4ae5fbbfc 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -206,7 +206,7 @@ static int amd_uncore_event_init(struct perf_event *event)
* SliceMask and ThreadMask need to be set for certain L3 events in
* Family 17h. For other events, the two fields do not affect the count.
*/
- if (l3_mask)
+ if (l3_mask && is_llc_event(event))
hwc->config |= (AMD64_L3_SLICE_MASK | AMD64_L3_THREAD_MASK);
if (event->cpu < 0)
Powered by blists - more mailing lists