aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 10:31:52 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:33 -0500
commit7bd06ec63a1204ca44b9f1dc487b8632016162d1 (patch)
treef9c89011185f9ba4be2a20e7d9fed14f3b50ab7e
parent333344d94300500e401cffb4eea10a5ab6e5a41d (diff)
x86, smp: refactor ->store/restore_NMI_vector() methods
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>
-rw-r--r--arch/x86/include/asm/es7000/wakecpu.h8
-rw-r--r--arch/x86/include/asm/mach-default/mach_wakecpu.h8
-rw-r--r--arch/x86/include/asm/mach-generic/mach_wakecpu.h2
-rw-r--r--arch/x86/include/asm/numaq/wakecpu.h6
-rw-r--r--arch/x86/kernel/smpboot.c3
-rw-r--r--arch/x86/mach-generic/bigsmp.c5
-rw-r--r--arch/x86/mach-generic/default.c4
-rw-r--r--arch/x86/mach-generic/es7000.c5
-rw-r--r--arch/x86/mach-generic/numaq.c4
-rw-r--r--arch/x86/mach-generic/summit.c5
10 files changed, 16 insertions, 34 deletions
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
index e8e03962633b..71a3a412d0e4 100644
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ b/arch/x86/include/asm/es7000/wakecpu.h
@@ -13,14 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
13 return; 13 return;
14} 14}
15 15
16static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
17{
18}
19
20static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
21{
22}
23
24extern void __inquire_remote_apic(int apicid); 16extern void __inquire_remote_apic(int apicid);
25 17
26static inline void inquire_remote_apic(int apicid) 18static inline void inquire_remote_apic(int apicid)
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index d059807cd7e8..656bb5e52bcc 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -8,14 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
8 return; 8 return;
9} 9}
10 10
11static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
12{
13}
14
15static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
16{
17}
18
19#ifdef CONFIG_SMP 11#ifdef CONFIG_SMP
20extern void __inquire_remote_apic(int apicid); 12extern void __inquire_remote_apic(int apicid);
21#else /* CONFIG_SMP */ 13#else /* CONFIG_SMP */
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
index 30515a154d8e..93207dfe8f50 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H 1#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
2#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H 2#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
3 3
4#define store_NMI_vector (apic->store_NMI_vector)
5#define restore_NMI_vector (apic->restore_NMI_vector)
6#define inquire_remote_apic (apic->inquire_remote_apic) 4#define inquire_remote_apic (apic->inquire_remote_apic)
7 5
8#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */ 6#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 61d0a7d96136..123201712a96 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -15,7 +15,8 @@ static inline void numaq_smp_callin_clear_local_apic(void)
15 clear_local_APIC(); 15 clear_local_APIC();
16} 16}
17 17
18static inline void store_NMI_vector(unsigned short *high, unsigned short *low) 18static inline void
19numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
19{ 20{
20 printk("Storing NMI vector\n"); 21 printk("Storing NMI vector\n");
21 *high = 22 *high =
@@ -24,7 +25,8 @@ static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
24 *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW)); 25 *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
25} 26}
26 27
27static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) 28static inline void
29numaq_restore_NMI_vector(unsigned short *high, unsigned short *low)
28{ 30{
29 printk("Restoring NMI vector\n"); 31 printk("Restoring NMI vector\n");
30 *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)) = 32 *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)) =
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 10873a46b299..1492024592ff 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -826,7 +826,8 @@ do_rest:
826 826
827 pr_debug("Setting warm reset code and vector.\n"); 827 pr_debug("Setting warm reset code and vector.\n");
828 828
829 store_NMI_vector(&nmi_high, &nmi_low); 829 if (apic->store_NMI_vector)
830 apic->store_NMI_vector(&nmi_high, &nmi_low);
830 831
831 smpboot_setup_warm_reset_vector(start_ip); 832 smpboot_setup_warm_reset_vector(start_ip);
832 /* 833 /*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index bd069e7b521c..ecdb230d0f2e 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -110,8 +110,7 @@ struct genapic apic_bigsmp = {
110 .wait_for_init_deassert = default_wait_for_init_deassert, 110 .wait_for_init_deassert = default_wait_for_init_deassert,
111 111
112 .smp_callin_clear_local_apic = NULL, 112 .smp_callin_clear_local_apic = NULL,
113 113 .store_NMI_vector = NULL,
114 .store_NMI_vector = store_NMI_vector, 114 .restore_NMI_vector = NULL,
115 .restore_NMI_vector = restore_NMI_vector,
116 .inquire_remote_apic = inquire_remote_apic, 115 .inquire_remote_apic = inquire_remote_apic,
117}; 116};
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index a25e6eff048f..950925615a9e 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -91,7 +91,7 @@ struct genapic apic_default = {
91 .wait_for_init_deassert = default_wait_for_init_deassert, 91 .wait_for_init_deassert = default_wait_for_init_deassert,
92 92
93 .smp_callin_clear_local_apic = NULL, 93 .smp_callin_clear_local_apic = NULL,
94 .store_NMI_vector = store_NMI_vector, 94 .store_NMI_vector = NULL,
95 .restore_NMI_vector = restore_NMI_vector, 95 .restore_NMI_vector = NULL,
96 .inquire_remote_apic = inquire_remote_apic, 96 .inquire_remote_apic = inquire_remote_apic,
97}; 97};
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index ab41b5439145..131907091380 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -147,8 +147,7 @@ struct genapic apic_es7000 = {
147 147
148 /* Nothing to do for most platforms, since cleared by the INIT cycle: */ 148 /* Nothing to do for most platforms, since cleared by the INIT cycle: */
149 .smp_callin_clear_local_apic = NULL, 149 .smp_callin_clear_local_apic = NULL,
150 150 .store_NMI_vector = NULL,
151 .store_NMI_vector = store_NMI_vector, 151 .restore_NMI_vector = NULL,
152 .restore_NMI_vector = restore_NMI_vector,
153 .inquire_remote_apic = inquire_remote_apic, 152 .inquire_remote_apic = inquire_remote_apic,
154}; 153};
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 4d3924f8cd0b..d7f7fcf21c39 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -111,7 +111,7 @@ struct genapic apic_numaq = {
111 .wait_for_init_deassert = NULL, 111 .wait_for_init_deassert = NULL,
112 112
113 .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic, 113 .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
114 .store_NMI_vector = store_NMI_vector, 114 .store_NMI_vector = numaq_store_NMI_vector,
115 .restore_NMI_vector = restore_NMI_vector, 115 .restore_NMI_vector = numaq_restore_NMI_vector,
116 .inquire_remote_apic = inquire_remote_apic, 116 .inquire_remote_apic = inquire_remote_apic,
117}; 117};
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 2595baa7997e..46fca79f8310 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -90,8 +90,7 @@ struct genapic apic_summit = {
90 .wait_for_init_deassert = default_wait_for_init_deassert, 90 .wait_for_init_deassert = default_wait_for_init_deassert,
91 91
92 .smp_callin_clear_local_apic = NULL, 92 .smp_callin_clear_local_apic = NULL,
93 93 .store_NMI_vector = NULL,
94 .store_NMI_vector = store_NMI_vector, 94 .restore_NMI_vector = NULL,
95 .restore_NMI_vector = restore_NMI_vector,
96 .inquire_remote_apic = inquire_remote_apic, 95 .inquire_remote_apic = inquire_remote_apic,
97}; 96};