diff options
author | Yinghai Lu <yinghai@kernel.org> | 2008-11-17 18:19:53 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-17 18:27:24 -0500 |
commit | 54ac14a8e982ae6c7ac71ee2b0d0173b974509e2 (patch) | |
tree | fa716a60474c2e3592cd06afa52f381cdd2cece8 /arch/x86 | |
parent | 569712b2b0970fa5b19673544d62ae661d04a220 (diff) |
x86: fix wakeup_cpu with numaq/es7000, v2, fix
Impact: fix wakeup_secondary_cpu with hotplug
We can not put that into x86_quirks, because that is __initdata.
So try to move that to genapic, and add update_genapic in x86_quirks.
later we even could use that stub to:
1. autodetect CONFIG_ES7000_CLUSTERED_APIC
2. more correct inquire_remote_apic with apic_verbosity setting.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/genapic_32.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/genapic_64.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_apic.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/setup.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/es7000_32.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/genapic_64.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/numaq_32.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 11 | ||||
-rw-r--r-- | arch/x86/mach-generic/probe.c | 4 |
11 files changed, 48 insertions, 15 deletions
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h index 39bd8c1db3f5..455d6c27a98b 100644 --- a/arch/x86/include/asm/genapic_32.h +++ b/arch/x86/include/asm/genapic_32.h | |||
@@ -66,6 +66,7 @@ struct genapic { | |||
66 | void (*send_IPI_allbutself)(int vector); | 66 | void (*send_IPI_allbutself)(int vector); |
67 | void (*send_IPI_all)(int vector); | 67 | void (*send_IPI_all)(int vector); |
68 | #endif | 68 | #endif |
69 | int (*wakeup_cpu)(int apicid, unsigned long start_eip); | ||
69 | int trampoline_phys_low; | 70 | int trampoline_phys_low; |
70 | int trampoline_phys_high; | 71 | int trampoline_phys_high; |
71 | void (*wait_for_init_deassert)(atomic_t *deassert); | 72 | void (*wait_for_init_deassert)(atomic_t *deassert); |
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h index 13c4e96199ea..2cae011668b7 100644 --- a/arch/x86/include/asm/genapic_64.h +++ b/arch/x86/include/asm/genapic_64.h | |||
@@ -32,6 +32,8 @@ struct genapic { | |||
32 | unsigned int (*get_apic_id)(unsigned long x); | 32 | unsigned int (*get_apic_id)(unsigned long x); |
33 | unsigned long (*set_apic_id)(unsigned int id); | 33 | unsigned long (*set_apic_id)(unsigned int id); |
34 | unsigned long apic_id_mask; | 34 | unsigned long apic_id_mask; |
35 | /* wakeup_secondary_cpu */ | ||
36 | int (*wakeup_cpu)(int apicid, unsigned long start_eip); | ||
35 | }; | 37 | }; |
36 | 38 | ||
37 | extern struct genapic *genapic; | 39 | extern struct genapic *genapic; |
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index ff3a6c236c00..6cb3a467e067 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -32,11 +32,13 @@ static inline cpumask_t target_cpus(void) | |||
32 | #define vector_allocation_domain (genapic->vector_allocation_domain) | 32 | #define vector_allocation_domain (genapic->vector_allocation_domain) |
33 | #define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) | 33 | #define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) |
34 | #define send_IPI_self (genapic->send_IPI_self) | 34 | #define send_IPI_self (genapic->send_IPI_self) |
35 | #define wakeup_secondary_cpu (genapic->wakeup_cpu) | ||
35 | extern void setup_apic_routing(void); | 36 | extern void setup_apic_routing(void); |
36 | #else | 37 | #else |
37 | #define INT_DELIVERY_MODE dest_LowestPrio | 38 | #define INT_DELIVERY_MODE dest_LowestPrio |
38 | #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ | 39 | #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ |
39 | #define TARGET_CPUS (target_cpus()) | 40 | #define TARGET_CPUS (target_cpus()) |
41 | #define wakeup_secondary_cpu wakeup_secondary_cpu_via_init | ||
40 | /* | 42 | /* |
41 | * Set up the logical destination ID. | 43 | * Set up the logical destination ID. |
42 | * | 44 | * |
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h index 5180bd7478fb..e430f47df667 100644 --- a/arch/x86/include/asm/mach-generic/mach_apic.h +++ b/arch/x86/include/asm/mach-generic/mach_apic.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define vector_allocation_domain (genapic->vector_allocation_domain) | 27 | #define vector_allocation_domain (genapic->vector_allocation_domain) |
28 | #define enable_apic_mode (genapic->enable_apic_mode) | 28 | #define enable_apic_mode (genapic->enable_apic_mode) |
29 | #define phys_pkg_id (genapic->phys_pkg_id) | 29 | #define phys_pkg_id (genapic->phys_pkg_id) |
30 | #define wakeup_secondary_cpu (genapic->wakeup_cpu) | ||
30 | 31 | ||
31 | extern void generic_bigsmp_probe(void); | 32 | extern void generic_bigsmp_probe(void); |
32 | 33 | ||
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 40b2d3304911..294daeb3a006 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
@@ -17,6 +17,7 @@ static inline int is_visws_box(void) { return 0; } | |||
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip); | 19 | extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip); |
20 | extern int wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip); | ||
20 | /* | 21 | /* |
21 | * Any setup quirks to be performed? | 22 | * Any setup quirks to be performed? |
22 | */ | 23 | */ |
@@ -40,7 +41,7 @@ struct x86_quirks { | |||
40 | void (*smp_read_mpc_oem)(struct mp_config_oemtable *oemtable, | 41 | void (*smp_read_mpc_oem)(struct mp_config_oemtable *oemtable, |
41 | unsigned short oemsize); | 42 | unsigned short oemsize); |
42 | int (*setup_ioapic_ids)(void); | 43 | int (*setup_ioapic_ids)(void); |
43 | int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); | 44 | int (*update_genapic)(void); |
44 | }; | 45 | }; |
45 | 46 | ||
46 | extern struct x86_quirks *x86_quirks; | 47 | extern struct x86_quirks *x86_quirks; |
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c index bed10dddf099..fb3bfe66fbe2 100644 --- a/arch/x86/kernel/es7000_32.c +++ b/arch/x86/kernel/es7000_32.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <asm/smp.h> | 40 | #include <asm/smp.h> |
41 | #include <asm/apicdef.h> | 41 | #include <asm/apicdef.h> |
42 | #include <mach_mpparse.h> | 42 | #include <mach_mpparse.h> |
43 | #include <asm/genapic.h> | ||
43 | #include <asm/setup.h> | 44 | #include <asm/setup.h> |
44 | 45 | ||
45 | /* | 46 | /* |
@@ -180,6 +181,13 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip) | |||
180 | 181 | ||
181 | return 0; | 182 | return 0; |
182 | } | 183 | } |
184 | |||
185 | static int __init es7000_update_genapic(void) | ||
186 | { | ||
187 | genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip; | ||
188 | |||
189 | return 0; | ||
190 | } | ||
183 | #endif | 191 | #endif |
184 | 192 | ||
185 | void __init | 193 | void __init |
@@ -197,8 +205,9 @@ setup_unisys(void) | |||
197 | else | 205 | else |
198 | es7000_plat = ES7000_CLASSIC; | 206 | es7000_plat = ES7000_CLASSIC; |
199 | ioapic_renumber_irq = es7000_rename_gsi; | 207 | ioapic_renumber_irq = es7000_rename_gsi; |
208 | |||
200 | #ifdef CONFIG_ES7000_CLUSTERED_APIC | 209 | #ifdef CONFIG_ES7000_CLUSTERED_APIC |
201 | x86_quirks->wakeup_secondary_cpu = wakeup_secondary_cpu_via_mip; | 210 | x86_quirks->update_genapic = es7000_update_genapic; |
202 | #endif | 211 | #endif |
203 | } | 212 | } |
204 | 213 | ||
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 6c9bfc9e1e95..2bced78b0b8e 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/smp.h> | 21 | #include <asm/smp.h> |
22 | #include <asm/ipi.h> | 22 | #include <asm/ipi.h> |
23 | #include <asm/genapic.h> | 23 | #include <asm/genapic.h> |
24 | #include <asm/setup.h> | ||
24 | 25 | ||
25 | extern struct genapic apic_flat; | 26 | extern struct genapic apic_flat; |
26 | extern struct genapic apic_physflat; | 27 | extern struct genapic apic_physflat; |
@@ -53,6 +54,9 @@ void __init setup_apic_routing(void) | |||
53 | genapic = &apic_physflat; | 54 | genapic = &apic_physflat; |
54 | printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); | 55 | printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); |
55 | } | 56 | } |
57 | |||
58 | if (x86_quirks->update_genapic) | ||
59 | x86_quirks->update_genapic(); | ||
56 | } | 60 | } |
57 | 61 | ||
58 | /* Same for both flat and physical. */ | 62 | /* Same for both flat and physical. */ |
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c index 745891b7d0fb..0deea37a53cf 100644 --- a/arch/x86/kernel/numaq_32.c +++ b/arch/x86/kernel/numaq_32.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/numaq.h> | 31 | #include <asm/numaq.h> |
32 | #include <asm/topology.h> | 32 | #include <asm/topology.h> |
33 | #include <asm/processor.h> | 33 | #include <asm/processor.h> |
34 | #include <asm/mpspec.h> | 34 | #include <asm/genapic.h> |
35 | #include <asm/e820.h> | 35 | #include <asm/e820.h> |
36 | #include <asm/setup.h> | 36 | #include <asm/setup.h> |
37 | 37 | ||
@@ -235,6 +235,13 @@ static int __init numaq_setup_ioapic_ids(void) | |||
235 | return 1; | 235 | return 1; |
236 | } | 236 | } |
237 | 237 | ||
238 | static int __init numaq_update_genapic(void) | ||
239 | { | ||
240 | genapic->wakeup_cpu = wakeup_secondary_cpu_via_nmi; | ||
241 | |||
242 | return 0; | ||
243 | } | ||
244 | |||
238 | static struct x86_quirks numaq_x86_quirks __initdata = { | 245 | static struct x86_quirks numaq_x86_quirks __initdata = { |
239 | .arch_pre_time_init = numaq_pre_time_init, | 246 | .arch_pre_time_init = numaq_pre_time_init, |
240 | .arch_time_init = NULL, | 247 | .arch_time_init = NULL, |
@@ -250,7 +257,7 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
250 | .mpc_oem_pci_bus = mpc_oem_pci_bus, | 257 | .mpc_oem_pci_bus = mpc_oem_pci_bus, |
251 | .smp_read_mpc_oem = smp_read_mpc_oem, | 258 | .smp_read_mpc_oem = smp_read_mpc_oem, |
252 | .setup_ioapic_ids = numaq_setup_ioapic_ids, | 259 | .setup_ioapic_ids = numaq_setup_ioapic_ids, |
253 | .wakeup_secondary_cpu = wakeup_secondary_cpu_via_nmi, | 260 | .update_genapic = numaq_update_genapic, |
254 | }; | 261 | }; |
255 | 262 | ||
256 | void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, | 263 | void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0fa6790c1dd3..c366e891e10b 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -583,7 +583,18 @@ static int __init setup_elfcorehdr(char *arg) | |||
583 | early_param("elfcorehdr", setup_elfcorehdr); | 583 | early_param("elfcorehdr", setup_elfcorehdr); |
584 | #endif | 584 | #endif |
585 | 585 | ||
586 | static struct x86_quirks default_x86_quirks __initdata; | 586 | static int __init default_update_genapic(void) |
587 | { | ||
588 | #if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64) | ||
589 | genapic->wakeup_cpu = wakeup_secondary_cpu_via_nmi; | ||
590 | #endif | ||
591 | |||
592 | return 0; | ||
593 | } | ||
594 | |||
595 | static struct x86_quirks default_x86_quirks __initdata = { | ||
596 | .update_genapic = default_update_genapic, | ||
597 | }; | ||
587 | 598 | ||
588 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; | 599 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; |
589 | 600 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 498c1ef37fe0..0e9f446269f4 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -615,7 +615,7 @@ wakeup_secondary_cpu_via_nmi(int logical_apicid, unsigned long start_eip) | |||
615 | return (send_status | accept_status); | 615 | return (send_status | accept_status); |
616 | } | 616 | } |
617 | 617 | ||
618 | static int __devinit | 618 | int __devinit |
619 | wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) | 619 | wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) |
620 | { | 620 | { |
621 | unsigned long send_status, accept_status = 0; | 621 | unsigned long send_status, accept_status = 0; |
@@ -736,15 +736,6 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) | |||
736 | return (send_status | accept_status); | 736 | return (send_status | accept_status); |
737 | } | 737 | } |
738 | 738 | ||
739 | static int __devinit | ||
740 | wakeup_secondary_cpu(int apicid, unsigned long start_eip) | ||
741 | { | ||
742 | if (x86_quirks->wakeup_secondary_cpu) | ||
743 | return x86_quirks->wakeup_secondary_cpu(apicid, start_eip); | ||
744 | |||
745 | return wakeup_secondary_cpu_via_init(apicid, start_eip); | ||
746 | } | ||
747 | |||
748 | struct create_idle { | 739 | struct create_idle { |
749 | struct work_struct work; | 740 | struct work_struct work; |
750 | struct task_struct *idle; | 741 | struct task_struct *idle; |
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c index 5a7e4619e1c4..90b134f3cd74 100644 --- a/arch/x86/mach-generic/probe.c +++ b/arch/x86/mach-generic/probe.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/mpspec.h> | 15 | #include <asm/mpspec.h> |
16 | #include <asm/apicdef.h> | 16 | #include <asm/apicdef.h> |
17 | #include <asm/genapic.h> | 17 | #include <asm/genapic.h> |
18 | #include <asm/setup.h> | ||
18 | 19 | ||
19 | extern struct genapic apic_numaq; | 20 | extern struct genapic apic_numaq; |
20 | extern struct genapic apic_summit; | 21 | extern struct genapic apic_summit; |
@@ -57,6 +58,9 @@ static int __init parse_apic(char *arg) | |||
57 | } | 58 | } |
58 | } | 59 | } |
59 | 60 | ||
61 | if (x86_quirks->update_genapic) | ||
62 | x86_quirks->update_genapic(); | ||
63 | |||
60 | /* Parsed again by __setup for debug/verbose */ | 64 | /* Parsed again by __setup for debug/verbose */ |
61 | return 0; | 65 | return 0; |
62 | } | 66 | } |