summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2025-11-05 15:38:49 +0100
committerHeiko Carstens <hca@linux.ibm.com>2025-11-14 11:30:05 +0100
commit42cd0c82422775e34528b9d0df438e51150a4db9 (patch)
treee7b5cfb49a97a14bf058d95e17d0c6d014a0e176
parent65b9831bd3ced5acb0d4a0fad66f7585a3ad3db8 (diff)
s390/pai_crypto: Rename paicrypt_getdata() to pai_getdata()
To support one common PAI PMU device driver which handles both PMUs pai_crypto and pai_ext, use a common naming scheme for structures and variables suitable for both device drivers. Rename paicrypt_getdata() to pai_getdata(). Use the PAI PMU characteristics in the pai_pmu table to determine the number of counters to be extracted. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Reviewed-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r--arch/s390/kernel/perf_pai_crypto.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c
index 4b4c22bf6171..8b3f6c624e81 100644
--- a/arch/s390/kernel/perf_pai_crypto.c
+++ b/arch/s390/kernel/perf_pai_crypto.c
@@ -159,23 +159,25 @@ static u64 paicrypt_getctr(unsigned long *page, int nr, bool kernel)
return page[nr];
}
-/* Read the counter values. Return value from location in CMP. For event
- * CRYPTO_ALL sum up all events.
+/* Read the counter values. Return value from location in CMP. For base
+ * event xxx_ALL sum up all events. Returns counter value.
*/
-static u64 paicrypt_getdata(struct perf_event *event, bool kernel)
+static u64 pai_getdata(struct perf_event *event, bool kernel)
{
struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
struct pai_map *cpump = mp->mapptr;
+ int idx = PAI_PMU_IDX(event);
+ struct pai_pmu *pp = &pai_pmu[idx];
+ unsigned int i;
u64 sum = 0;
- int i;
- if (event->attr.config != PAI_CRYPTO_BASE) {
+ if (event->attr.config != pp->base) {
return paicrypt_getctr(cpump->area,
- event->attr.config - PAI_CRYPTO_BASE,
+ event->attr.config - pp->base,
kernel);
}
- for (i = 1; i <= paicrypt_cnt; i++) {
+ for (i = 1; i <= pp->num_avail; i++) {
u64 val = paicrypt_getctr(cpump->area, i, kernel);
if (!val)
@@ -190,9 +192,9 @@ static u64 paicrypt_getall(struct perf_event *event)
u64 sum = 0;
if (!event->attr.exclude_kernel)
- sum += paicrypt_getdata(event, true);
+ sum += pai_getdata(event, true);
if (!event->attr.exclude_user)
- sum += paicrypt_getdata(event, false);
+ sum += pai_getdata(event, false);
return sum;
}