mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] s390/pai: Add node for s390 PAI counter support
@ 2024-08-05 13:07 Thomas Richter
  0 siblings, 0 replies; only message in thread
From: Thomas Richter @ 2024-08-05 13:07 UTC (permalink / raw)
  To: linux-kernel
  Cc: agordeev, gor, hca, sumanthk, Thomas Richter, Peter Zijlstra,
	Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim

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.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>

---
 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(-)

diff --git a/arch/s390/include/asm/pai.h b/arch/s390/include/asm/pai.h
index 25f2077ba3c9..e4fb8b522f56 100644
--- a/arch/s390/include/asm/pai.h
+++ b/arch/s390/include/asm/pai.h
@@ -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
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c
index 2f5a20e300f6..429eab978b68 100644
--- a/arch/s390/kernel/perf_pai_crypto.c
+++ b/arch/s390/kernel/perf_pai_crypto.c
@@ -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);
 }
 
diff --git a/arch/s390/kernel/perf_pai_ext.c b/arch/s390/kernel/perf_pai_ext.c
index 6295531b39a2..e9d2dd1b478f 100644
--- a/arch/s390/kernel/perf_pai_ext.c
+++ b/arch/s390/kernel/perf_pai_ext.c
@@ -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);
 }
 
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 1a8942277dda..d54e10c61d9e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -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 */
 			/*
-- 
2.45.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-05 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-05 13:07 [PATCH] s390/pai: Add node for s390 PAI counter support Thomas Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®