diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-14 03:45:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-16 07:04:49 -0400 |
commit | b14f5c100ce4c63e4c5a71ab47e71cf4a1caa9e3 (patch) | |
tree | 5c13bf03d4ce199bebffb66146daf5d9fd731bfd /arch/sparc64/kernel/smp.c | |
parent | f8be339c02c1e543eee8e09ffe600c0e61be5898 (diff) |
[SPARC64]: Fix build regressions added by dr-cpu changes.
Do not select HOTPLUG_CPU from SUN_LDOMS, that causes
HOTPLUG_CPU to be selected even on non-SMP which is
illegal.
Only build hvtramp.o when SMP, just like trampoline.o
Protect dr-cpu code in ds.c with HOTPLUG_CPU.
Likewise move ldom_startcpu_cpuid() to smp.c and protect
it and the call site with SUN_LDOMS && HOTPLUG_CPU.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/smp.c')
-rw-r--r-- | arch/sparc64/kernel/smp.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 315eef0869bd..833b284616a4 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -281,6 +281,56 @@ static void smp_synchronize_one_tick(int cpu) | |||
281 | spin_unlock_irqrestore(&itc_sync_lock, flags); | 281 | spin_unlock_irqrestore(&itc_sync_lock, flags); |
282 | } | 282 | } |
283 | 283 | ||
284 | #if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) | ||
285 | static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg) | ||
286 | { | ||
287 | extern unsigned long sparc64_ttable_tl0; | ||
288 | extern unsigned long kern_locked_tte_data; | ||
289 | extern int bigkernel; | ||
290 | struct hvtramp_descr *hdesc; | ||
291 | unsigned long trampoline_ra; | ||
292 | struct trap_per_cpu *tb; | ||
293 | u64 tte_vaddr, tte_data; | ||
294 | unsigned long hv_err; | ||
295 | |||
296 | hdesc = kzalloc(sizeof(*hdesc), GFP_KERNEL); | ||
297 | if (!hdesc) { | ||
298 | printk(KERN_ERR PFX "ldom_startcpu_cpuid: Cannot allocate " | ||
299 | "hvtramp_descr.\n"); | ||
300 | return; | ||
301 | } | ||
302 | |||
303 | hdesc->cpu = cpu; | ||
304 | hdesc->num_mappings = (bigkernel ? 2 : 1); | ||
305 | |||
306 | tb = &trap_block[cpu]; | ||
307 | tb->hdesc = hdesc; | ||
308 | |||
309 | hdesc->fault_info_va = (unsigned long) &tb->fault_info; | ||
310 | hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info); | ||
311 | |||
312 | hdesc->thread_reg = thread_reg; | ||
313 | |||
314 | tte_vaddr = (unsigned long) KERNBASE; | ||
315 | tte_data = kern_locked_tte_data; | ||
316 | |||
317 | hdesc->maps[0].vaddr = tte_vaddr; | ||
318 | hdesc->maps[0].tte = tte_data; | ||
319 | if (bigkernel) { | ||
320 | tte_vaddr += 0x400000; | ||
321 | tte_data += 0x400000; | ||
322 | hdesc->maps[1].vaddr = tte_vaddr; | ||
323 | hdesc->maps[1].tte = tte_data; | ||
324 | } | ||
325 | |||
326 | trampoline_ra = kimage_addr_to_ra(hv_cpu_startup); | ||
327 | |||
328 | hv_err = sun4v_cpu_start(cpu, trampoline_ra, | ||
329 | kimage_addr_to_ra(&sparc64_ttable_tl0), | ||
330 | __pa(hdesc)); | ||
331 | } | ||
332 | #endif | ||
333 | |||
284 | extern void sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int load); | 334 | extern void sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int load); |
285 | 335 | ||
286 | extern unsigned long sparc64_cpu_startup; | 336 | extern unsigned long sparc64_cpu_startup; |
@@ -309,7 +359,7 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu) | |||
309 | /* Alloc the mondo queues, cpu will load them. */ | 359 | /* Alloc the mondo queues, cpu will load them. */ |
310 | sun4v_init_mondo_queues(0, cpu, 1, 0); | 360 | sun4v_init_mondo_queues(0, cpu, 1, 0); |
311 | 361 | ||
312 | #ifdef CONFIG_SUN_LDOMS | 362 | #if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) |
313 | if (ldom_domaining_enabled) | 363 | if (ldom_domaining_enabled) |
314 | ldom_startcpu_cpuid(cpu, | 364 | ldom_startcpu_cpuid(cpu, |
315 | (unsigned long) cpu_new_thread); | 365 | (unsigned long) cpu_new_thread); |