Blame SOURCES/0001-Fix-for-the-topa_entry-issue.patch

5b7cf4
From 374cde9c0aeb84da9e993641220c8b23adebab20 Mon Sep 17 00:00:00 2001
5b7cf4
From: Lianbo Jiang <lijiang@redhat.com>
5b7cf4
Date: Wed, 13 Jul 2022 17:23:05 +0800
5b7cf4
Subject: [PATCH 1/3] Fix for the topa_entry issue
5b7cf4
5b7cf4
kernel commit 59388b9cbe20 ("[x86] perf/x86/intel/pt: Split ToPA metadata
5b7cf4
and page layout") moved out the table of topa entry from struct topa, which
5b7cf4
may cause the following failures:
5b7cf4
[1] invalid kernel virtual address: 0  type: "struct topa_entry"
5b7cf4
[2] current buffer not found
5b7cf4
5b7cf4
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
5b7cf4
---
5b7cf4
 ptdump.c | 4 ++++
5b7cf4
 1 file changed, 4 insertions(+)
5b7cf4
5b7cf4
diff --git a/ptdump.c b/ptdump.c
5b7cf4
index f5eb110fe1cd..736e1c8cddaf 100644
5b7cf4
--- a/ptdump.c
5b7cf4
+++ b/ptdump.c
5b7cf4
@@ -183,6 +183,10 @@ int init_pt_info(int cpu)
5b7cf4
 		       &output_off))
5b7cf4
 		goto out_error;
5b7cf4
 
5b7cf4
+	/* fixup the address of topa table */
5b7cf4
+	if (STRUCT_EXISTS("topa_page") && topa_base)
5b7cf4
+		topa_base -= MEMBER_SIZE("topa_page", "table");
5b7cf4
+
5b7cf4
 	dbgprintf(fp, "[%d] buf.cur=0x%016lx\n", cpu, topa_base);
5b7cf4
 	dbgprintf(fp, "[%d] buf.cur_idx=0x%08x\n", cpu, topa_idx);
5b7cf4
 	dbgprintf(fp, "[%d] buf.output_off=0x%016lx\n", cpu, output_off);
5b7cf4
-- 
5b7cf4
2.31.1
5b7cf4