lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240805130711.2580740-1-tmricht@linux.ibm.com>
Date: Mon,  5 Aug 2024 15:07:11 +0200
From: Thomas Richter <tmricht@...ux.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: agordeev@...ux.ibm.com, gor@...ux.ibm.com, hca@...ux.ibm.com,
        sumanthk@...ux.ibm.com, Thomas Richter <tmricht@...ux.ibm.com>,
        Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>
Subject: [PATCH] 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.

Signed-off-by: Thomas Richter <tmricht@...ux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@...ux.ibm.com>
Cc: Heiko Carstens <hca@...ux.ibm.com>
Cc: Vasily Gorbik <gor@...ux.ibm.com>
Cc: Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ