Commit 42e6a0f6 authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens
Browse files

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: default avatarThomas Richter <tmricht@linux.ibm.com>
Reviewed-by: default avatarJan Polensky <japo@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent ac03223f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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.