]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/pai_crypto: Add common pai_del() function
authorThomas Richter <tmricht@linux.ibm.com>
Wed, 5 Nov 2025 14:38:57 +0000 (15:38 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 14 Nov 2025 10:30:07 +0000 (11:30 +0100)
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.
Add a common usable function pai_stop() for the event on a CPU.

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>
arch/s390/kernel/perf_pai_crypto.c

index 5d4b9ffe3cb156bde9c9de4ee33f16913b11b5c7..a014f4a1b4433fea9565692af683ff497b5dc0a0 100644 (file)
@@ -460,18 +460,24 @@ static void paicrypt_stop(struct perf_event *event, int flags)
        pai_stop(event, flags);
 }
 
-static void paicrypt_del(struct perf_event *event, int flags)
+static void pai_del(struct perf_event *event, int flags)
 {
        struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
        struct pai_map *cpump = mp->mapptr;
+       int idx = PAI_PMU_IDX(event);
 
-       paicrypt_stop(event, PERF_EF_UPDATE);
+       pai_pmu[idx].pmu->stop(event, PERF_EF_UPDATE);
        if (--cpump->active_events == 0) {
                local_ctl_clear_bit(0, CR0_CRYPTOGRAPHY_COUNTER_BIT);
                WRITE_ONCE(get_lowcore()->ccd, 0);
        }
 }
 
+static void paicrypt_del(struct perf_event *event, int flags)
+{
+       pai_del(event, flags);
+}
+
 /* Create raw data and save it in buffer. Calculate the delta for each
  * counter between this invocation and the last invocation.
  * Returns number of bytes copied.