perf/x86: Fix exclusion of BTS and LBR for Goldmont
Subsystems (3)
PATCH 1/1 perf/x86: Fix exclusion of BTS and LBR for Goldmont
From: Andi Kleen <[email protected]>
The earlier patch ccbebba4 allowed enabling PT and LBR at the same time on Goldmont. However it also allowed enabling BTS and LBR at the same time, which is still not supported. Fix this by bypassing the check only for PT.
Marking for stable because this allows crashing kernels. Also should be merged for 4.9.
--- arch/x86/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/events/core.c +2 -2
@@ -364,7 +364,7 @@ int x86_add_exclusive(unsigned int what) {int i; -if (x86_pmu.lbr_pt_coexist) +if (what == x86_lbr_exclusive_pt && x86_pmu.lbr_pt_coexist)return 0 ;if (!atomic_inc_not_zero (&x86_pmu.lbr_exclusive[what])) {
@@ -387,7 +387,7 @@ fail_unlock:void x86_del_exclusive (unsigned int what) { -if (x86_pmu.lbr_pt_coexist) +if (what == x86_lbr_exclusive_pt && x86_pmu.lbr_pt_coexist)return ;atomic_dec (&x86_pmu.lbr_exclusive[what]);
Signature · 1 line
2.9.3
Peter Zijlstra
maintainerFor some reason this patch never hit my inbox, it could be because you're wrecked the Cc line and either infradead or my mta dropped the email because of that.
Quoted 3 lines · Andi Kleen
From: Andi Kleen <[email protected]>
The earlier patch
ccbebba4allowed enabling PT and LBR at the same
SHAs should be 12 chars.
Quoted 8 lines
time on Goldmont. However it also allowed enabling BTS and LBR at the same time, which is still not supported. Fix this by bypassing the check only for PT.
Marking for stable because this allows crashing kernels. Also should be merged for 4.9.
Fixes ccbebba4 ("erf/x86/intel/pt: Bypass PT vs. LBR exclusivity if the core supports it")
same
Quoted 13 lines
Cc [email protected] # 4.6+Signed-off-by Andi Kleen <[email protected]>--- arch/x86/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/x86/events/core.c +0
-0
arch/x86/events/core.c int x86_add_exclusive(unsigned int what) · line 368
Quoted 6 lines
arch/x86/events/core.c +1
-1@@ -364,7 +364,7 @@ int x86_add_exclusive(unsigned int what) {int i; -if (x86_pmu.lbr_pt_coexist) +if (what == x86_lbr_exclusive_pt && x86_pmu.lbr_pt_coexist)return 0 ;
This would also allow PT & BTS at the same time, is that a supported configuration?
Quoted 2 lines
arch/x86/events/core.c +0
-0if (!atomic_inc_not_zero (&x86_pmu.lbr_exclusive[what])) {
Quoted 6 lines
arch/x86/events/core.c int x86_add_exclusive(unsigned int what) · line 368
Quoted 3 lines
arch/x86/events/core.c +1
-1-if (x86_pmu.lbr_pt_coexist) +if (what == x86_lbr_exclusive_pt && x86_pmu.lbr_pt_coexist)return 0 ;This would also allow PT & BTS at the same time, is that a supported configuration?
Yes it is on Goldmont.
-Andi