x86: apic: simplify secondary CPU wakeup methods
authorIngo Molnar <mingo@elte.hu>
Thu, 26 Feb 2009 12:51:40 +0000 (13:51 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Feb 2009 12:58:26 +0000 (13:58 +0100)
Impact: cleanup

- rename apic->wakeup_cpu  to apic->wakeup_secondary_cpu, to
  make it apparent that this is an SMP-only method

- handle NULL ->wakeup_secondary_cpus to mean the default INIT
  wakeup sequence - this allows simplification of the APIC
  driver templates.

Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/bigsmp_32.c
arch/x86/kernel/apic/es7000_32.c
arch/x86/kernel/apic/numaq_32.c
arch/x86/kernel/apic/probe_32.c
arch/x86/kernel/apic/summit_32.c
arch/x86/kernel/apic/x2apic_cluster.c
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/smpboot.c

index 0fbf6f1520fabcaacc2d75541dc173c0192de390..4ef949c1972e6bfacb80d477fefc427cadfecd8f 100644 (file)
@@ -313,7 +313,7 @@ struct apic {
        void (*send_IPI_self)(int vector);
 
        /* wakeup_secondary_cpu */
-       int (*wakeup_cpu)(int apicid, unsigned long start_eip);
+       int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
 
        int trampoline_phys_low;
        int trampoline_phys_high;
@@ -344,13 +344,6 @@ extern struct apic *apic;
 #ifdef CONFIG_SMP
 extern atomic_t init_deasserted;
 extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
-extern int wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip);
-#else
-static inline int
-wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip)
-{
-       return 0;
-}
 #endif
 
 static inline u32 apic_read(u32 reg)
index 00595bc2da8da454a933698e5adc16f40dc7608e..f933822dba188fa8cac62e5b404ead77becf4b78 100644 (file)
@@ -222,7 +222,6 @@ struct apic apic_flat =  {
        .send_IPI_all                   = flat_send_IPI_all,
        .send_IPI_self                  = apic_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
        .wait_for_init_deassert         = NULL,
@@ -373,7 +372,6 @@ struct apic apic_physflat =  {
        .send_IPI_all                   = physflat_send_IPI_all,
        .send_IPI_self                  = apic_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
        .wait_for_init_deassert         = NULL,
index 8c25917b51a09e9ee716ef4825dc41d56c8c7b79..69c512e23a9f98242b7160f0bb13fa56c80fbee0 100644 (file)
@@ -256,7 +256,6 @@ struct apic apic_bigsmp = {
        .send_IPI_all                   = bigsmp_send_IPI_all,
        .send_IPI_self                  = default_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
 
index 9f6102fc87a16f53a267094088e5258005aa0679..b4838ed3f26ada8b05db65c5dabe37530c7d5270 100644 (file)
@@ -741,7 +741,7 @@ struct apic apic_es7000_cluster = {
        .send_IPI_all                   = es7000_send_IPI_all,
        .send_IPI_self                  = default_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_mip,
+       .wakeup_secondary_cpu           = wakeup_secondary_cpu_via_mip,
 
        .trampoline_phys_low            = 0x467,
        .trampoline_phys_high           = 0x469,
@@ -806,8 +806,6 @@ struct apic apic_es7000 = {
        .send_IPI_all                   = es7000_send_IPI_all,
        .send_IPI_self                  = default_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
-
        .trampoline_phys_low            = 0x467,
        .trampoline_phys_high           = 0x469,
 
index c503c1799d631279e9a567208e9fad64c843916d..a7f711f5110a559b37d8757c898f9faf3972954b 100644 (file)
@@ -538,7 +538,7 @@ struct apic apic_numaq = {
        .send_IPI_all                   = numaq_send_IPI_all,
        .send_IPI_self                  = default_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_nmi,
+       .wakeup_secondary_cpu           = wakeup_secondary_cpu_via_nmi,
        .trampoline_phys_low            = NUMAQ_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = NUMAQ_TRAMPOLINE_PHYS_HIGH,
 
index 13c6fc7dff99b3218ed60998d353caac9a1d3ebc..141c99a1c26401e444bcc1f85e0d87a7bafc841f 100644 (file)
@@ -138,7 +138,6 @@ struct apic apic_default = {
        .send_IPI_all                   = default_send_IPI_all,
        .send_IPI_self                  = default_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
 
index 5a75d563f676543a155fbc6b757f517145834a0a..0a1135c5a6deb4142af44413f046f43172ce2b9e 100644 (file)
@@ -574,7 +574,6 @@ struct apic apic_summit = {
        .send_IPI_all                   = summit_send_IPI_all,
        .send_IPI_self                  = default_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
 
index 561a6b1042ae3a92fc3c6e316bb7309b46aaaaae..8fb87b6dd63330c193890ac3ae5d704eda096ba2 100644 (file)
@@ -224,7 +224,6 @@ struct apic apic_x2apic_cluster = {
        .send_IPI_all                   = x2apic_send_IPI_all,
        .send_IPI_self                  = x2apic_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
        .wait_for_init_deassert         = NULL,
index 785f8ee4b1df31b48c8bd759e1504c726ba9ecb8..23625b9f98b28530657ca7d572cf4b7a4a60a378 100644 (file)
@@ -213,7 +213,6 @@ struct apic apic_x2apic_phys = {
        .send_IPI_all                   = x2apic_send_IPI_all,
        .send_IPI_self                  = x2apic_send_IPI_self,
 
-       .wakeup_cpu                     = wakeup_secondary_cpu_via_init,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
        .wait_for_init_deassert         = NULL,
index 6d7b9d960ddcb2df147591f96b56fd0e9f01004b..7151de74a39613ed374e84ecf113e6c5ff51d004 100644 (file)
@@ -288,7 +288,7 @@ struct apic apic_x2apic_uv_x = {
        .send_IPI_all                   = uv_send_IPI_all,
        .send_IPI_self                  = uv_send_IPI_self,
 
-       .wakeup_cpu                     = uv_wakeup_secondary,
+       .wakeup_secondary_cpu           = uv_wakeup_secondary,
        .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
        .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
        .wait_for_init_deassert         = NULL,
index 9b338aa03b40d1e13039f2c2d91f1d0c975e43b3..249334f5080a16d2e5a6e2c4fb67a8c19be88891 100644 (file)
@@ -742,7 +742,8 @@ static void __cpuinit do_fork_idle(struct work_struct *work)
 /*
  * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
  * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
- * Returns zero if CPU booted OK, else error code from ->wakeup_cpu.
+ * Returns zero if CPU booted OK, else error code from
+ * ->wakeup_secondary_cpu.
  */
 static int __cpuinit do_boot_cpu(int apicid, int cpu)
 {
@@ -829,9 +830,13 @@ do_rest:
        }
 
        /*
-        * Starting actual IPI sequence...
+        * Kick the secondary CPU. Use the method in the APIC driver
+        * if it's defined - or use an INIT boot APIC message otherwise:
         */
-       boot_error = apic->wakeup_cpu(apicid, start_ip);
+       if (apic->wakeup_secondary_cpu)
+               boot_error = apic->wakeup_secondary_cpu(apicid, start_ip);
+       else
+               boot_error = wakeup_secondary_cpu_via_init(apicid, start_ip);
 
        if (!boot_error) {
                /*