aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r--arch/s390/kernel/smp.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index fdfcf0488b49..642572a8e334 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -284,7 +284,7 @@ static void do_machine_restart(void * __unused)
284 * locks are always held disabled). 284 * locks are always held disabled).
285 */ 285 */
286 if (MACHINE_IS_VM) 286 if (MACHINE_IS_VM)
287 cpcmd ("IPL", NULL, 0); 287 cpcmd ("IPL", NULL, 0, NULL);
288 else 288 else
289 reipl (0x10000 | S390_lowcore.ipl_device); 289 reipl (0x10000 | S390_lowcore.ipl_device);
290} 290}
@@ -313,7 +313,7 @@ static void do_machine_halt(void * __unused)
313 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) { 313 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) {
314 smp_send_stop(); 314 smp_send_stop();
315 if (MACHINE_IS_VM && strlen(vmhalt_cmd) > 0) 315 if (MACHINE_IS_VM && strlen(vmhalt_cmd) > 0)
316 cpcmd(vmhalt_cmd, NULL, 0); 316 cpcmd(vmhalt_cmd, NULL, 0, NULL);
317 signal_processor(smp_processor_id(), 317 signal_processor(smp_processor_id(),
318 sigp_stop_and_store_status); 318 sigp_stop_and_store_status);
319 } 319 }
@@ -332,7 +332,7 @@ static void do_machine_power_off(void * __unused)
332 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) { 332 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) {
333 smp_send_stop(); 333 smp_send_stop();
334 if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0) 334 if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0)
335 cpcmd(vmpoff_cmd, NULL, 0); 335 cpcmd(vmpoff_cmd, NULL, 0, NULL);
336 signal_processor(smp_processor_id(), 336 signal_processor(smp_processor_id(),
337 sigp_stop_and_store_status); 337 sigp_stop_and_store_status);
338 } 338 }
@@ -679,12 +679,14 @@ __cpu_disable(void)
679{ 679{
680 unsigned long flags; 680 unsigned long flags;
681 ec_creg_mask_parms cr_parms; 681 ec_creg_mask_parms cr_parms;
682 int cpu = smp_processor_id();
682 683
683 spin_lock_irqsave(&smp_reserve_lock, flags); 684 spin_lock_irqsave(&smp_reserve_lock, flags);
684 if (smp_cpu_reserved[smp_processor_id()] != 0) { 685 if (smp_cpu_reserved[cpu] != 0) {
685 spin_unlock_irqrestore(&smp_reserve_lock, flags); 686 spin_unlock_irqrestore(&smp_reserve_lock, flags);
686 return -EBUSY; 687 return -EBUSY;
687 } 688 }
689 cpu_clear(cpu, cpu_online_map);
688 690
689#ifdef CONFIG_PFAULT 691#ifdef CONFIG_PFAULT
690 /* Disable pfault pseudo page faults on this cpu. */ 692 /* Disable pfault pseudo page faults on this cpu. */
@@ -771,13 +773,24 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
771 773
772 *(lowcore_ptr[i]) = S390_lowcore; 774 *(lowcore_ptr[i]) = S390_lowcore;
773 lowcore_ptr[i]->async_stack = stack + (ASYNC_SIZE); 775 lowcore_ptr[i]->async_stack = stack + (ASYNC_SIZE);
774#ifdef CONFIG_CHECK_STACK
775 stack = __get_free_pages(GFP_KERNEL,0); 776 stack = __get_free_pages(GFP_KERNEL,0);
776 if (stack == 0ULL) 777 if (stack == 0ULL)
777 panic("smp_boot_cpus failed to allocate memory\n"); 778 panic("smp_boot_cpus failed to allocate memory\n");
778 lowcore_ptr[i]->panic_stack = stack + (PAGE_SIZE); 779 lowcore_ptr[i]->panic_stack = stack + (PAGE_SIZE);
780#ifndef __s390x__
781 if (MACHINE_HAS_IEEE) {
782 lowcore_ptr[i]->extended_save_area_addr =
783 (__u32) __get_free_pages(GFP_KERNEL,0);
784 if (lowcore_ptr[i]->extended_save_area_addr == 0)
785 panic("smp_boot_cpus failed to "
786 "allocate memory\n");
787 }
779#endif 788#endif
780 } 789 }
790#ifndef __s390x__
791 if (MACHINE_HAS_IEEE)
792 ctl_set_bit(14, 29); /* enable extended save area */
793#endif
781 set_prefix((u32)(unsigned long) lowcore_ptr[smp_processor_id()]); 794 set_prefix((u32)(unsigned long) lowcore_ptr[smp_processor_id()]);
782 795
783 for_each_cpu(cpu) 796 for_each_cpu(cpu)