aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/ds.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-14 03:45:16 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-16 07:04:49 -0400
commitb14f5c100ce4c63e4c5a71ab47e71cf4a1caa9e3 (patch)
tree5c13bf03d4ce199bebffb66146daf5d9fd731bfd /arch/sparc64/kernel/ds.c
parentf8be339c02c1e543eee8e09ffe600c0e61be5898 (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/ds.c')
-rw-r--r--arch/sparc64/kernel/ds.c54
1 files changed, 6 insertions, 48 deletions
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c
index b82c03a25d9c..2e4114fba142 100644
--- a/arch/sparc64/kernel/ds.c
+++ b/arch/sparc64/kernel/ds.c
@@ -148,9 +148,11 @@ static void domain_shutdown_data(struct ldc_channel *lp,
148static void domain_panic_data(struct ldc_channel *lp, 148static void domain_panic_data(struct ldc_channel *lp,
149 struct ds_cap_state *cp, 149 struct ds_cap_state *cp,
150 void *buf, int len); 150 void *buf, int len);
151#ifdef CONFIG_HOTPLUG_CPU
151static void dr_cpu_data(struct ldc_channel *lp, 152static void dr_cpu_data(struct ldc_channel *lp,
152 struct ds_cap_state *cp, 153 struct ds_cap_state *cp,
153 void *buf, int len); 154 void *buf, int len);
155#endif
154static void ds_pri_data(struct ldc_channel *lp, 156static void ds_pri_data(struct ldc_channel *lp,
155 struct ds_cap_state *cp, 157 struct ds_cap_state *cp,
156 void *buf, int len); 158 void *buf, int len);
@@ -171,10 +173,12 @@ struct ds_cap_state ds_states[] = {
171 .service_id = "domain-panic", 173 .service_id = "domain-panic",
172 .data = domain_panic_data, 174 .data = domain_panic_data,
173 }, 175 },
176#ifdef CONFIG_HOTPLUG_CPU
174 { 177 {
175 .service_id = "dr-cpu", 178 .service_id = "dr-cpu",
176 .data = dr_cpu_data, 179 .data = dr_cpu_data,
177 }, 180 },
181#endif
178 { 182 {
179 .service_id = "pri", 183 .service_id = "pri",
180 .data = ds_pri_data, 184 .data = ds_pri_data,
@@ -355,6 +359,7 @@ static void domain_panic_data(struct ldc_channel *lp,
355 panic("PANIC requested by LDOM manager."); 359 panic("PANIC requested by LDOM manager.");
356} 360}
357 361
362#ifdef CONFIG_HOTPLUG_CPU
358struct dr_cpu_tag { 363struct dr_cpu_tag {
359 __u64 req_num; 364 __u64 req_num;
360 __u32 type; 365 __u32 type;
@@ -395,54 +400,6 @@ static unsigned long kimage_addr_to_ra(void *p)
395 return kern_base + (val - KERNBASE); 400 return kern_base + (val - KERNBASE);
396} 401}
397 402
398void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg)
399{
400 extern unsigned long sparc64_ttable_tl0;
401 extern unsigned long kern_locked_tte_data;
402 extern int bigkernel;
403 struct hvtramp_descr *hdesc;
404 unsigned long trampoline_ra;
405 struct trap_per_cpu *tb;
406 u64 tte_vaddr, tte_data;
407 unsigned long hv_err;
408
409 hdesc = kzalloc(sizeof(*hdesc), GFP_KERNEL);
410 if (!hdesc) {
411 printk(KERN_ERR PFX "ldom_startcpu_cpuid: Cannot allocate "
412 "hvtramp_descr.\n");
413 return;
414 }
415
416 hdesc->cpu = cpu;
417 hdesc->num_mappings = (bigkernel ? 2 : 1);
418
419 tb = &trap_block[cpu];
420 tb->hdesc = hdesc;
421
422 hdesc->fault_info_va = (unsigned long) &tb->fault_info;
423 hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info);
424
425 hdesc->thread_reg = thread_reg;
426
427 tte_vaddr = (unsigned long) KERNBASE;
428 tte_data = kern_locked_tte_data;
429
430 hdesc->maps[0].vaddr = tte_vaddr;
431 hdesc->maps[0].tte = tte_data;
432 if (bigkernel) {
433 tte_vaddr += 0x400000;
434 tte_data += 0x400000;
435 hdesc->maps[1].vaddr = tte_vaddr;
436 hdesc->maps[1].tte = tte_data;
437 }
438
439 trampoline_ra = kimage_addr_to_ra(hv_cpu_startup);
440
441 hv_err = sun4v_cpu_start(cpu, trampoline_ra,
442 kimage_addr_to_ra(&sparc64_ttable_tl0),
443 __pa(hdesc));
444}
445
446/* DR cpu requests get queued onto the work list by the 403/* DR cpu requests get queued onto the work list by the
447 * dr_cpu_data() callback. The list is protected by 404 * dr_cpu_data() callback. The list is protected by
448 * ds_lock, and processed by dr_cpu_process() in order. 405 * ds_lock, and processed by dr_cpu_process() in order.
@@ -704,6 +661,7 @@ static void dr_cpu_data(struct ldc_channel *lp,
704 schedule_work(&dr_cpu_work); 661 schedule_work(&dr_cpu_work);
705 } 662 }
706} 663}
664#endif
707 665
708struct ds_pri_msg { 666struct ds_pri_msg {
709 __u64 req_num; 667 __u64 req_num;