Lines Matching refs:pcpu

66 struct pcpu {  struct
75 static struct pcpu pcpu_devices[NR_CPUS]; argument
121 static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm) in pcpu_sigp_retry() argument
126 cc = __pcpu_sigp(pcpu->address, order, parm, NULL); in pcpu_sigp_retry()
135 static inline int pcpu_stopped(struct pcpu *pcpu) in pcpu_stopped() argument
139 if (__pcpu_sigp(pcpu->address, SIGP_SENSE, in pcpu_stopped()
145 static inline int pcpu_running(struct pcpu *pcpu) in pcpu_running() argument
147 if (__pcpu_sigp(pcpu->address, SIGP_SENSE_RUNNING, in pcpu_running()
157 static struct pcpu *pcpu_find_address(const struct cpumask *mask, u16 address) in pcpu_find_address()
167 static void pcpu_ec_call(struct pcpu *pcpu, int ec_bit) in pcpu_ec_call() argument
171 if (test_and_set_bit(ec_bit, &pcpu->ec_mask)) in pcpu_ec_call()
173 order = pcpu_running(pcpu) ? SIGP_EXTERNAL_CALL : SIGP_EMERGENCY_SIGNAL; in pcpu_ec_call()
174 pcpu_sigp_retry(pcpu, order, 0); in pcpu_ec_call()
180 static int pcpu_alloc_lowcore(struct pcpu *pcpu, int cpu) in pcpu_alloc_lowcore() argument
185 if (pcpu != &pcpu_devices[0]) { in pcpu_alloc_lowcore()
186 pcpu->lowcore = (struct _lowcore *) in pcpu_alloc_lowcore()
190 if (!pcpu->lowcore || !panic_stack || !async_stack) in pcpu_alloc_lowcore()
193 async_stack = pcpu->lowcore->async_stack - ASYNC_FRAME_OFFSET; in pcpu_alloc_lowcore()
194 panic_stack = pcpu->lowcore->panic_stack - PANIC_FRAME_OFFSET; in pcpu_alloc_lowcore()
196 lc = pcpu->lowcore; in pcpu_alloc_lowcore()
209 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, (u32)(unsigned long) lc); in pcpu_alloc_lowcore()
212 if (pcpu != &pcpu_devices[0]) { in pcpu_alloc_lowcore()
215 free_pages((unsigned long) pcpu->lowcore, LC_ORDER); in pcpu_alloc_lowcore()
222 static void pcpu_free_lowcore(struct pcpu *pcpu) in pcpu_free_lowcore() argument
224 pcpu_sigp_retry(pcpu, SIGP_SET_PREFIX, 0); in pcpu_free_lowcore()
225 lowcore_ptr[pcpu - pcpu_devices] = NULL; in pcpu_free_lowcore()
226 vdso_free_per_cpu(pcpu->lowcore); in pcpu_free_lowcore()
227 if (pcpu == &pcpu_devices[0]) in pcpu_free_lowcore()
229 free_page(pcpu->lowcore->panic_stack-PANIC_FRAME_OFFSET); in pcpu_free_lowcore()
230 free_pages(pcpu->lowcore->async_stack-ASYNC_FRAME_OFFSET, ASYNC_ORDER); in pcpu_free_lowcore()
231 free_pages((unsigned long) pcpu->lowcore, LC_ORDER); in pcpu_free_lowcore()
236 static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu) in pcpu_prepare_secondary() argument
238 struct _lowcore *lc = pcpu->lowcore; in pcpu_prepare_secondary()
256 static void pcpu_attach_task(struct pcpu *pcpu, struct task_struct *tsk) in pcpu_attach_task() argument
258 struct _lowcore *lc = pcpu->lowcore; in pcpu_attach_task()
272 static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data) in pcpu_start_fn() argument
274 struct _lowcore *lc = pcpu->lowcore; in pcpu_start_fn()
280 pcpu_sigp_retry(pcpu, SIGP_RESTART, 0); in pcpu_start_fn()
286 static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), in pcpu_delegate() argument
289 struct _lowcore *lc = lowcore_ptr[pcpu - pcpu_devices]; in pcpu_delegate()
293 if (pcpu->address == source_cpu) in pcpu_delegate()
296 pcpu_sigp_retry(pcpu, SIGP_STOP, 0); in pcpu_delegate()
307 : : "d" (pcpu->address), "d" (source_cpu), in pcpu_delegate()
344 struct pcpu *pcpu; in smp_call_online_cpu() local
347 pcpu = pcpu_find_address(cpu_online_mask, stap()); in smp_call_online_cpu()
348 if (!pcpu) in smp_call_online_cpu()
350 pcpu = pcpu_devices + cpumask_first(cpu_online_mask); in smp_call_online_cpu()
351 pcpu_delegate(pcpu, func, data, (unsigned long) restart_stack); in smp_call_online_cpu()
402 struct pcpu *pcpu = pcpu_devices + cpu; in smp_emergency_stop() local
403 set_bit(ec_stop_cpu, &pcpu->ec_mask); in smp_emergency_stop()
404 while (__pcpu_sigp(pcpu->address, SIGP_EMERGENCY_SIGNAL, in smp_emergency_stop()
440 struct pcpu *pcpu = pcpu_devices + cpu; in smp_send_stop() local
441 pcpu_sigp_retry(pcpu, SIGP_STOP, 0); in smp_send_stop()
442 while (!pcpu_stopped(pcpu)) in smp_send_stop()
572 struct pcpu *pcpu; in smp_store_status() local
574 pcpu = pcpu_devices + cpu; in smp_store_status()
575 if (__pcpu_sigp_relax(pcpu->address, SIGP_STOP_AND_STORE_STATUS, in smp_store_status()
580 vx_sa = __pa(pcpu->lowcore->vector_save_area_addr); in smp_store_status()
581 __pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS, in smp_store_status()
699 struct pcpu *pcpu; in __smp_rescan_cpus() local
714 pcpu = pcpu_devices + cpu; in __smp_rescan_cpus()
715 pcpu->address = address + j; in __smp_rescan_cpus()
716 pcpu->state = in __smp_rescan_cpus()
810 struct pcpu *pcpu; in __cpu_up() local
813 pcpu = pcpu_devices + cpu; in __cpu_up()
814 if (pcpu->state != CPU_STATE_CONFIGURED) in __cpu_up()
831 rc = pcpu_alloc_lowcore(pcpu, cpu); in __cpu_up()
834 pcpu_prepare_secondary(pcpu, cpu); in __cpu_up()
835 pcpu_attach_task(pcpu, tidle); in __cpu_up()
836 pcpu_start_fn(pcpu, smp_start_secondary, NULL); in __cpu_up()
875 struct pcpu *pcpu; in __cpu_die() local
878 pcpu = pcpu_devices + cpu; in __cpu_die()
879 while (!pcpu_stopped(pcpu)) in __cpu_die()
881 pcpu_free_lowcore(pcpu); in __cpu_die()
923 struct pcpu *pcpu = pcpu_devices; in smp_prepare_boot_cpu() local
925 pcpu->state = CPU_STATE_CONFIGURED; in smp_prepare_boot_cpu()
926 pcpu->address = stap(); in smp_prepare_boot_cpu()
927 pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix(); in smp_prepare_boot_cpu()
971 struct pcpu *pcpu; in cpu_configure_store() local
990 pcpu = pcpu_devices + cpu; in cpu_configure_store()
994 if (pcpu->state != CPU_STATE_CONFIGURED) in cpu_configure_store()
996 rc = sclp_core_deconfigure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1002 pcpu[i].state = CPU_STATE_STANDBY; in cpu_configure_store()
1009 if (pcpu->state != CPU_STATE_STANDBY) in cpu_configure_store()
1011 rc = sclp_core_configure(pcpu->address >> smp_cpu_mt_shift); in cpu_configure_store()
1017 pcpu[i].state = CPU_STATE_CONFIGURED; in cpu_configure_store()