[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <925c34a4b7f0defc3582a9fcccb6af1c21279a86.1755096883.git.robin.murphy@arm.com>
Date: Wed, 13 Aug 2025 18:00:58 +0100
From: Robin Murphy <robin.murphy@....com>
To: peterz@...radead.org,
mingo@...hat.com,
will@...nel.org,
mark.rutland@....com,
acme@...nel.org,
namhyung@...nel.org,
alexander.shishkin@...ux.intel.com,
jolsa@...nel.org,
irogers@...gle.com,
adrian.hunter@...el.com,
kan.liang@...ux.intel.com
Cc: linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-alpha@...r.kernel.org,
linux-snps-arc@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
imx@...ts.linux.dev,
linux-csky@...r.kernel.org,
loongarch@...ts.linux.dev,
linux-mips@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org,
sparclinux@...r.kernel.org,
linux-pm@...r.kernel.org,
linux-rockchip@...ts.infradead.org,
dmaengine@...r.kernel.org,
linux-fpga@...r.kernel.org,
amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org,
intel-xe@...ts.freedesktop.org,
coresight@...ts.linaro.org,
iommu@...ts.linux.dev,
linux-amlogic@...ts.infradead.org,
linux-cxl@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: [PATCH 06/19] ARM: l2x0: Fix group validation
The group validation here is almost right, but fails to count the new
event itself. While we fix that, also adopt the standard pattern to
avoid racy access the sibling list and drop checks that are redundant
with core code.
Signed-off-by: Robin Murphy <robin.murphy@....com>
---
arch/arm/mm/cache-l2x0-pmu.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c
index 93ef0502b7ff..6fc1171031a8 100644
--- a/arch/arm/mm/cache-l2x0-pmu.c
+++ b/arch/arm/mm/cache-l2x0-pmu.c
@@ -274,18 +274,17 @@ static bool l2x0_pmu_group_is_valid(struct perf_event *event)
struct pmu *pmu = event->pmu;
struct perf_event *leader = event->group_leader;
struct perf_event *sibling;
- int num_hw = 0;
+ int num_hw = 1;
+
+ if (leader == event)
+ return true;
if (leader->pmu == pmu)
num_hw++;
- else if (!is_software_event(leader))
- return false;
for_each_sibling_event(sibling, leader) {
if (sibling->pmu == pmu)
num_hw++;
- else if (!is_software_event(sibling))
- return false;
}
return num_hw <= PMU_NR_COUNTERS;
--
2.39.2.101.g768bb238c484.dirty
Powered by blists - more mailing lists