]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/apic_64.c
x86: apic - unify disable_local_APIC
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / apic_64.c
index 46acb9b47ae7e3fa0261d2d26a8b98ac580a6599..4fb903b2fc39ef672af945b0f87fc8e86ed28cab 100644 (file)
@@ -691,6 +691,20 @@ void disable_local_APIC(void)
        value = apic_read(APIC_SPIV);
        value &= ~APIC_SPIV_APIC_ENABLED;
        apic_write(APIC_SPIV, value);
+
+#ifdef CONFIG_X86_32
+       /*
+        * When LAPIC was disabled by the BIOS and enabled by the kernel,
+        * restore the disabled state.
+        */
+       if (enabled_via_apicbase) {
+               unsigned int l, h;
+
+               rdmsr(MSR_IA32_APICBASE, l, h);
+               l &= ~MSR_IA32_APICBASE_ENABLE;
+               wrmsr(MSR_IA32_APICBASE, l, h);
+       }
+#endif
 }
 
 void lapic_shutdown(void)