x86, apic: Fix missed handling of discrete apics
authorCyrill Gorcunov <gorcunov@openvz.org>
Tue, 15 Sep 2009 07:12:30 +0000 (11:12 +0400)
committerIngo Molnar <mingo@elte.hu>
Sun, 20 Sep 2009 18:18:07 +0000 (20:18 +0200)
In case of discrete (pretty old) apics we may have cpu_has_apic bit
not set but have to check if smp_found_config (MP spec) is there
and apic was not disabled.

Also don't forget to print apic/io-apic for such case as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <20090915071230.GA10604@lenovo>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/io_apic.c

index 586b7adb8e53b33799b5c21926cfa0a8810a9987..9a86fb40490dadc895a97141bbc1e983f471afb6 100644 (file)
@@ -65,6 +65,19 @@ static inline void default_inquire_remote_apic(int apicid)
                __inquire_remote_apic(apicid);
 }
 
+/*
+ * With 82489DX we can't rely on apic feature bit
+ * retrieved via cpuid but still have to deal with
+ * such an apic chip so we assume that SMP configuration
+ * is found from MP table (64bit case uses ACPI mostly
+ * which set smp presence flag as well so we are safe
+ * to use this helper too).
+ */
+static inline bool apic_from_smp_config(void)
+{
+       return smp_found_config && !disable_apic;
+}
+
 /*
  * Basic functions accessing APICs.
  */
index 072aea6c630b42bfcadc85074f46fff716abca37..2d59dfa29785c832ac2742dd0bf437fe94a9d9b3 100644 (file)
@@ -978,7 +978,7 @@ void lapic_shutdown(void)
 {
        unsigned long flags;
 
-       if (!cpu_has_apic)
+       if (!cpu_has_apic && !apic_from_smp_config())
                return;
 
        local_irq_save(flags);
index 3c8f9e75d0383a448f467e4d136d1067ab4c7047..593c4f8a8bb80048f5160f9ec391e2f370a98cf5 100644 (file)
@@ -1863,7 +1863,7 @@ __apicdebuginit(int) print_all_ICs(void)
        print_PIC();
 
        /* don't print out if apic is not there */
-       if (!cpu_has_apic || disable_apic)
+       if (!cpu_has_apic && !apic_from_smp_config())
                return 0;
 
        print_all_local_APICs();
@@ -1981,7 +1981,7 @@ void disable_IO_APIC(void)
        /*
         * Use virtual wire A mode when interrupt remapping is enabled.
         */
-       if (cpu_has_apic)
+       if (cpu_has_apic || apic_from_smp_config())
                disconnect_bsp_APIC(!intr_remapping_enabled &&
                                ioapic_i8259.pin != -1);
 }