mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: agordeev@linux.ibm.com, gor@linux.ibm.com, hca@linux.ibm.com,
	sumanthk@linux.ibm.com, Thomas Richter <tmricht@linux.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>
Subject: [PATCH] s390/pai: Add node for s390 PAI counter support
Date: Mon,  5 Aug 2024 15:07:11 +0200	[thread overview]
Message-ID: <20240805130711.2580740-1-tmricht@linux.ibm.com> (raw)

Commits

9f66572f2889 ("s390/pai_crypto: Enable per-task and system-wide sampling event")
582cc1b28e8c ("s390/pai_ext: Enable per-task and system-wide sampling event")

introduced support for multiple concurrent system-wide counting
and sampling events for s390 Processor Assist Information (PAI)
counters. Multiple s390 PAI counter events active at the same time
are chained by a list.  Add an s390 specific structure with number
pai_node to chain these events using hw_perf_event::pai_node.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>

---
 arch/s390/include/asm/pai.h        | 2 +-
 arch/s390/kernel/perf_pai_crypto.c | 2 +-
 arch/s390/kernel/perf_pai_ext.c    | 2 +-
 include/linux/perf_event.h         | 3 +++
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/s390/include/asm/pai.h b/arch/s390/include/asm/pai.h
index 25f2077ba3c9..e4fb8b522f56 100644
--- a/arch/s390/include/asm/pai.h
+++ b/arch/s390/include/asm/pai.h
@@ -77,6 +77,6 @@ static __always_inline void pai_kernel_exit(struct pt_regs *regs)
 
 #define PAI_SAVE_AREA(x)	((x)->hw.event_base)
 #define PAI_CPU_MASK(x)		((x)->hw.addr_filters)
-#define PAI_SWLIST(x)		(&(x)->hw.tp_list)
+#define PAI_SWLIST(x)		(&(x)->hw.pai_node)
 
 #endif
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c
index 2f5a20e300f6..429eab978b68 100644
--- a/arch/s390/kernel/perf_pai_crypto.c
+++ b/arch/s390/kernel/perf_pai_crypto.c
@@ -511,7 +511,7 @@ static void paicrypt_have_samples(void)
 	struct paicrypt_map *cpump = mp->mapptr;
 	struct perf_event *event;
 
-	list_for_each_entry(event, &cpump->syswide_list, hw.tp_list)
+	list_for_each_entry(event, &cpump->syswide_list, hw.pai_node)
 		paicrypt_have_sample(event, cpump);
 }
 
diff --git a/arch/s390/kernel/perf_pai_ext.c b/arch/s390/kernel/perf_pai_ext.c
index 6295531b39a2..e9d2dd1b478f 100644
--- a/arch/s390/kernel/perf_pai_ext.c
+++ b/arch/s390/kernel/perf_pai_ext.c
@@ -535,7 +535,7 @@ static void paiext_have_samples(void)
 	struct paiext_map *cpump = mp->mapptr;
 	struct perf_event *event;
 
-	list_for_each_entry(event, &cpump->syswide_list, hw.tp_list)
+	list_for_each_entry(event, &cpump->syswide_list, hw.pai_node)
 		paiext_have_sample(event, cpump);
 }
 
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 1a8942277dda..d54e10c61d9e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -179,6 +179,9 @@ struct hw_perf_event {
 			u64	pwr_acc;
 			u64	ptsc;
 		};
+		struct { /* s390 processor assist information counter */
+			struct list_head	pai_node;
+		};
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
 		struct { /* breakpoint */
 			/*
-- 
2.45.2


                 reply	other threads:[~2024-08-05 13:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240805130711.2580740-1-tmricht@linux.ibm.com \
    --to=tmricht@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sumanthk@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®