Commit 3abb6b16 authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens
Browse files

s390/pai_crypto: Introduce PAI crypto specific event delete function



Introduce PAI crypto specific event delete function to handle
additional actions to be done at event removal.

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 35a27bad
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -138,7 +138,6 @@ static void pai_event_destroy(struct perf_event *event)
{
	int cpu;

	static_branch_dec(&pai_key);
	free_page(PAI_SAVE_AREA(event));
	if (event->cpu == -1) {
		struct cpumask *mask = PAI_CPU_MASK(event);
@@ -151,6 +150,12 @@ static void pai_event_destroy(struct perf_event *event)
	}
}

static void paicrypt_event_destroy(struct perf_event *event)
{
	static_branch_dec(&pai_key);
	pai_event_destroy(event);
}

static u64 pai_getctr(unsigned long *page, int nr, unsigned long offset)
{
	if (offset)
@@ -360,7 +365,7 @@ static int paicrypt_event_init(struct perf_event *event)
	int rc = pai_event_init(event, PAI_PMU_CRYPTO);

	if (!rc) {
		event->destroy = pai_event_destroy;
		event->destroy = paicrypt_event_destroy;
		static_branch_inc(&pai_key);
	}
	return rc;