Lines Matching refs:pcpu

64 struct pcpu {  struct
73 static struct pcpu pcpu_devices[NR_CPUS]; argument
119 static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm) in pcpu_sigp_retry() argument
124 cc = __pcpu_sigp(pcpu->address, order, parm, NULL); in pcpu_sigp_retry()
133 static inline int pcpu_stopped(struct pcpu *pcpu) in pcpu_stopped() argument
137 if (__pcpu_sigp(pcpu->address, SIGP_SENSE, in pcpu_stopped()
143 static inline int pcpu_running(struct pcpu *pcpu) in pcpu_running() argument
145 if (__pcpu_sigp(pcpu->address, SIGP_SENSE_RUNNING, in pcpu_running()
155 static struct pcpu *pcpu_find_address(const struct cpumask *mask, u16 address) in pcpu_find_address()
165 static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) in pcpu_ec_call() argument
169 if (test_and_set_bit(ec_bit, &pcpu->ec_mask)) in pcpu_ec_call()
171 order = pcpu_running(pcpu) ? SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; in pcpu_ec_call()
172 pcpu_sigp_retry(pcpu, order, 0); in pcpu_ec_call()
178 static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) in pcpu_alloc_lowcore() argument
183 if (pcpu != &pcpu_devices[0]) { in pcpu_alloc_lowcore()
184 pcpu->lowcore = (struct _lowcore *) in pcpu_alloc_lowcore()
188 if (!pcpu->lowcore || !panic_stack || !async_stack) in pcpu_alloc_lowcore()
191 async_stack = pcpu->lowcore->async_stack - ASYNC_FRAME_OFFSET; in pcpu_alloc_lowcore()
192 panic_stack = pcpu->lowcore->panic_stack - PANIC_FRAME_OFFSET; in pcpu_alloc_lowcore()
194 lc = pcpu->lowcore; in pcpu_alloc_lowcore()
207 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, (u32)(unsigned long) lc); in pcpu_alloc_lowcore()
210 if (pcpu != &pcpu_devices[0]) { in pcpu_alloc_lowcore()
213 free_pages((unsigned long) pcpu->lowcore, LC_ORDER); in pcpu_alloc_lowcore()
220 static void pcpu_free_lowcore(struct pcpu *pcpu) in pcpu_free_lowcore() argument
222 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, 0); in pcpu_free_lowcore()
223 lowcore_ptr[pcpu - pcpu_devices] = NULL; in pcpu_free_lowcore()
224 vdso_free_per_cpu(pcpu->lowcore); in pcpu_free_lowcore()
225 if (pcpu == &pcpu_devices[0]) in pcpu_free_lowcore()
227 free_page(pcpu->lowcore->panic_stack-PANIC_FRAME_OFFSET); in pcpu_free_lowcore()
228 free_pages(pcpu->lowcore->async_stack-ASYNC_FRAME_OFFSET, ASYNC_ORDER); in pcpu_free_lowcore()
229 free_pages((unsigned long) pcpu->lowcore, LC_ORDER); in pcpu_free_lowcore()
234 static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu) in pcpu_prepare_secondary() argument
236 struct _lowcore *lc = pcpu->lowcore; in pcpu_prepare_secondary()
254 static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk) in pcpu_attach_task() argument
256 struct _lowcore *lc = pcpu->lowcore; in pcpu_attach_task()
268 static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data) in pcpu_start_fn() argument
270 struct _lowcore *lc = pcpu->lowcore; in pcpu_start_fn()
276 pcpu_sigp_retry(pcpu, SIGP_RESTART, 0); in pcpu_start_fn()
282 static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), in pcpu_delegate() argument
285 struct _lowcore *lc = lowcore_ptr[pcpu - pcpu_devices]; in pcpu_delegate()
289 if (pcpu->address == source_cpu) in pcpu_delegate()
292 pcpu_sigp_retry(pcpu, SIGP_STOP, 0); in pcpu_delegate()
303 : : "d" (pcpu->address), "d" (source_cpu), in pcpu_delegate()
340 struct pcpu *pcpu; in smp_call_online_cpu() local
343 pcpu = pcpu_find_address(cpu_online_mask, stap()); in smp_call_online_cpu()
344 if (!pcpu) in smp_call_online_cpu()
346 pcpu = pcpu_devices + cpumask_first(cpu_online_mask); in smp_call_online_cpu()
347 pcpu_delegate(pcpu, func, data, (unsigned long) restart_stack); in smp_call_online_cpu()
395 struct pcpu *pcpu = pcpu_devices + cpu; in smp_emergency_stop() local
396 set_bit(ec_stop_cpu, &pcpu->ec_mask); in smp_emergency_stop()
397 while (__pcpu_sigp(pcpu->address, SIGP_EMERGENCY_SIGNAL, in smp_emergency_stop()
433 struct pcpu *pcpu = pcpu_devices + cpu; in smp_send_stop() local
434 pcpu_sigp_retry(pcpu, SIGP_STOP, 0); in smp_send_stop()
435 while (!pcpu_stopped(pcpu)) in smp_send_stop()
626 struct pcpu *pcpu; in smp_store_status() local
628 pcpu = pcpu_devices + cpu; in smp_store_status()
629 if (__pcpu_sigp_relax(pcpu->address, SIGP_STOP_AND_STORE_STATUS, in smp_store_status()
634 vx_sa = __pa(pcpu->lowcore->vector_save_area_addr); in smp_store_status()
635 __pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS, in smp_store_status()
679 struct pcpu *pcpu; in __smp_rescan_cpus() local
694 pcpu = pcpu_devices + cpu; in __smp_rescan_cpus()
695 pcpu->address = address + j; in __smp_rescan_cpus()
696 pcpu->state = in __smp_rescan_cpus()
794 struct pcpu *pcpu; in __cpu_up() local
797 pcpu = pcpu_devices + cpu; in __cpu_up()
798 if (pcpu->state != CPU_STATE_CONFIGURED) in __cpu_up()
815 rc = pcpu_alloc_lowcore(pcpu, cpu); in __cpu_up()
818 pcpu_prepare_secondary(pcpu, cpu); in __cpu_up()
819 pcpu_attach_task(pcpu, tidle); in __cpu_up()
820 pcpu_start_fn(pcpu, smp_start_secondary, NULL); in __cpu_up()
859 struct pcpu *pcpu; in __cpu_die() local
862 pcpu = pcpu_devices + cpu; in __cpu_die()
863 while (!pcpu_stopped(pcpu)) in __cpu_die()
865 pcpu_free_lowcore(pcpu); in __cpu_die()
906 struct pcpu *pcpu = pcpu_devices; in smp_prepare_boot_cpu() local
908 pcpu->state = CPU_STATE_CONFIGURED; in smp_prepare_boot_cpu()
909 pcpu->address = stap(); in smp_prepare_boot_cpu()
910 pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix(); in smp_prepare_boot_cpu()
954 struct pcpu *pcpu; in cpu_configure_store() local
973 pcpu = pcpu_devices + cpu; in cpu_configure_store()
977 if (pcpu->state != CPU_STATE_CONFIGURED) in cpu_configure_store()
979 rc = sclp_cpu_deconfigure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
985 pcpu[i].state = CPU_STATE_STANDBY; in cpu_configure_store()
992 if (pcpu->state != CPU_STATE_STANDBY) in cpu_configure_store()
994 rc = sclp_cpu_configure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1000 pcpu[i].state = CPU_STATE_CONFIGURED; in cpu_configure_store()