Skip to contentSkip to conversation

perf/x86/intel/pt: Fix base for single entry topa

PATCH Applied Jiri Olsa 3 participants 3 messages Oct 19, 2019 – Oct 21, 2019

Subsystems (2)
lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 perf/x86/intel/pt: Fix base for single entry topa

Jan reported failing ltp test for pt. It looks like the reason is commit 38bb8d77d0b9, that did not keep the TOPA_SHIFT for entry base, adding it back.

[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/tracing/pt_test/pt_test.c

Fixes 38bb8d77d0b9 ("perf/x86/intel/pt: Split ToPA metadata and page layout")
---
 arch/x86/events/intel/pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/pt.c +1 -1
index 74e80ed9c6c4..05e43d0f430b 100644
@@ -627,7 +627,7 @@ static struct topa *topa_alloc(int cpu, gfp_t gfp)
 	 * link as the 2nd entry in the table
 	 */
 	if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) {
-		TOPA_ENTRY(&tp->topa, 1)->base = page_to_phys(p);
+		TOPA_ENTRY(&tp->topa, 1)->base = page_to_phys(p) >> TOPA_SHIFT;
 		TOPA_ENTRY(&tp->topa, 1)->end = 1;
 	}
 
Signature · 1 line
2.21.0
merge bot Applied
#1 lore raw
The following commit has been merged into the perf/urgent branch of tip:

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     13301c6b16a6d809b331bb88e40ab9ce38238b8b
Gitweb:        https://git.kernel.org/tip/13301c6b16a6d809b331bb88e40ab9ce38238b8b
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Sun, 20 Oct 2019 00:07:26 +02:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Sun, 20 Oct 2019 14:42:28 +02:00

perf/x86/intel/pt: Fix base for single entry topa

Jan reported failing ltp test for PT:

https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/tracing/pt_test/pt_test.c

It looks like the reason is this new commit added in this v5.4 merge window:

38bb8d77d0b9 ("perf/x86/intel/pt: Split ToPA metadata and page layout")

which did not keep the TOPA_SHIFT for entry base.

Add it back.

Cc Alexander Shishkin <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Michael Petlan <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Vince Weaver <[email protected]>
Fixes 38bb8d77d0b9 ("perf/x86/intel/pt: Split ToPA metadata and page layout")
[ Minor changelog edits. ]
---
 arch/x86/events/intel/pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/pt.c +1 -1
index 74e80ed..05e43d0 100644
@@ -627,7 +627,7 @@ static struct topa *topa_alloc(int cpu, gfp_t gfp)
 	 * link as the 2nd entry in the table
 	 */
 	if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) {
-		TOPA_ENTRY(&tp->topa, 1)->base = page_to_phys(p);
+		TOPA_ENTRY(&tp->topa, 1)->base = page_to_phys(p) >> TOPA_SHIFT;
 		TOPA_ENTRY(&tp->topa, 1)->end = 1;
 	}
 
#2 lore raw
In reply to Jiri Olsa
Quoted 3 lines · Jiri Olsa

Jan reported failing ltp test for pt. It looks like the reason is commit 38bb8d77d0b9, that did not keep the TOPA_SHIFT for entry base, adding it back.

Thanks for taking care of that so quickly!

Regards,
--
Alex