[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHZ81Kah1Uaa184N@lpieralisi>
Date: Tue, 15 Jul 2025 18:07:48 +0200
From: Lorenzo Pieralisi <lpieralisi@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: Marc Zyngier <maz@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Sascha Bischoff <sascha.bischoff@....com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Timothy Hayes <timothy.hayes@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Peter Maydell <peter.maydell@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Jiri Slaby <jirislaby@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH v7 18/31] arm64: smp: Support non-SGIs for IPIs
On Tue, Jul 15, 2025 at 04:34:24PM +0200, Lorenzo Pieralisi wrote:
> On Tue, Jul 15, 2025 at 07:10:29AM -0700, Breno Leitao wrote:
> > Hello Lorenzo, Marc,
> >
> > On Thu, Jul 03, 2025 at 12:25:08PM +0200, Lorenzo Pieralisi wrote:
> > > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> > > index 3b3f6b56e733..2c501e917d38 100644
> >
> > > @@ -1046,11 +1068,15 @@ static void ipi_setup(int cpu)
> > > return;
> > >
> > > for (i = 0; i < nr_ipi; i++) {
> > > - if (ipi_should_be_nmi(i)) {
> > > - prepare_percpu_nmi(ipi_irq_base + i);
> > > - enable_percpu_nmi(ipi_irq_base + i, 0);
> > > + if (!percpu_ipi_descs) {
> > > + if (ipi_should_be_nmi(i)) {
> > > + prepare_percpu_nmi(ipi_irq_base + i);
> >
> > I am testing linux-next on commit 0be23810e32e6d0 ("Add linux-next
> > specific files for 20250714") on a Grace (GiCv3), and I am getting
> > a bunch of those:
> >
> > [ 0.007992] WARNING: kernel/irq/manage.c:2599 at prepare_percpu_nmi+0x178/0x1b0, CPU#2: swapper/2/0
> >
> > [ 0.007996] pstate: 600003c9 (nZCv DAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > [ 0.007997] pc : prepare_percpu_nmi (kernel/irq/manage.c:2599 (discriminator 1))
> > [ 0.007998] lr : prepare_percpu_nmi (kernel/irq/manage.c:2599 (discriminator 1))
> >
> > [ 0.008011] Call trace:
> > [ 0.008011] prepare_percpu_nmi (kernel/irq/manage.c:2599 (discriminator 1)) (P)
> > [ 0.008012] ipi_setup (arch/arm64/kernel/smp.c:1057)
> > [ 0.008014] secondary_start_kernel (arch/arm64/kernel/smp.c:245)
> > [ 0.008016] __secondary_switched (arch/arm64/kernel/head.S:405)
> >
> > I haven't bissected the problem to this patch specifically, but
> > I decided to share in case this is a known issue, given you are touching
> > this code.
> >
> > I would be happy to bissect it, in case it doesn't ring a bell.
>
> Thank you for reporting it.
>
> Does this patch below fix it ?
FWIW it does for me. I think you are booting with pseudo-nmi enabled and
the below is a silly thinko (mea culpa) that is causing the IPI IRQ descs not
to be set-up correctly for NMI and the prepare_percpu_nmi() call rightly
screams on them.
If you confirm I hope it can be folded into the relevant patch.
Thanks,
Lorenzo
> -- >8 --
> diff --git i/arch/arm64/kernel/smp.c w/arch/arm64/kernel/smp.c
> index 4797e2c70014..a900835a3adf 100644
> --- i/arch/arm64/kernel/smp.c
> +++ w/arch/arm64/kernel/smp.c
> @@ -1093,7 +1093,7 @@ static void ipi_setup_sgi(int ipi)
>
> irq = ipi_irq_base + ipi;
>
> - if (ipi_should_be_nmi(irq)) {
> + if (ipi_should_be_nmi(ipi)) {
> err = request_percpu_nmi(irq, ipi_handler, "IPI", &irq_stat);
> WARN(err, "Could not request IRQ %d as NMI, err=%d\n", irq, err);
> } else {
Powered by blists - more mailing lists