Commit a35fd282 authored by Yinghai Lu's avatar Yinghai Lu Committed by H. Peter Anvin

x86, acpi: Skip acpi x2apic entries if the x2apic feature is not present

If the x2apic feature is not present (either the cpu is not capable of it
or the user has disabled the feature using boot-parameter etc), ignore the
x2apic MADT and SRAT entries provided by the ACPI tables.
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20111222014632.540896503@sbsiddha-desk.sc.intel.comSigned-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent e8524b2f
...@@ -219,6 +219,8 @@ static int __init ...@@ -219,6 +219,8 @@ static int __init
acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
{ {
struct acpi_madt_local_x2apic *processor = NULL; struct acpi_madt_local_x2apic *processor = NULL;
int apic_id;
u8 enabled;
processor = (struct acpi_madt_local_x2apic *)header; processor = (struct acpi_madt_local_x2apic *)header;
...@@ -227,6 +229,8 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) ...@@ -227,6 +229,8 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
acpi_table_print_madt_entry(header); acpi_table_print_madt_entry(header);
apic_id = processor->local_apic_id;
enabled = processor->lapic_flags & ACPI_MADT_ENABLED;
#ifdef CONFIG_X86_X2APIC #ifdef CONFIG_X86_X2APIC
/* /*
* We need to register disabled CPU as well to permit * 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) ...@@ -235,8 +239,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
* to not preallocating memory for all NR_CPUS * to not preallocating memory for all NR_CPUS
* when we use CPU hotplug. * when we use CPU hotplug.
*/ */
acpi_register_lapic(processor->local_apic_id, /* APIC ID */ if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled)
processor->lapic_flags & ACPI_MADT_ENABLED); printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
else
acpi_register_lapic(apic_id, enabled);
#else #else
printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
#endif #endif
......
...@@ -69,6 +69,12 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) ...@@ -69,6 +69,12 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
return; return;
pxm = pa->proximity_domain; 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); node = setup_node(pxm);
if (node < 0) { if (node < 0) {
printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 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) ...@@ -76,7 +82,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
return; return;
} }
apic_id = pa->apic_id;
if (apic_id >= MAX_LOCAL_APIC) { 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); printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment