x86, x2apic: Don't map lapic addr for preenabled x2apic systems
authorYinghai Lu <yinghai@kernel.org>
Tue, 7 Dec 2010 08:55:56 +0000 (00:55 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 9 Dec 2010 20:52:05 +0000 (21:52 +0100)
If x2apic is preenabled and used by the kernel, we don't need to map
the lapic address. That mapping will never be used.

So just skip that in register_lapic_address()

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
LKML-Reference: <4CFDF69C.9070501@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/apic.c

index 9303364..8933936 100644 (file)
@@ -1681,9 +1681,11 @@ void __init register_lapic_address(unsigned long address)
 {
        mp_lapic_addr = address;
 
-       set_fixmap_nocache(FIX_APIC_BASE, address);
-       apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
-                   APIC_BASE, mp_lapic_addr);
+       if (!x2apic_mode) {
+               set_fixmap_nocache(FIX_APIC_BASE, address);
+               apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
+                           APIC_BASE, mp_lapic_addr);
+       }
        if (boot_cpu_physical_apicid == -1U) {
                boot_cpu_physical_apicid  = read_apic_id();
                apic_version[boot_cpu_physical_apicid] =