public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Lyude Paul <lyude@redhat.com>, Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Early boot regression from f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package")
Date: Sat, 20 Apr 2024 00:15:21 +0200	[thread overview]
Message-ID: <87le59vw1y.ffs@tglx> (raw)
In-Reply-To: <abbb7d7ca781f6c664e4c5b1dffc19394ac79691.camel@redhat.com>

Paul!

On Fri, Apr 19 2024 at 13:38, Lyude Paul wrote:
> Awesome - can confirm the patch does indeed make the machine boot. Full
> dmesg from boot attached.

Thanks for providing the data.

[    0.089286] CPU topo: APIC ID 0 present 1
[    0.089294] CPU topo: APIC ID 0 present 0
[    0.089296] CPU topo: Hot-pluggable APIC ID 0 in present package.

ACPI is really a wonderland.

Can you please test the patch below?

Thanks,

        tglx
---
Subject: x86/topology: Deal with more broken ACPI tables
From: Thomas Gleixner <tglx@linutronix.de>
Date: Thu, 18 Apr 2024 21:02:39 +0200

Paul reported a regression which waas caused by the handling of non-present
CPUs in a present package. It's caused by the ACPI table on the system
which advertises APICs twice, present and non-present:

  CPU topo: APIC ID 0 present 1
  CPU topo: APIC ID 0 present 0
  CPU topo: Hot-pluggable APIC ID 0 in present package.                                                                                                                                                                         
Which causes the topology to get confused to the point that it fails to
bring the system up because the target APIC for the IOAPIC is not
available.

Prevent this by checking whether a non-present CPU has been already
registered as present before. If so emit a firmware warning and ignore the
registration request.

Fixes: f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package")
Reported-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/cpu/topology.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/arch/x86/kernel/cpu/topology.c
+++ b/arch/x86/kernel/cpu/topology.c
@@ -195,6 +195,12 @@ static __init void topo_register_apic(u3
 	} else {
 		u32 pkgid = topo_apicid(apic_id, TOPO_PKG_DOMAIN);
 
+		if (test_bit(apic_id, phys_cpu_present_map)) {
+			pr_warn_once(FW_BUG "Already present APIC ID %x registered again as non-present\n",
+				     apic_id);
+			return;
+		}
+
 		/*
 		 * Check for present APICs in the same package when running
 		 * on bare metal. Allow the bogosity in a guest.

  reply	other threads:[~2024-04-19 22:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 21:21 Early boot regression from f0551af0213 ("x86/topology: Ignore non-present APIC IDs in a present package") Lyude Paul
2024-04-18  8:27 ` Borislav Petkov
2024-04-18 17:20   ` Lyude Paul
2024-04-18 19:13     ` Thomas Gleixner
2024-04-19  5:37       ` Thomas Gleixner
2024-04-19 17:38       ` Lyude Paul
2024-04-19 22:15         ` Thomas Gleixner [this message]
2024-04-23 17:09           ` Thomas Gleixner
2024-04-24 20:56           ` Lyude Paul
2024-04-25  2:11             ` Thomas Gleixner
2024-04-25 15:56               ` Lyude Paul
2024-04-25 21:42                 ` Thomas Gleixner
2024-05-02 10:33                   ` Mario Limonciello
2024-05-08  8:38                     ` Linux regression tracking (Thorsten Leemhuis)
2024-05-08 10:30                       ` Thomas Gleixner
2024-05-08 21:02                         ` Lyude Paul
2024-05-08 23:21                           ` Lyude Paul
2024-05-13 14:08                             ` Thomas Gleixner
2024-05-13 23:18                               ` Lyude Paul
2024-05-13 23:32                                 ` Lyude Paul
2024-05-14  8:25                                   ` Thomas Gleixner
2024-05-15 23:15                                     ` Lyude Paul
2024-05-16 13:38                                       ` Thomas Gleixner
2024-05-22 19:35                                         ` Lyude Paul
2024-05-22 22:12                                           ` Thomas Gleixner
2024-05-23  5:20                                             ` Linux regression tracking (Thorsten Leemhuis)
2024-05-23 10:47                                             ` Thomas Gleixner
2024-05-28 22:43                                               ` Thomas Gleixner
2024-06-03 16:22                                                 ` Lyude Paul
2024-06-05 23:15                                                 ` Lyude Paul
2024-06-06  9:50                                                   ` Thomas Gleixner
2024-05-09 19:22                         ` Lyude Paul
2024-05-08 21:47                     ` Thomas Gleixner
2024-05-08 22:09                       ` Mario Limonciello

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=87le59vw1y.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --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