summaryrefslogtreecommitdiff
path: root/arch/s390
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2025-08-22 14:05:57 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-19 16:32:02 +0200
commitd660c8d8142efa8604b7fcd69c15435f34580e13 (patch)
tree198f0cc8df8272b79787b0cc08348ee98f6799fe /arch/s390
parent1262bda871dace8c6efae25f3b6a2d34f6f06d54 (diff)
downloadlinux-d660c8d8142efa8604b7fcd69c15435f34580e13.tar.gz
linux-d660c8d8142efa8604b7fcd69c15435f34580e13.tar.bz2
linux-d660c8d8142efa8604b7fcd69c15435f34580e13.zip
s390/cpum_cf: Deny all sampling events by counter PMU
[ Upstream commit ce971233242b5391d99442271f3ca096fb49818d ] Deny all sampling event by the CPUMF counter facility device driver and return -ENOENT. This return value is used to try other PMUs. Up to now events for type PERF_TYPE_HARDWARE were not tested for sampling and returned later on -EOPNOTSUPP. This ends the search for alternative PMUs. Change that behavior and try other PMUs instead. Fixes: 613a41b0d16e ("s390/cpum_cf: Reject request for sampling in event initialization") Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/perf_cpum_cf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index 65a66df5bb86..771e1cb17540 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -757,8 +757,6 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
break;
case PERF_TYPE_HARDWARE:
- if (is_sampling_event(event)) /* No sampling support */
- return -ENOENT;
ev = attr->config;
if (!attr->exclude_user && attr->exclude_kernel) {
/*
@@ -856,6 +854,8 @@ static int cpumf_pmu_event_init(struct perf_event *event)
unsigned int type = event->attr.type;
int err;
+ if (is_sampling_event(event)) /* No sampling support */
+ return err;
if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW)
err = __hw_perf_event_init(event, type);
else if (event->pmu->type == type)