Skip to content

Commit 42e6a0f

Browse files
Thomas Richterhcahca
authored andcommitted
s390/pai_crypto: Add common pai_del() function
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>
1 parent ac03223 commit 42e6a0f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,18 +460,24 @@ static void paicrypt_stop(struct perf_event *event, int flags)
460460
pai_stop(event, flags);
461461
}
462462

463-
static void paicrypt_del(struct perf_event *event, int flags)
463+
static void pai_del(struct perf_event *event, int flags)
464464
{
465465
struct pai_mapptr *mp = this_cpu_ptr(pai_root.mapptr);
466466
struct pai_map *cpump = mp->mapptr;
467+
int idx = PAI_PMU_IDX(event);
467468

468-
paicrypt_stop(event, PERF_EF_UPDATE);
469+
pai_pmu[idx].pmu->stop(event, PERF_EF_UPDATE);
469470
if (--cpump->active_events == 0) {
470471
local_ctl_clear_bit(0, CR0_CRYPTOGRAPHY_COUNTER_BIT);
471472
WRITE_ONCE(get_lowcore()->ccd, 0);
472473
}
473474
}
474475

476+
static void paicrypt_del(struct perf_event *event, int flags)
477+
{
478+
pai_del(event, flags);
479+
}
480+
475481
/* Create raw data and save it in buffer. Calculate the delta for each
476482
* counter between this invocation and the last invocation.
477483
* Returns number of bytes copied.

0 commit comments

Comments
 (0)