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 | |
| 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')
| -rw-r--r-- | arch/sparc64/Kconfig | 1 | ||||
| -rw-r--r-- | arch/sparc64/kernel/Makefile | 5 | ||||
| -rw-r--r-- | arch/sparc64/kernel/ds.c | 54 | ||||
| -rw-r--r-- | arch/sparc64/kernel/smp.c | 52 |
4 files changed, 59 insertions, 53 deletions
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index 3c2e3397caf8..b84b6af1241e 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
| @@ -316,7 +316,6 @@ config SUN_IO | |||
| 316 | 316 | ||
| 317 | config SUN_LDOMS | 317 | config SUN_LDOMS |
| 318 | bool "Sun Logical Domains support" | 318 | bool "Sun Logical Domains support" |
| 319 | select HOTPLUG_CPU | ||
| 320 | help | 319 | help |
| 321 | Say Y here is you want to support virtual devices via | 320 | Say Y here is you want to support virtual devices via |
| 322 | Logical Domains. | 321 | Logical Domains. |
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index 62db93c148cd..b66876bf410c 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile | |||
| @@ -12,14 +12,13 @@ obj-y := process.o setup.o cpu.o idprom.o \ | |||
| 12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ | 12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ |
| 13 | unaligned.o central.o pci.o starfire.o semaphore.o \ | 13 | unaligned.o central.o pci.o starfire.o semaphore.o \ |
| 14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \ | 14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \ |
| 15 | visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o \ | 15 | visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o |
| 16 | hvtramp.o | ||
| 17 | 16 | ||
| 18 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 17 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| 19 | obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ | 18 | obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ |
| 20 | pci_psycho.o pci_sabre.o pci_schizo.o \ | 19 | pci_psycho.o pci_sabre.o pci_schizo.o \ |
| 21 | pci_sun4v.o pci_sun4v_asm.o pci_fire.o | 20 | pci_sun4v.o pci_sun4v_asm.o pci_fire.o |
| 22 | obj-$(CONFIG_SMP) += smp.o trampoline.o | 21 | obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o |
| 23 | obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o | 22 | obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o |
| 24 | obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o | 23 | obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o |
| 25 | obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o | 24 | obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o |
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, | |||
| 148 | static void domain_panic_data(struct ldc_channel *lp, | 148 | static 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 | ||
| 151 | static void dr_cpu_data(struct ldc_channel *lp, | 152 | static 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 | ||
| 154 | static void ds_pri_data(struct ldc_channel *lp, | 156 | static 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 | ||
| 358 | struct dr_cpu_tag { | 363 | struct 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 | ||
| 398 | void 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 | ||
| 708 | struct ds_pri_msg { | 666 | struct ds_pri_msg { |
| 709 | __u64 req_num; | 667 | __u64 req_num; |
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); |
