]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/acpi/boot.c
x86, acpi: Skip acpi x2apic entries if the x2apic feature is not present
[karo-tx-linux.git] / arch / x86 / kernel / acpi / boot.c
index 4558f0d0822dcbaf7e0c7b9504e5a2ccb05879c4..ce664f33ea8ee25ccda84095dd478aa1473f8ae3 100644 (file)
@@ -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