smp.c (cf1489984641369611556bf00c48f945c77bcf02) smp.c (d768bd892fc8f066cd3aa000eb1867bcf32db0ee)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * SMP related functions
4 *
5 * Copyright IBM Corp. 1999, 2012
6 * Author(s): Denis Joseph Barrow,
7 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
8 * Heiko Carstens <heiko.carstens@de.ibm.com>,

--- 305 unchanged lines hidden (view full) ---

314 func(data); /* should not return */
315 /* Stop target cpu (if func returns this stops the current cpu). */
316 pcpu_sigp_retry(pcpu, SIGP_STOP, 0);
317 /* Restart func on the target cpu and stop the current cpu. */
318 mem_assign_absolute(lc->restart_stack, stack);
319 mem_assign_absolute(lc->restart_fn, (unsigned long) func);
320 mem_assign_absolute(lc->restart_data, (unsigned long) data);
321 mem_assign_absolute(lc->restart_source, source_cpu);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * SMP related functions
4 *
5 * Copyright IBM Corp. 1999, 2012
6 * Author(s): Denis Joseph Barrow,
7 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
8 * Heiko Carstens <heiko.carstens@de.ibm.com>,

--- 305 unchanged lines hidden (view full) ---

314 func(data); /* should not return */
315 /* Stop target cpu (if func returns this stops the current cpu). */
316 pcpu_sigp_retry(pcpu, SIGP_STOP, 0);
317 /* Restart func on the target cpu and stop the current cpu. */
318 mem_assign_absolute(lc->restart_stack, stack);
319 mem_assign_absolute(lc->restart_fn, (unsigned long) func);
320 mem_assign_absolute(lc->restart_data, (unsigned long) data);
321 mem_assign_absolute(lc->restart_source, source_cpu);
322 __bpon();
322 asm volatile(
323 "0: sigp 0,%0,%2 # sigp restart to target cpu\n"
324 " brc 2,0b # busy, try again\n"
325 "1: sigp 0,%1,%3 # sigp stop to current cpu\n"
326 " brc 2,1b # busy, try again\n"
327 : : "d" (pcpu->address), "d" (source_cpu),
328 "K" (SIGP_RESTART), "K" (SIGP_STOP)
329 : "0", "1", "cc");

--- 568 unchanged lines hidden (view full) ---

898 pcpu_free_lowcore(pcpu);
899 cpumask_clear_cpu(cpu, mm_cpumask(&init_mm));
900 cpumask_clear_cpu(cpu, &init_mm.context.cpu_attach_mask);
901}
902
903void __noreturn cpu_die(void)
904{
905 idle_task_exit();
323 asm volatile(
324 "0: sigp 0,%0,%2 # sigp restart to target cpu\n"
325 " brc 2,0b # busy, try again\n"
326 "1: sigp 0,%1,%3 # sigp stop to current cpu\n"
327 " brc 2,1b # busy, try again\n"
328 : : "d" (pcpu->address), "d" (source_cpu),
329 "K" (SIGP_RESTART), "K" (SIGP_STOP)
330 : "0", "1", "cc");

--- 568 unchanged lines hidden (view full) ---

899 pcpu_free_lowcore(pcpu);
900 cpumask_clear_cpu(cpu, mm_cpumask(&init_mm));
901 cpumask_clear_cpu(cpu, &init_mm.context.cpu_attach_mask);
902}
903
904void __noreturn cpu_die(void)
905{
906 idle_task_exit();
907 __bpon();
906 pcpu_sigp_retry(pcpu_devices + smp_processor_id(), SIGP_STOP, 0);
907 for (;;) ;
908}
909
910#endif /* CONFIG_HOTPLUG_CPU */
911
912void __init smp_fill_possible_mask(void)
913{

--- 267 unchanged lines hidden ---
908 pcpu_sigp_retry(pcpu_devices + smp_processor_id(), SIGP_STOP, 0);
909 for (;;) ;
910}
911
912#endif /* CONFIG_HOTPLUG_CPU */
913
914void __init smp_fill_possible_mask(void)
915{

--- 267 unchanged lines hidden ---