x86: adjust x2apic section placement
authorKeir Fraser <keir@xen.org>
Wed, 15 Dec 2010 11:57:54 +0000 (11:57 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 15 Dec 2010 11:57:54 +0000 (11:57 +0000)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/apic.c
xen/arch/x86/genapic/x2apic.c
xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/include/asm-x86/apic.h

index c2a04e4e9fb84d4f6b01ce09bc55a51bdeb2ce3f..f48c442e3972fad6494a52a5e22545111c60295e 100644 (file)
@@ -948,18 +948,17 @@ no_apic:
     return -1;
 }
 
-void x2apic_setup(void)
+void x2apic_ap_setup(void)
+{
+    if ( x2apic_enabled )
+        __enable_x2apic();
+}
+
+void __init x2apic_bsp_setup(void)
 {
     struct IO_APIC_route_entry **ioapic_entries = NULL;
     uint64_t msr_content;
 
-    if ( smp_processor_id() != 0 )
-    {
-        if ( x2apic_enabled )
-            __enable_x2apic();
-        return;
-    }
-
     if ( !cpu_has_x2apic )
         return;
 
index 91daaa3bf443e24b9105e83683a057a1c2adcbb3..f9bb34dfc292795d2cff8a9b12336733c36a5609 100644 (file)
@@ -27,7 +27,7 @@
 #include <xen/smp.h>
 #include <asm/mach-default/mach_mpparse.h>
 
-static int x2apic_phys; /* By default we use logical cluster mode. */
+static int __initdata x2apic_phys; /* By default we use logical cluster mode. */
 boolean_param("x2apic_phys", x2apic_phys);
 
 static void init_apic_ldr_x2apic_phys(void)
@@ -134,7 +134,7 @@ static const struct genapic apic_x2apic_cluster = {
     .send_IPI_self = send_IPI_self_x2apic
 };
 
-const struct genapic *apic_x2apic_probe(void)
+const struct genapic *__init apic_x2apic_probe(void)
 {
     return x2apic_phys ? &apic_x2apic_phys : &apic_x2apic_cluster;
 }
index 053b9c27edc46475edc1d5d265c257be91393a05..a577cc0f0f59523ead3d86dfdaf6d9bb6f2e3e24 100644 (file)
@@ -1190,7 +1190,7 @@ void __init __start_xen(unsigned long mbi_p)
 
     init_cpu_to_node();
 
-    x2apic_setup();
+    x2apic_bsp_setup();
 
     init_IRQ();
 
index e5fc89636313a2b8ef7bee33ea632fd607d41d61..2c8c47d164d193624dac41afcc258ecc446a3e11 100644 (file)
@@ -195,7 +195,7 @@ void smp_callin(void)
      * update until we finish. We are free to set up this CPU: first the APIC.
      */
     Dprintk("CALLIN, before setup_local_APIC().\n");
-    x2apic_setup();
+    x2apic_ap_setup();
     setup_local_APIC();
     map_cpu_to_logical_apicid();
 
index 4a825a8793bf9336f7da67d7091785615faeb155..a014755ae38e9d583ed9a4030f7cab537f973bc7 100644 (file)
@@ -25,7 +25,8 @@ extern int apic_verbosity;
 extern int x2apic_enabled;
 extern int directed_eoi_enabled;
 
-void x2apic_setup(void);
+void x2apic_bsp_setup(void);
+void x2apic_ap_setup(void);
 const struct genapic *apic_x2apic_probe(void);
 
 /*