x86, smp: refactor ->store/restore_NMI_vector() methods
authorIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 15:31:52 +0000 (16:31 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 22:20:33 +0000 (23:20 +0100)
Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
store and restore the NMI vector.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/es7000/wakecpu.h
arch/x86/include/asm/mach-default/mach_wakecpu.h
arch/x86/include/asm/mach-generic/mach_wakecpu.h
arch/x86/include/asm/numaq/wakecpu.h
arch/x86/kernel/smpboot.c
arch/x86/mach-generic/bigsmp.c
arch/x86/mach-generic/default.c
arch/x86/mach-generic/es7000.c
arch/x86/mach-generic/numaq.c
arch/x86/mach-generic/summit.c

index e8e03962633b696c478af9ab57d25adc8885d68d..71a3a412d0e45d035e781ce5bd0969824e82bfcb 100644 (file)
@@ -13,14 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
        return;
 }
 
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
 extern void __inquire_remote_apic(int apicid);
 
 static inline void inquire_remote_apic(int apicid)
index d059807cd7e8c4d54af78a165644bdc9e72fb911..656bb5e52bccd4fa3adb1d0cbbf3375701c8336f 100644 (file)
@@ -8,14 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
        return;
 }
 
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
 #ifdef CONFIG_SMP
 extern void __inquire_remote_apic(int apicid);
 #else /* CONFIG_SMP */
index 30515a154d8ecfd588100b841163bbee38595375..93207dfe8f50caf6205c2db441ca85e08c96de9b 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
 #define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
 
-#define store_NMI_vector (apic->store_NMI_vector)
-#define restore_NMI_vector (apic->restore_NMI_vector)
 #define inquire_remote_apic (apic->inquire_remote_apic)
 
 #endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
index 61d0a7d961360e626be283e720c5a1850aee44c2..123201712a96607243b497e89a6dda826cd71aaf 100644 (file)
@@ -15,7 +15,8 @@ static inline void numaq_smp_callin_clear_local_apic(void)
        clear_local_APIC();
 }
 
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
+static inline void
+numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
 {
        printk("Storing NMI vector\n");
        *high =
@@ -24,7 +25,8 @@ static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
          *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
 }
 
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
+static inline void
+numaq_restore_NMI_vector(unsigned short *high, unsigned short *low)
 {
        printk("Restoring NMI vector\n");
        *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)) =
index 10873a46b29989d8bcfa32dde7836b5ca0d0ea06..1492024592ffae8eb1cb3be6d0a6dea95f65595d 100644 (file)
@@ -826,7 +826,8 @@ do_rest:
 
                pr_debug("Setting warm reset code and vector.\n");
 
-               store_NMI_vector(&nmi_high, &nmi_low);
+               if (apic->store_NMI_vector)
+                       apic->store_NMI_vector(&nmi_high, &nmi_low);
 
                smpboot_setup_warm_reset_vector(start_ip);
                /*
index bd069e7b521c306d268c06efd90cb84bbd6bffad..ecdb230d0f2e36c97978c37f10454c51b7dbc9bb 100644 (file)
@@ -110,8 +110,7 @@ struct genapic apic_bigsmp = {
        .wait_for_init_deassert         = default_wait_for_init_deassert,
 
        .smp_callin_clear_local_apic    = NULL,
-
-       .store_NMI_vector               = store_NMI_vector,
-       .restore_NMI_vector             = restore_NMI_vector,
+       .store_NMI_vector               = NULL,
+       .restore_NMI_vector             = NULL,
        .inquire_remote_apic            = inquire_remote_apic,
 };
index a25e6eff048f4dd5da7c22dc0c8f90ce55d9932d..950925615a9e9a8798bf5a623719672d89d4b93a 100644 (file)
@@ -91,7 +91,7 @@ struct genapic apic_default = {
        .wait_for_init_deassert         = default_wait_for_init_deassert,
 
        .smp_callin_clear_local_apic    = NULL,
-       .store_NMI_vector               = store_NMI_vector,
-       .restore_NMI_vector             = restore_NMI_vector,
+       .store_NMI_vector               = NULL,
+       .restore_NMI_vector             = NULL,
        .inquire_remote_apic            = inquire_remote_apic,
 };
index ab41b543914544f654f8ee68626034b33985dec7..131907091380177bf8fbf0f2b55d057b31f559d1 100644 (file)
@@ -147,8 +147,7 @@ struct genapic apic_es7000 = {
 
        /* Nothing to do for most platforms, since cleared by the INIT cycle: */
        .smp_callin_clear_local_apic    = NULL,
-
-       .store_NMI_vector               = store_NMI_vector,
-       .restore_NMI_vector             = restore_NMI_vector,
+       .store_NMI_vector               = NULL,
+       .restore_NMI_vector             = NULL,
        .inquire_remote_apic            = inquire_remote_apic,
 };
index 4d3924f8cd0bc6b037afc1daa286f924cc80b9ba..d7f7fcf21c39c4d5f906d30c1d7a486656e0eb9a 100644 (file)
@@ -111,7 +111,7 @@ struct genapic apic_numaq = {
        .wait_for_init_deassert         = NULL,
 
        .smp_callin_clear_local_apic    = numaq_smp_callin_clear_local_apic,
-       .store_NMI_vector               = store_NMI_vector,
-       .restore_NMI_vector             = restore_NMI_vector,
+       .store_NMI_vector               = numaq_store_NMI_vector,
+       .restore_NMI_vector             = numaq_restore_NMI_vector,
        .inquire_remote_apic            = inquire_remote_apic,
 };
index 2595baa7997e3248270fa58a7a6a3c404362f786..46fca79f83102d2182af22eb45223f2143fe479c 100644 (file)
@@ -90,8 +90,7 @@ struct genapic apic_summit = {
        .wait_for_init_deassert         = default_wait_for_init_deassert,
 
        .smp_callin_clear_local_apic    = NULL,
-
-       .store_NMI_vector               = store_NMI_vector,
-       .restore_NMI_vector             = restore_NMI_vector,
+       .store_NMI_vector               = NULL,
+       .restore_NMI_vector             = NULL,
        .inquire_remote_apic            = inquire_remote_apic,
 };