From: "tip-bot2 for Thomas Gleixner" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: John Sperbeck <jsperbeck@google.com>,
Andres Freund <andres@anarazel.de>,
Thomas Gleixner <tglx@linutronix.de>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/urgent] x86/acpi: Handle bogus MADT APIC tables gracefully
Date: Mon, 18 Dec 2023 13:57:30 -0000 [thread overview]
Message-ID: <170290785069.398.7593700357199640901.tip-bot2@tip-bot2> (raw)
In-Reply-To: <169953729188.3135.6804572126118798018.tip-bot2@tip-bot2>
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: d5a10b976ecb77fa49b95f3f1016ca2997c122cb
Gitweb: https://git.kernel.org/tip/d5a10b976ecb77fa49b95f3f1016ca2997c122cb
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri, 15 Dec 2023 15:19:32 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Mon, 18 Dec 2023 14:21:44 +01:00
x86/acpi: Handle bogus MADT APIC tables gracefully
The recent fix to ignore invalid x2APIC entries inadvertently broke
systems with creative MADT APIC tables. The affected systems have APIC
MADT tables where all entries have invalid APIC IDs (0xFF), which means
they register exactly zero CPUs.
But the condition to ignore the entries of APIC IDs < 255 in the X2APIC
MADT table is solely based on the count of MADT APIC table entries.
As a consequence, the affected machines enumerate no secondary CPUs at
all because the APIC table has entries and therefore the X2APIC table
entries with APIC IDs < 255 are ignored.
Change the condition so that the APIC table preference for APIC IDs <
255 only becomes effective when the APIC table has valid APIC ID
entries.
IOW, an APIC table full of invalid APIC IDs is considered to be empty
which in consequence enables the X2APIC table entries with a APIC ID
< 255 and restores the expected behaviour.
Fixes: ec9aedb2aa1a ("x86/acpi: Ignore invalid x2APIC entries")
Reported-by: John Sperbeck <jsperbeck@google.com>
Reported-by: Andres Freund <andres@anarazel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/169953729188.3135.6804572126118798018.tip-bot2@tip-bot2
---
arch/x86/kernel/acpi/boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 1a0dd80..85a3ce2 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -293,6 +293,7 @@ acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end)
processor->processor_id, /* ACPI ID */
processor->lapic_flags & ACPI_MADT_ENABLED);
+ has_lapic_cpus = true;
return 0;
}
@@ -1134,7 +1135,6 @@ static int __init acpi_parse_madt_lapic_entries(void)
if (!count) {
count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC,
acpi_parse_lapic, MAX_LOCAL_APIC);
- has_lapic_cpus = count > 0;
x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC,
acpi_parse_x2apic, MAX_LOCAL_APIC);
}
next prev parent reply other threads:[~2023-12-18 13:57 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-02 16:28 [RFC PATCH] x86/acpi: Ignore invalid x2APIC entries Zhang Rui
2023-07-28 12:51 ` Thomas Gleixner
2023-07-28 12:55 ` Thomas Gleixner
2023-07-28 16:47 ` Zhang, Rui
2023-07-29 7:07 ` Thomas Gleixner
2023-07-31 13:04 ` Zhang, Rui
2023-11-09 13:41 ` [tip: x86/urgent] " tip-bot2 for Zhang Rui
2023-11-22 22:17 ` [PATCH] platform/x86: intel_telemetry: Fix kernel doc descriptions John Sperbeck
2023-11-22 22:18 ` [tip: x86/urgent] x86/acpi: Ignore invalid x2APIC entries John Sperbeck
2023-11-22 22:19 ` John Sperbeck
2023-11-23 12:50 ` Zhang, Rui
2023-12-01 3:25 ` Ashok Raj
2023-12-01 18:08 ` Zhang, Rui
2023-12-01 20:23 ` Ashok Raj
2023-12-02 2:53 ` Zhang, Rui
2023-12-01 8:31 ` Zhang, Rui
2023-12-01 23:32 ` John Sperbeck
2023-12-06 6:58 ` Andres Freund
2023-12-07 2:41 ` Zhang, Rui
2023-12-07 5:10 ` Andres Freund
2023-12-12 17:34 ` Thomas Gleixner
2023-12-13 7:39 ` Zhang, Rui
2023-12-13 14:51 ` Thomas Gleixner
2023-12-14 15:00 ` Zhang, Rui
2023-12-14 21:11 ` Thomas Gleixner
2023-12-15 14:19 ` [PATCH] x86/acpi: Handle bogus MADT APIC tables gracefully Thomas Gleixner
2023-12-15 14:20 ` [tip: x86/urgent] x86/acpi: Ignore invalid x2APIC entries Andres Freund
2023-12-10 11:47 ` Linux regression tracking (Thorsten Leemhuis)
2023-12-18 13:57 ` tip-bot2 for Thomas Gleixner [this message]
2024-10-10 21:31 ` [RFC PATCH] " Jim Mattson
2024-10-11 1:37 ` Zhang, Rui
2024-10-11 3:05 ` Jim Mattson
2024-10-14 13:05 ` Zhang, Rui
2024-10-14 18:00 ` Jim Mattson
2024-10-15 3:23 ` Zhang, Rui
2024-10-15 13:26 ` Jim Mattson
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=170290785069.398.7593700357199640901.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=andres@anarazel.de \
--cc=bp@alien8.de \
--cc=jsperbeck@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--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®