From 273101f2ff90af0684fc86d5a7f3635627504a2e Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Wed, 21 Dec 2011 17:45:16 -0800 Subject: [PATCH] --- yaml --- r: 277439 b: refs/heads/master c: a35fd28256e7736cc84af8931a16224f0bfaaf6c h: refs/heads/master i: 277437: 425318f742ddd4d275bc7356f9d2fe27bfd997be 277435: 1f2aca2b6a5168be1ed571cd27d9b72182fbf663 277431: 89fe91ab09fa815f916b9f603e299c0ce359dc1a 277423: 3d45964f6df1f77f8a2d13465e98d6786a71599f 277407: 6f115b40aff3c0539f46abce4e64fb6f28cc0dd6 277375: b37a1d9e32de8fccb3d021c4ac83f9c53b596259 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/acpi/boot.c | 10 ++++++++-- trunk/arch/x86/mm/srat.c | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 358a32d7c836..e49b5f954ffb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e8524b2f43ab6747518aef81c709d104c478b1cd +refs/heads/master: a35fd28256e7736cc84af8931a16224f0bfaaf6c diff --git a/trunk/arch/x86/kernel/acpi/boot.c b/trunk/arch/x86/kernel/acpi/boot.c index 4558f0d0822d..ce664f33ea8e 100644 --- a/trunk/arch/x86/kernel/acpi/boot.c +++ b/trunk/arch/x86/kernel/acpi/boot.c @@ -219,6 +219,8 @@ static int __init acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) { struct acpi_madt_local_x2apic *processor = NULL; + int apic_id; + u8 enabled; processor = (struct acpi_madt_local_x2apic *)header; @@ -227,6 +229,8 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) acpi_table_print_madt_entry(header); + apic_id = processor->local_apic_id; + enabled = processor->lapic_flags & ACPI_MADT_ENABLED; #ifdef CONFIG_X86_X2APIC /* * We need to register disabled CPU as well to permit @@ -235,8 +239,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) * to not preallocating memory for all NR_CPUS * when we use CPU hotplug. */ - acpi_register_lapic(processor->local_apic_id, /* APIC ID */ - processor->lapic_flags & ACPI_MADT_ENABLED); + if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled) + printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); + else + acpi_register_lapic(apic_id, enabled); #else printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); #endif diff --git a/trunk/arch/x86/mm/srat.c b/trunk/arch/x86/mm/srat.c index 81dbfdeb080d..fd61b3fb7341 100644 --- a/trunk/arch/x86/mm/srat.c +++ b/trunk/arch/x86/mm/srat.c @@ -69,6 +69,12 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) return; pxm = pa->proximity_domain; + apic_id = pa->apic_id; + if (!cpu_has_x2apic && (apic_id >= 0xff)) { + printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n", + pxm, apic_id); + return; + } node = setup_node(pxm); if (node < 0) { printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); @@ -76,7 +82,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) return; } - apic_id = pa->apic_id; if (apic_id >= MAX_LOCAL_APIC) { printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node); return;