Skip to contentSkip to conversation

s390/pai: Add node for s390 PAI counter support

PATCH New Thomas Richter 1 participant 1 message Aug 5, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/pai: Add node for s390 PAI counter support

Commits

9f66572f2889 ("s390/pai_crypto: Enable per-task and system-wide sampling event") 582cc1b28e8c ("s390/pai_ext: Enable per-task and system-wide sampling event")

introduced support for multiple concurrent system-wide counting and sampling events for s390 Processor Assist Information (PAI) counters. Multiple s390 PAI counter events active at the same time are chained by a list. Add an s390 specific structure with number pai_node to chain these events using hw_perf_event::pai_node.

Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 arch/s390/include/asm/pai.h        | 2 +-
 arch/s390/kernel/perf_pai_crypto.c | 2 +-
 arch/s390/kernel/perf_pai_ext.c    | 2 +-
 include/linux/perf_event.h         | 3 +++
 4 files changed, 6 insertions(+), 3 deletions(-)
arch/s390/include/asm/pai.h +1 -1
index 25f2077ba3c9..e4fb8b522f56 100644
@@ -77,6 +77,6 @@ static __always_inline void pai_kernel_exit(struct pt_regs *regs)
 
 #define PAI_SAVE_AREA(x)	((x)->hw.event_base)
 #define PAI_CPU_MASK(x)		((x)->hw.addr_filters)
-#define PAI_SWLIST(x)		(&(x)->hw.tp_list)
+#define PAI_SWLIST(x)		(&(x)->hw.pai_node)
 
 #endif
arch/s390/kernel/perf_pai_crypto.c +1 -1
index 2f5a20e300f6..429eab978b68 100644
@@ -511,7 +511,7 @@ static void paicrypt_have_samples(void)
 	struct paicrypt_map *cpump = mp->mapptr;
 	struct perf_event *event;
 
-	list_for_each_entry(event, &cpump->syswide_list, hw.tp_list)
+	list_for_each_entry(event, &cpump->syswide_list, hw.pai_node)
 		paicrypt_have_sample(event, cpump);
 }
 
arch/s390/kernel/perf_pai_ext.c +1 -1
index 6295531b39a2..e9d2dd1b478f 100644
@@ -535,7 +535,7 @@ static void paiext_have_samples(void)
 	struct paiext_map *cpump = mp->mapptr;
 	struct perf_event *event;
 
-	list_for_each_entry(event, &cpump->syswide_list, hw.tp_list)
+	list_for_each_entry(event, &cpump->syswide_list, hw.pai_node)
 		paiext_have_sample(event, cpump);
 }
 
include/linux/perf_event.h +3 -0
index 1a8942277dda..d54e10c61d9e 100644
@@ -179,6 +179,9 @@ struct hw_perf_event {
 			u64	pwr_acc;
 			u64	ptsc;
 		};
+		struct { /* s390 processor assist information counter */
+			struct list_head	pai_node;
+		};
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
 		struct { /* breakpoint */
 			/*
Signature · 1 line
2.45.2