From: Marc Zyngier <maz@kernel.org>
To: Linus Walleij <linusw@kernel.org>
Cc: "Jie Feng" <hjf3108@gmail.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Ray Jui" <rjui@broadcom.com>,
"Scott Branden" <sbranden@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Russell King" <linux@armlinux.org.uk>,
"William Zhang" <william.zhang@broadcom.com>,
"Anand Gore" <anand.gore@broadcom.com>,
"Kursad Oney" <kursad.oney@broadcom.com>,
"Rafał Miłecki" <rafal@milecki.pl>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ARM: bcm: support more than two CPUs on BCMBCA
Date: Wed, 02 Dec 2026 12:02:16 +0000 [thread overview]
Message-ID: <86ecbzyjp3.wl-maz@kernel.org> (raw)
In-Reply-To: <CAD++jL=Rf2jg85g75fbW-RC_=6JhPB3KaqWij436VwvkaWSX7Q@mail.gmail.com>
On Tue, 01 Dec 2026 15:26:06 +0000,
Linus Walleij <linusw@kernel.org> wrote:
>
> On Tue, Dec 1, 2026 at 3:49 PM Jie Feng <hjf3108@gmail.com> wrote:
>
> > > Yes? And it wakes up the secondary core targeted by that IPI,
> > > right?
>
> > And all the other secondary cores too. arch_send_wakeup_ipi_mask(CPU1)
> > wakes up CPU2 and CPU3.
>
> Aha OK that's unfortunate :(
>
> > I tested what you had suggested, write
> > secondary_startup_arm into the mailbox before the IPI and the router
> > crashed on boot up.
> > The reason is because irq-gic's gic_cpu_map is 0xff, so IPIs get sent
> > to all CPUs. I am not sure how to solve this without a holding pen, or
> > bypassing irq-gic directly writing to the GIC registers.
>
> Actually I think it is 0xfe when we get here.
> irq-gic.c initializes each gic_cpu_map[] entry to 0xff, but CPU0 then
> discovers its own interface bit from the banked GICD_ITARGETSR0–7
> registers and clears it from every other entry.
>
> But yes it has the same effect that IPIs from CPU0 will get broadcast
> to CPU1, 2, 3. The idea is for CPU1 to mask itself from the mask
> once it starts, and if the IPI has the effect of sending a broadcast
> to all three secondary CPUs this causes problems of course :/
>
> We ask Marc Zyngier what is going on here and how
> to fix it.
>
> Marc is there a good way to direct IPIs to a specific CPU for
> secondary CPU startup in the arm,cortex-a7-gic? Or do we need
> to use the "pen" method of putting the three CPUs to a spin wait?
The main issue here is that this is using the GIC driver to talk to
CPUs that the GIC driver doesn't know about yet, and this results in
the wrong behaviour. Not exactly surprising.
We avoided this particular pitfall on arm64 by not using interrupts at
all for our "spin-table" method, and instead relying on data being
written at specific addresses with a WFE/SEV pairing.
I think your best bet is to generate the SGI as a raw access to the
GIC, without involving the driver. This also means that this code must
know about the matching of the GIC view of a CPU and the CPU you
actually want to boot (the equivalent of gic_cpu_map[]).
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
prev parent reply other threads:[~2026-12-02 12:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 14:28 [PATCH 0/2] ARM: bcm: support more than two CPUs on BCMBCA Ho Jie Feng
2026-11-23 14:21 ` [PATCH 1/2] dt-bindings: arm: cpus: Require cpu-release-addr on bca-smp secondaries Ho Jie Feng
2026-11-23 14:34 ` Ho Jie Feng
2026-11-30 21:56 ` Linus Walleij
2026-11-23 14:22 ` [PATCH 2/2] ARM: bcm: support more than two CPUs on BCMBCA Ho Jie Feng
2026-11-25 18:47 ` William Zhang
2026-11-26 3:13 ` Jie Feng
2026-11-25 21:00 ` Linus Walleij
2026-11-26 3:05 ` Jie Feng
2026-11-27 2:49 ` William Zhang
2026-11-27 2:49 ` William Zhang
2026-11-30 15:12 ` Jie Feng
2026-11-30 15:22 ` Jie Feng
2026-12-01 13:48 ` Linus Walleij
2026-12-01 14:48 ` Jie Feng
2026-12-01 15:26 ` Linus Walleij
2026-12-02 12:02 ` Marc Zyngier [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=86ecbzyjp3.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=anand.gore@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=hjf3108@gmail.com \
--cc=kursad.oney@broadcom.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=rafal@milecki.pl \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=william.zhang@broadcom.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 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.