diff options
author | Yinghai Lu <yinghai@kernel.org> | 2011-12-21 20:45:16 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-12-23 14:00:50 -0500 |
commit | a35fd28256e7736cc84af8931a16224f0bfaaf6c (patch) | |
tree | 637b536f651b756ce3a83478ef5a42c15b67709f /arch/x86 | |
parent | e8524b2f43ab6747518aef81c709d104c478b1cd (diff) |
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: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20111222014632.540896503@sbsiddha-desk.sc.intel.com
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 10 | ||||
-rw-r--r-- | arch/x86/mm/srat.c | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 4558f0d0822d..ce664f33ea8e 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -219,6 +219,8 @@ static int __init | |||
219 | acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) | 219 | acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) |
220 | { | 220 | { |
221 | struct acpi_madt_local_x2apic *processor = NULL; | 221 | struct acpi_madt_local_x2apic *processor = NULL; |
222 | int apic_id; | ||
223 | u8 enabled; | ||
222 | 224 | ||
223 | processor = (struct acpi_madt_local_x2apic *)header; | 225 | processor = (struct acpi_madt_local_x2apic *)header; |
224 | 226 | ||
@@ -227,6 +229,8 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) | |||
227 | 229 | ||
228 | acpi_table_print_madt_entry(header); | 230 | acpi_table_print_madt_entry(header); |
229 | 231 | ||
232 | apic_id = processor->local_apic_id; | ||
233 | enabled = processor->lapic_flags & ACPI_MADT_ENABLED; | ||
230 | #ifdef CONFIG_X86_X2APIC | 234 | #ifdef CONFIG_X86_X2APIC |
231 | /* | 235 | /* |
232 | * We need to register disabled CPU as well to permit | 236 | * 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 | * to not preallocating memory for all NR_CPUS | 239 | * to not preallocating memory for all NR_CPUS |
236 | * when we use CPU hotplug. | 240 | * when we use CPU hotplug. |
237 | */ | 241 | */ |
238 | acpi_register_lapic(processor->local_apic_id, /* APIC ID */ | 242 | if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled) |
239 | processor->lapic_flags & ACPI_MADT_ENABLED); | 243 | printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); |
244 | else | ||
245 | acpi_register_lapic(apic_id, enabled); | ||
240 | #else | 246 | #else |
241 | printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); | 247 | printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); |
242 | #endif | 248 | #endif |
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 81dbfdeb080d..fd61b3fb7341 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c | |||
@@ -69,6 +69,12 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) | |||
69 | if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) | 69 | if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) |
70 | return; | 70 | return; |
71 | pxm = pa->proximity_domain; | 71 | pxm = pa->proximity_domain; |
72 | apic_id = pa->apic_id; | ||
73 | if (!cpu_has_x2apic && (apic_id >= 0xff)) { | ||
74 | printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n", | ||
75 | pxm, apic_id); | ||
76 | return; | ||
77 | } | ||
72 | node = setup_node(pxm); | 78 | node = setup_node(pxm); |
73 | if (node < 0) { | 79 | if (node < 0) { |
74 | printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); | 80 | 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 | return; | 82 | return; |
77 | } | 83 | } |
78 | 84 | ||
79 | apic_id = pa->apic_id; | ||
80 | if (apic_id >= MAX_LOCAL_APIC) { | 85 | if (apic_id >= MAX_LOCAL_APIC) { |
81 | printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node); | 86 | printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node); |
82 | return; | 87 | return; |