From: Leo Yan <leo.yan@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: "Johnny.Fan" <johnny.fan@cixtech.com>,
will@kernel.org, mark.rutland@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
james.clark@linaro.org, jeremy.linton@arm.com,
cix-kernel-upstream@cixtech.com, bob.zhang@cixtech.com,
jie.fu@cixtech.com, Fugang Duan <fugang.duan@cixtech.com>
Subject: Re: [PATCH] perf: arm_spe: Support heterogeneous ACPI systems
Date: Thu, 15 Oct 2026 15:19:26 +0100 [thread overview]
Message-ID: <20261015141926.GC26205@e132581.arm.com> (raw)
In-Reply-To: <86mrsf1bnv.wl-maz@kernel.org>
On Thu, Oct 15, 2026 at 11:49:24AM +0100, Marc Zyngier wrote:
[...]
> > The CPUs without SPE are trimmed from the PMU supported CPUs by
> > probing PMSVer on each CPU, both at probe time (for online CPUs) and
> > from the hotplug callback (for CPUs that were offline at probe), as
> > ACPI conveys no affinity information and the PPI otherwise defaults
> > to all possible CPUs.
>
> This is a bit odd: at the beginning, you are stating that the SPE
> interrupt being 0 is an indication of SPE not being supported. Then
> you check for PMSVer for the same properly. This seems pretty wrong.
>
> It should be possible to build the mask of SPE-enabled CPUs without
> IPI-ing the other CPUs, and only rely on the firmware table.
Agreed.
The SPE driver probes its capabilities on one CPU selected by
smp_call_function_any(), then performs local setup on every CPU in
supported_cpus. It therefore relies on that mask being accurate;
including a CPU without SPE could lead to accesses to unimplemented
SPE system registers.
> > @@ -97,6 +100,20 @@ arm_acpi_register_pmu_device(struct platform_device *pdev, u8 len,
> > return gsi ? -ENXIO : 0;
> >
> > this_gsi = parse_gsi(gicc);
> > +
> > + if (optional) {
> > + if (!this_gsi)
> > + continue;
> > +
> > + if (gsi && gsi != this_gsi) {
> > + pr_warn("ACPI: %s: CPU%d: inconsistent interrupt %u/%u\n",
> > + pdev->name, cpu, gsi, this_gsi);
> > + return -ENXIO;
> > + }
> > + gsi = this_gsi;
> > + continue;
> > + }
> > +
>
> This "optional" parameter feels very wrong. We now have an
> infrastructure to get a set of affinities for an interrupt (see
> 5324fe21ba9b7 and following patches). What this needs is ACPI to be
> plumbed into this.
>
> Unfortunately, ACPI is awkward and very badly abstracted in this area,
> but that doesn't mean we should make the driver code more bizarre.
>
> Treating SPE and TRBE differently is just as odd, and there is no
> reason to do other than suiting your particular platform.
Yes, SPE and TRBE should be consistent.
There is also a grouping question for SPE and TRBE. If all participating
CPUs implement the feature, but have different capabilities, should ACPI
registration create separate platform devices for the compatible CPU
groups? DT can describe separate CPU subsets using PPI partitions [1].
Thanks,
Leo
[1] https://github.com/torvalds/linux/blob/0fcb05b72344f40806cbe810de8872f1698bf053/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml#L139
[2] https://git.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a.git/+/refs/heads/master/fdts/tc-base.dtsi#328
prev parent reply other threads:[~2026-10-15 14:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 6:29 [PATCH] perf: arm_spe: Support heterogeneous ACPI systems Johnny.Fan
2026-10-15 6:42 ` sashiko-bot
2026-10-15 10:49 ` Marc Zyngier
2026-10-15 11:52 ` Johnny Fan
2026-10-15 15:58 ` Jeremy Linton
2026-10-15 14:19 ` Leo Yan [this message]
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=20261015141926.GC26205@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=bob.zhang@cixtech.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=fugang.duan@cixtech.com \
--cc=james.clark@linaro.org \
--cc=jeremy.linton@arm.com \
--cc=jie.fu@cixtech.com \
--cc=johnny.fan@cixtech.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.