Lines Matching refs:pcpu

73 struct pcpu {  struct
83 static struct pcpu pcpu_devices[NR_CPUS]; argument
132 static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm) in pcpu_sigp_retry() argument
137 cc = __pcpu_sigp(pcpu->address, order, parm, NULL); in pcpu_sigp_retry()
146 static inline int pcpu_stopped(struct pcpu *pcpu) in pcpu_stopped() argument
150 if (__pcpu_sigp(pcpu->address, SIGP_SENSE, in pcpu_stopped()
156 static inline int pcpu_running(struct pcpu *pcpu) in pcpu_running() argument
158 if (__pcpu_sigp(pcpu->address, SIGP_SENSE_RUNNING, in pcpu_running()
168 static struct pcpu *pcpu_find_address(const struct cpumask *mask, u16 address) in pcpu_find_address()
178 static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) in pcpu_ec_call() argument
182 if (test_and_set_bit(ec_bit, &pcpu->ec_mask)) in pcpu_ec_call()
184 order = pcpu_running(pcpu) ? SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; in pcpu_ec_call()
185 pcpu->ec_clk = get_tod_clock_fast(); in pcpu_ec_call()
186 pcpu_sigp_retry(pcpu, order, 0); in pcpu_ec_call()
189 static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) in pcpu_alloc_lowcore() argument
194 if (pcpu != &pcpu_devices[0]) { in pcpu_alloc_lowcore()
195 pcpu->lowcore = (struct lowcore *) in pcpu_alloc_lowcore()
198 if (!pcpu->lowcore || !nodat_stack) in pcpu_alloc_lowcore()
201 nodat_stack = pcpu->lowcore->nodat_stack - STACK_INIT_OFFSET; in pcpu_alloc_lowcore()
206 lc = pcpu->lowcore; in pcpu_alloc_lowcore()
220 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, (u32)(unsigned long) lc); in pcpu_alloc_lowcore()
228 if (pcpu != &pcpu_devices[0]) { in pcpu_alloc_lowcore()
230 free_pages((unsigned long) pcpu->lowcore, LC_ORDER); in pcpu_alloc_lowcore()
235 static void pcpu_free_lowcore(struct pcpu *pcpu) in pcpu_free_lowcore() argument
239 nodat_stack = pcpu->lowcore->nodat_stack - STACK_INIT_OFFSET; in pcpu_free_lowcore()
240 async_stack = pcpu->lowcore->async_stack - STACK_INIT_OFFSET; in pcpu_free_lowcore()
241 lowcore = (unsigned long) pcpu->lowcore; in pcpu_free_lowcore()
243 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, 0); in pcpu_free_lowcore()
244 lowcore_ptr[pcpu - pcpu_devices] = NULL; in pcpu_free_lowcore()
245 vdso_free_per_cpu(pcpu->lowcore); in pcpu_free_lowcore()
246 nmi_free_per_cpu(pcpu->lowcore); in pcpu_free_lowcore()
248 if (pcpu == &pcpu_devices[0]) in pcpu_free_lowcore()
254 static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu) in pcpu_prepare_secondary() argument
256 struct lowcore *lc = pcpu->lowcore; in pcpu_prepare_secondary()
277 static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk) in pcpu_attach_task() argument
279 struct lowcore *lc = pcpu->lowcore; in pcpu_attach_task()
294 static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data) in pcpu_start_fn() argument
296 struct lowcore *lc = pcpu->lowcore; in pcpu_start_fn()
302 pcpu_sigp_retry(pcpu, SIGP_RESTART, 0); in pcpu_start_fn()
313 static void __no_sanitize_address pcpu_delegate(struct pcpu *pcpu, in pcpu_delegate() argument
317 struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices]; in pcpu_delegate()
321 if (pcpu->address == source_cpu) in pcpu_delegate()
324 pcpu_sigp_retry(pcpu, SIGP_STOP, 0); in pcpu_delegate()
336 : : "d" (pcpu->address), "d" (source_cpu), in pcpu_delegate()
367 struct pcpu *pcpu; in smp_call_online_cpu() local
370 pcpu = pcpu_find_address(cpu_online_mask, stap()); in smp_call_online_cpu()
371 if (!pcpu) in smp_call_online_cpu()
373 pcpu = pcpu_devices + cpumask_first(cpu_online_mask); in smp_call_online_cpu()
374 pcpu_delegate(pcpu, func, data, (unsigned long) restart_stack); in smp_call_online_cpu()
438 struct pcpu *pcpu = pcpu_devices + cpu; in smp_emergency_stop() local
439 set_bit(ec_stop_cpu, &pcpu->ec_mask); in smp_emergency_stop()
440 while (__pcpu_sigp(pcpu->address, SIGP_EMERGENCY_SIGNAL, in smp_emergency_stop()
578 struct pcpu *pcpu = pcpu_devices + cpu; in smp_store_status() local
581 pa = __pa(&pcpu->lowcore->floating_pt_save_area); in smp_store_status()
582 if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_STATUS_AT_ADDRESS, in smp_store_status()
587 pa = __pa(pcpu->lowcore->mcesad & MCESA_ORIGIN_MASK); in smp_store_status()
589 pa |= pcpu->lowcore->mcesad & MCESA_LC_MASK; in smp_store_status()
590 if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS, in smp_store_status()
729 struct pcpu *pcpu; in __smp_rescan_cpus() local
744 pcpu = pcpu_devices + cpu; in __smp_rescan_cpus()
745 pcpu->address = address + j; in __smp_rescan_cpus()
746 pcpu->state = in __smp_rescan_cpus()
852 struct pcpu *pcpu; in __cpu_up() local
855 pcpu = pcpu_devices + cpu; in __cpu_up()
856 if (pcpu->state != CPU_STATE_CONFIGURED) in __cpu_up()
873 rc = pcpu_alloc_lowcore(pcpu, cpu); in __cpu_up()
876 pcpu_prepare_secondary(pcpu, cpu); in __cpu_up()
877 pcpu_attach_task(pcpu, tidle); in __cpu_up()
878 pcpu_start_fn(pcpu, smp_start_secondary, NULL); in __cpu_up()
915 struct pcpu *pcpu; in __cpu_die() local
918 pcpu = pcpu_devices + cpu; in __cpu_die()
919 while (!pcpu_stopped(pcpu)) in __cpu_die()
921 pcpu_free_lowcore(pcpu); in __cpu_die()
959 struct pcpu *pcpu = pcpu_devices; in smp_prepare_boot_cpu() local
962 pcpu->state = CPU_STATE_CONFIGURED; in smp_prepare_boot_cpu()
963 pcpu->lowcore = (struct lowcore *)(unsigned long) store_prefix(); in smp_prepare_boot_cpu()
1006 struct pcpu *pcpu; in cpu_configure_store() local
1025 pcpu = pcpu_devices + cpu; in cpu_configure_store()
1029 if (pcpu->state != CPU_STATE_CONFIGURED) in cpu_configure_store()
1031 rc = sclp_core_deconfigure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1037 pcpu[i].state = CPU_STATE_STANDBY; in cpu_configure_store()
1044 if (pcpu->state != CPU_STATE_STANDBY) in cpu_configure_store()
1046 rc = sclp_core_configure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1052 pcpu[i].state = CPU_STATE_CONFIGURED; in cpu_configure_store()