[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/ACPI: ignore processors which cannot be brought online


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Sep 2021 09:54:01 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=oyitoaSUmmKQXuQt8LX+L4zVmOF8/FORFu7eBvzwIt8=; b=COfuoosgniN+lUHyUfRjMP0Uip2jRJSinMogZ4RKuSqfznsch3RdcnERGDrAKUAy2OO52lQLSkAnAw1sM9WUZ3GN2H+p8J0r0PbLd8gspKidUsmQxKOfur3nOjB78eaptctT454f+wGcvgjf3Rqr7aiXXr1OwNouSWJDdOeaJNTOm3Uxqme6Ii2XHYQE1cEdDQBeaAkCMMWc/9y2Lq2VMhqfjdQEt5tFQ8kUn0QHFo6w/vC3ZYZZaQOTFp0t9gNbsv4H9sy2l3UJqfl4A6twr7DPIV6eKC9Yb+J2f3n2Qx8D6PeUm0jA7jwvuzgAwJ4OEY/yIlMx6BDr5hH9G2N4pw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C/Gu7hZ7xfvVe7ZKlC05a+eFu8XlPNaMq3IWKDfe2gC1Vscm+d/bd/yII0rIWtjxv+vZw4PMWF8ugEPNpr6j0wuNo4CTuqdiZi2oH7+rRBV5/TYpK4XlL3U1d2IkczjSWjY8eq2DrLZG/a9VF6kA5rHhQMcB422wm1beNaGWdQdhDYSx1I9uZOppmN+LyPtbAFDV/cVTrzS3FKPcw8ew/e2xHCWMMLOCA2rBZGcHkRIWb+AG/+bk8xiwQZsifn7CZqhbf/lpbj5t7oHnJOaccsnvlG5vjp/NnTLryiX0Z3oylwNaiSIwA7k9He1x7dIWqxeQ9NWjTERZnEjn2kqkYg==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 13 Sep 2021 07:54:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxx>.

Requested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- 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) */
 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.