diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 10:21:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:32 -0500 |
commit | a965936643e28af8152d9e960b966baa1a5588a2 (patch) | |
tree | f86d64139f85fcaa627840275519a03f3b4fcc86 /arch/x86 | |
parent | abfa584c8df8b691cf18f51c7d4af27e5b32be4a (diff) |
x86, smp: refactor ->wait_for_init_deassert()
- spread out the namespace on a per APIC driver basis
- handle a NULL ->wait_for_init_deassert() as a 'dont wait' default method
- remove NUMAQ and Summit handlers
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/es7000/wakecpu.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_wakecpu.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_wakecpu.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/numaq/wakecpu.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/es7000_32.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 3 | ||||
-rw-r--r-- | arch/x86/mach-generic/bigsmp.c | 4 | ||||
-rw-r--r-- | arch/x86/mach-generic/default.c | 4 | ||||
-rw-r--r-- | arch/x86/mach-generic/es7000.c | 4 | ||||
-rw-r--r-- | arch/x86/mach-generic/numaq.c | 5 | ||||
-rw-r--r-- | arch/x86/mach-generic/summit.c | 4 |
11 files changed, 21 insertions, 19 deletions
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h index 4c01be6ff80c..5c4d05f46d2d 100644 --- a/arch/x86/include/asm/es7000/wakecpu.h +++ b/arch/x86/include/asm/es7000/wakecpu.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #define ES7000_TRAMPOLINE_PHYS_LOW 0x467 | 4 | #define ES7000_TRAMPOLINE_PHYS_LOW 0x467 |
5 | #define ES7000_TRAMPOLINE_PHYS_HIGH 0x469 | 5 | #define ES7000_TRAMPOLINE_PHYS_HIGH 0x469 |
6 | 6 | ||
7 | static inline void wait_for_init_deassert(atomic_t *deassert) | 7 | static inline void es7000_wait_for_init_deassert(atomic_t *deassert) |
8 | { | 8 | { |
9 | #ifndef CONFIG_ES7000_CLUSTERED_APIC | 9 | #ifndef CONFIG_ES7000_CLUSTERED_APIC |
10 | while (!atomic_read(deassert)) | 10 | while (!atomic_read(deassert)) |
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h index a327a675e473..1d34c69a758b 100644 --- a/arch/x86/include/asm/mach-default/mach_wakecpu.h +++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H | 1 | #ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H |
2 | #define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H | 2 | #define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H |
3 | 3 | ||
4 | static inline void wait_for_init_deassert(atomic_t *deassert) | 4 | static inline void default_wait_for_init_deassert(atomic_t *deassert) |
5 | { | 5 | { |
6 | while (!atomic_read(deassert)) | 6 | while (!atomic_read(deassert)) |
7 | cpu_relax(); | 7 | cpu_relax(); |
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h index 2031377a954c..58e54122f730 100644 --- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h +++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h | |||
@@ -1,7 +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 wait_for_init_deassert (apic->wait_for_init_deassert) | ||
5 | #define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic) | 4 | #define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic) |
6 | #define store_NMI_vector (apic->store_NMI_vector) | 5 | #define store_NMI_vector (apic->store_NMI_vector) |
7 | #define restore_NMI_vector (apic->restore_NMI_vector) | 6 | #define restore_NMI_vector (apic->restore_NMI_vector) |
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h index 8b6c16d8558d..884b95cf5846 100644 --- a/arch/x86/include/asm/numaq/wakecpu.h +++ b/arch/x86/include/asm/numaq/wakecpu.h | |||
@@ -6,11 +6,6 @@ | |||
6 | #define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8) | 6 | #define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8) |
7 | #define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa) | 7 | #define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa) |
8 | 8 | ||
9 | /* We don't do anything here because we use NMI's to boot instead */ | ||
10 | static inline void wait_for_init_deassert(atomic_t *deassert) | ||
11 | { | ||
12 | } | ||
13 | |||
14 | /* | 9 | /* |
15 | * Because we use NMIs rather than the INIT-STARTUP sequence to | 10 | * Because we use NMIs rather than the INIT-STARTUP sequence to |
16 | * bootstrap the CPUs, the APIC may be in a weird state. Kick it. | 11 | * bootstrap the CPUs, the APIC may be in a weird state. Kick it. |
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c index e73fe18488ac..d7f433ee602d 100644 --- a/arch/x86/kernel/es7000_32.c +++ b/arch/x86/kernel/es7000_32.c | |||
@@ -182,10 +182,6 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip) | |||
182 | return 0; | 182 | return 0; |
183 | } | 183 | } |
184 | 184 | ||
185 | static void noop_wait_for_deassert(atomic_t *deassert_not_used) | ||
186 | { | ||
187 | } | ||
188 | |||
189 | static int __init es7000_update_genapic(void) | 185 | static int __init es7000_update_genapic(void) |
190 | { | 186 | { |
191 | apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; | 187 | apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; |
@@ -194,7 +190,7 @@ static int __init es7000_update_genapic(void) | |||
194 | if (boot_cpu_data.x86 == 6 && | 190 | if (boot_cpu_data.x86 == 6 && |
195 | (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) { | 191 | (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) { |
196 | es7000_update_genapic_to_cluster(); | 192 | es7000_update_genapic_to_cluster(); |
197 | apic->wait_for_init_deassert = noop_wait_for_deassert; | 193 | apic->wait_for_init_deassert = NULL; |
198 | apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; | 194 | apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; |
199 | } | 195 | } |
200 | 196 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index ab83be2f8e0f..558af378a61d 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -196,7 +196,8 @@ static void __cpuinit smp_callin(void) | |||
196 | * our local APIC. We have to wait for the IPI or we'll | 196 | * our local APIC. We have to wait for the IPI or we'll |
197 | * lock up on an APIC access. | 197 | * lock up on an APIC access. |
198 | */ | 198 | */ |
199 | wait_for_init_deassert(&init_deasserted); | 199 | if (apic->wait_for_init_deassert) |
200 | apic->wait_for_init_deassert(&init_deasserted); | ||
200 | 201 | ||
201 | /* | 202 | /* |
202 | * (This works even if the APIC is not enabled.) | 203 | * (This works even if the APIC is not enabled.) |
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c index a317fbe07fdf..40910bfd1b42 100644 --- a/arch/x86/mach-generic/bigsmp.c +++ b/arch/x86/mach-generic/bigsmp.c | |||
@@ -106,7 +106,9 @@ struct genapic apic_bigsmp = { | |||
106 | .wakeup_cpu = NULL, | 106 | .wakeup_cpu = NULL, |
107 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 107 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
108 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 108 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
109 | .wait_for_init_deassert = wait_for_init_deassert, | 109 | |
110 | .wait_for_init_deassert = default_wait_for_init_deassert, | ||
111 | |||
110 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, | 112 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
111 | .store_NMI_vector = store_NMI_vector, | 113 | .store_NMI_vector = store_NMI_vector, |
112 | .restore_NMI_vector = restore_NMI_vector, | 114 | .restore_NMI_vector = restore_NMI_vector, |
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c index 17d8f9c22180..c2464843df9e 100644 --- a/arch/x86/mach-generic/default.c +++ b/arch/x86/mach-generic/default.c | |||
@@ -87,7 +87,9 @@ struct genapic apic_default = { | |||
87 | .wakeup_cpu = NULL, | 87 | .wakeup_cpu = NULL, |
88 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 88 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
89 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 89 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
90 | .wait_for_init_deassert = wait_for_init_deassert, | 90 | |
91 | .wait_for_init_deassert = default_wait_for_init_deassert, | ||
92 | |||
91 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, | 93 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
92 | .store_NMI_vector = store_NMI_vector, | 94 | .store_NMI_vector = store_NMI_vector, |
93 | .restore_NMI_vector = restore_NMI_vector, | 95 | .restore_NMI_vector = restore_NMI_vector, |
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c index 871e85445e21..4cb3984834ed 100644 --- a/arch/x86/mach-generic/es7000.c +++ b/arch/x86/mach-generic/es7000.c | |||
@@ -142,7 +142,9 @@ struct genapic apic_es7000 = { | |||
142 | .wakeup_cpu = NULL, | 142 | .wakeup_cpu = NULL, |
143 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 143 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
144 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 144 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
145 | .wait_for_init_deassert = wait_for_init_deassert, | 145 | |
146 | .wait_for_init_deassert = default_wait_for_init_deassert, | ||
147 | |||
146 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, | 148 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
147 | .store_NMI_vector = store_NMI_vector, | 149 | .store_NMI_vector = store_NMI_vector, |
148 | .restore_NMI_vector = restore_NMI_vector, | 150 | .restore_NMI_vector = restore_NMI_vector, |
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c index 0b496ab5450c..fb03867e7c0f 100644 --- a/arch/x86/mach-generic/numaq.c +++ b/arch/x86/mach-generic/numaq.c | |||
@@ -106,7 +106,10 @@ struct genapic apic_numaq = { | |||
106 | .wakeup_cpu = NULL, | 106 | .wakeup_cpu = NULL, |
107 | .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW, | 107 | .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW, |
108 | .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, | 108 | .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, |
109 | .wait_for_init_deassert = wait_for_init_deassert, | 109 | |
110 | /* We don't do anything here because we use NMI's to boot instead */ | ||
111 | .wait_for_init_deassert = NULL, | ||
112 | |||
110 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, | 113 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
111 | .store_NMI_vector = store_NMI_vector, | 114 | .store_NMI_vector = store_NMI_vector, |
112 | .restore_NMI_vector = restore_NMI_vector, | 115 | .restore_NMI_vector = restore_NMI_vector, |
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c index c4799cd34592..fdca78b96b6a 100644 --- a/arch/x86/mach-generic/summit.c +++ b/arch/x86/mach-generic/summit.c | |||
@@ -86,7 +86,9 @@ struct genapic apic_summit = { | |||
86 | .wakeup_cpu = NULL, | 86 | .wakeup_cpu = NULL, |
87 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 87 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
88 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 88 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
89 | .wait_for_init_deassert = wait_for_init_deassert, | 89 | |
90 | .wait_for_init_deassert = default_wait_for_init_deassert, | ||
91 | |||
90 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, | 92 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
91 | .store_NMI_vector = store_NMI_vector, | 93 | .store_NMI_vector = store_NMI_vector, |
92 | .restore_NMI_vector = restore_NMI_vector, | 94 | .restore_NMI_vector = restore_NMI_vector, |