mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Fuad Tabba" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Fuad Tabba <fuad.tabba@linux.dev>,
	Thomas Gleixner <tglx@kernel.org>, Marc Zyngier <maz@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/drivers] irqchip/gic-v3: Don't register a redistributor that was never counted
Date: Thu, 15 Oct 2026 09:54:37 -0000	[thread overview]
Message-ID: <179205807788.2666988.12115351936867794153.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260925085000.753400-4-fuad.tabba@linux.dev>

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     7bcd2fa22186587e06c456d1c2e3d336c83136f6
Gitweb:        https://git.kernel.org/tip/7bcd2fa22186587e06c456d1c2e3d336c83136f6
Author:        Fuad Tabba <fuad.tabba@linux.dev>
AuthorDate:    Fri, 25 Sep 2026 09:50:00 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Thu, 15 Oct 2026 11:50:48 +02:00

irqchip/gic-v3: Don't register a redistributor that was never counted

gic_acpi_match_gicc() counts only the enabled GICCs with a non-zero
gicr_base_address, and that count sizes redist_regs[], but
gic_acpi_parse_madt_gicc() registers every enabled one. On a MADT with
no GICR entries, an enabled GICC with a zero GICR base therefore makes
gic_acpi_register_redist() write a struct redist_region past the end of
the array.

Commit fa2dabe57220e ("irqchip/gic-v3: Don't return errors from
gic_acpi_match_gicc()") removed the check that kept the two consistent.
Its message says such entries are still caught by gic_populate_rdist(),
but that runs from gic_cpu_init(), after the write.

Skip the entry instead, and mark the CPU's redistributor broken as the
online-capable path does, so that gic_check_rdist() rejects the CPU.
gic_starting_cpu() runs past cpuhp's last failure point, so without the
mark the CPU would come online with its redistributor and CPU interface
unconfigured. With an ITS, its_cpu_init() would then dereference a NULL
rd_base.

Fixes: fa2dabe57220e ("irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()")
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://patch.msgid.link/20260925085000.753400-4-fuad.tabba@linux.dev
---
 drivers/irqchip/irq-gic-v3.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 9231688..32a8ea4 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -2344,6 +2344,17 @@ gic_acpi_parse_madt_gicc(union acpi_subtable_headers *header,
 		return 0;
 	}
 
+	/* Not counted by gic_acpi_match_gicc(), so there is no slot for it */
+	if (!gicc->gicr_base_address) {
+		int cpu = get_cpu_for_acpi_id(gicc->uid);
+
+		pr_warn(FW_BUG "GICC entry with ACPI UID %u has no GICR base address, CPU kept offline\n",
+			gicc->uid);
+		if (cpu >= 0)
+			cpumask_set_cpu(cpu, &broken_rdists);
+		return 0;
+	}
+
 	redist_base = ioremap(gicc->gicr_base_address, size);
 	if (!redist_base)
 		return -ENOMEM;

  reply	other threads:[~2026-10-15  9:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  8:49 [PATCH v2 0/3] irqchip/gic-v3: Memory-safety fixes on the probe paths Fuad Tabba
2026-09-25  8:49 ` [PATCH v2 1/3] irqchip/gic-v3-its: Don't free a vPE table shared with another ITS Fuad Tabba
2026-10-15  9:54   ` [tip: irq/drivers] " tip-bot2 for Fuad Tabba
2026-10-15 10:00   ` tip-bot2 for Fuad Tabba
2026-09-25  8:49 ` [PATCH v2 2/3] irqchip/gic-v3-its: Don't free the tables of an enabled ITS Fuad Tabba
2026-10-15  9:54   ` [tip: irq/drivers] " tip-bot2 for Fuad Tabba
2026-10-15 10:00   ` tip-bot2 for Fuad Tabba
2026-09-25  8:50 ` [PATCH v2 3/3] irqchip/gic-v3: Don't register a redistributor that was never counted Fuad Tabba
2026-10-15  9:54   ` tip-bot2 for Fuad Tabba [this message]
2026-10-15 10:00   ` [tip: irq/drivers] " tip-bot2 for Fuad Tabba
2026-09-27  9:23 ` [PATCH v2 0/3] irqchip/gic-v3: Memory-safety fixes on the probe paths Marc Zyngier
2026-10-07  3:22 ` Fuad Tabba
2026-10-10 19:44   ` Thomas Gleixner

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=179205807788.2666988.12115351936867794153.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=fuad.tabba@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®