From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CDF0606A339 for ; Wed, 2 Dec 2026 12:02:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=H+AJVGv1; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oYe+zUUv DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Subject:Cc:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=pk9AOllbShKb11u5q6IZMYeBOuHUm1ZHlkEj5zW8fkc=; b=H+AJVGv1W3GRskTwF1bqmASgjN wdgTFoYqt8R195yfav/fLcFrdkem8VArtjj3i9HDoHGAY/C7ah3U8PisbMDT6RP9DB3bHy+JyH4j8 4HUj2j9NE0CAJL247U4VQ4csaG7FpZBnXBRNFdoM7Yrj09QkdGYnT85/9a/67YhYZSp7HFqBRQZV9 MCHjnnJf1baCgRVD8qWNjUW2mS1VOnaZrfc0YFaR/I5nAE9E2uTOzO7QX/q6Vhc/Kn4/ZInzvHpem S77r3NfqFrmiPOpTiFRJYeANLy4YNpfkb+cUgEOFboO3Mty5mWRtyeAxCKTwXvnLELdrbwv+BoCN+ YJWUoa4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYj2T-0000000BPWB-2KhB; Wed, 02 Dec 2026 12:02:21 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYj2R-0000000BPW5-362X for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 12:02:19 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 252E743365; Wed, 2 Dec 2026 12:02:19 +0000 (UTC) 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-Archived-By: 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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.