From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796212939; b=SOOP6bQgTGUhh2wK636cuExxrWaBjDeXKmmyfNt82wmNSNvLceNxaTAXEBJYwIbSuEw8 lw4P7Cwex0IJ/vOswWYJJr97DX7IVGqlZKzErTKC9SILAIt6+0SPI1wkkXdnz0w4twusI SxSUqmvnuAg5R2piLRO9t6bdgkQSIQ9oKTUVlUq0WaQ0VcXk5GBjLvUlyw3cocJBveIi2 GZk6PXMD46aIMfcy/6VPbb1+D8aWn4HFIF1m8vNuvtqkNKUB+Afr7e1wzibG2vDjuM+6c R4428L2ocVMRTRBMbdTspwE82TL5FZl5VfIL2WpY8n0TQVFsa7o3Gvq0GUKSLTDRIsA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796212939; h=Received:DKIM-Signature:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: Content-Transfer-Encoding:X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To: X-SA-Exim-Mail-From:X-SA-Exim-Scanned; bh=pk9AOllbShKb11u5q6IZMYeBOuHUm1ZHlkEj5zW8fkc=; b=0/8QAViE8hnC4WF5ImH171v/egnWEhCzDfuCo1FaT4b7SiK9M+2k15LWSwOGBHVTUaKV hpuIpvIxFF7A3R5I7CiDYb2EXF7kvh0JwFVALnbhlQDA+2T5JoxQf8yzW1rrC6d1n2VeR pDqIlDUhlySK7UKoZPVXBUA5+ZpIOOt+qXnbKcnNERjBzzsvjA3MTBUXgQMXmm0HW+7w7 ovXqlDw4Kh8eEqmG3cK0/kMCdI854rKsUcxsl6c4AQ2stny9xa9f8dPUVynliRvfbJcSW 4dIZwApSE+//ks4gtE94VqxLg8gfuUiJZ3FjpwPAptjcyoNQREvkdV0MvWw+2U4sDFA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oYe+zUUv; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DE1D606A680 for ; Wed, 2 Dec 2026 12:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oYe+zUUv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 074141F000C1; Wed, 2 Dec 2026 12:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796212939; bh=pk9AOllbShKb11u5q6IZMYeBOuHUm1ZHlkEj5zW8fkc=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=oYe+zUUvSMFtHpPd4suT+iBFqRkfwf12Hwwa3QKN9zNAlm7KN00uAVNs20+VFwrb6 ees+BZuErDZquknHGv9uxWXUX5F+eg3Tf/rM3LddlIzxGGrbT6ZQirusOGGVtF6Pvi QorlTm+JdSlHIlN7H3zPiwfYseF/fouXbJFV6EsT7VhlDuXsJynb8ihyhnjxPyxJNE kvwz0vkg8P9hoAnws40dkHDnz2JkS5yENK3EShug9cFSXSvzlNqdPOaEQA/Pny+9Ug jk8knvo+jJrLnLAYsgIEAcP/mxRRrm09yNlymEW/LpUPIKqS5m5MD98HP9KUoXfU6I SGhNnTXfMIj3A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xYj2O-000000065p1-3HzN; Wed, 02 Dec 2026 12:02:16 +0000 Date: Wed, 02 Dec 2026 12:02:16 +0000 Message-ID: <86ecbzyjp3.wl-maz@kernel.org> From: Marc Zyngier To: Linus Walleij Cc: Jie Feng , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Russell King , William Zhang , Anand Gore , Kursad Oney , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , 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 In-Reply-To: References: <20261123142203.3860616-1-hjf3108@gmail.com> <20261123142203.3860616-3-hjf3108@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linusw@kernel.org, hjf3108@gmail.com, florian.fainelli@broadcom.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux@armlinux.org.uk, william.zhang@broadcom.com, anand.gore@broadcom.com, kursad.oney@broadcom.com, rafal@milecki.pl, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 01 Dec 2026 15:26:06 +0000, Linus Walleij wrote: >=20 > On Tue, Dec 1, 2026 at 3:49=E2=80=AFPM Jie Feng wrote: >=20 > > > Yes? And it wakes up the secondary core targeted by that IPI, > > > right? >=20 > > And all the other secondary cores too. arch_send_wakeup_ipi_mask(CPU1) > > wakes up CPU2 and CPU3. >=20 > Aha OK that's unfortunate :( >=20 > > 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. >=20 > 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=E2=80=937 > registers and clears it from every other entry. >=20 > 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 :/ >=20 > We ask Marc Zyngier what is going on here and how > to fix it. >=20 > 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. --=20 Without deviation from the norm, progress is not possible.