* [PATCH] x86/ACPI: ignore processors which cannot be brought online
@ 2021-09-13 7:54 Jan Beulich
2021-09-14 7:40 ` Roger Pau Monné
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2021-09-13 7:54 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné
ACPI 6.3 introduced a flag allowing to tell MADT entries describing
hotpluggable processors from ones which are simply placeholders (often
used by firmware writers to simplify handling there).
Inspired by a Linux patch by Mario Limonciello <mario.limonciello@amd.com>.
Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -53,6 +53,8 @@ bool __initdata acpi_ioapic;
static bool __initdata acpi_skip_timer_override;
boolean_param("acpi_skip_timer_override", acpi_skip_timer_override);
+static uint8_t __initdata madt_revision;
+
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
/* --------------------------------------------------------------------------
@@ -64,6 +66,8 @@ static int __init acpi_parse_madt(struct
struct acpi_table_madt *madt =
container_of(table, struct acpi_table_madt, header);
+ madt_revision = madt->header.revision;
+
if (madt->address) {
acpi_lapic_addr = (u64) madt->address;
@@ -86,6 +90,12 @@ acpi_parse_x2apic(struct acpi_subtable_h
if (BAD_MADT_ENTRY(processor, end))
return -EINVAL;
+ /* Don't register processors that cannot be onlined. */
+ if (madt_revision >= 5 &&
+ !(processor->lapic_flags & ACPI_MADT_ENABLED) &&
+ !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
+ return 0;
+
if ((processor->lapic_flags & ACPI_MADT_ENABLED) ||
processor->local_apic_id != 0xffffffff || opt_cpu_info) {
acpi_table_print_madt_entry(header);
@@ -136,6 +146,12 @@ acpi_parse_lapic(struct acpi_subtable_he
if (BAD_MADT_ENTRY(processor, end))
return -EINVAL;
+ /* Don't register processors that cannot be onlined. */
+ if (madt_revision >= 5 &&
+ !(processor->lapic_flags & ACPI_MADT_ENABLED) &&
+ !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
+ return 0;
+
if ((processor->lapic_flags & ACPI_MADT_ENABLED) ||
processor->id != 0xff || opt_cpu_info)
acpi_table_print_madt_entry(header);
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -858,7 +858,8 @@ struct acpi_madt_generic_translator {
/* MADT Local APIC flags */
-#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
+#define ACPI_MADT_ENABLED (1 << 0) /* 00: Processor is usable if set */
+#define ACPI_MADT_ONLINE_CAPABLE (1 << 1) /* 01: Processor can be onlined */
/* MADT MPS INTI flags (inti_flags) */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/ACPI: ignore processors which cannot be brought online
2021-09-13 7:54 [PATCH] x86/ACPI: ignore processors which cannot be brought online Jan Beulich
@ 2021-09-14 7:40 ` Roger Pau Monné
0 siblings, 0 replies; 2+ messages in thread
From: Roger Pau Monné @ 2021-09-14 7:40 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Andrew Cooper, Wei Liu
On Mon, Sep 13, 2021 at 09:54:01AM +0200, Jan Beulich wrote:
> ACPI 6.3 introduced a flag allowing to tell MADT entries describing
> hotpluggable processors from ones which are simply placeholders (often
> used by firmware writers to simplify handling there).
>
> Inspired by a Linux patch by Mario Limonciello <mario.limonciello@amd.com>.
>
> Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks, Roger.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-14 7:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 7:54 [PATCH] x86/ACPI: ignore processors which cannot be brought online Jan Beulich
2021-09-14 7:40 ` Roger Pau Monné
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.