Lines Matching +full:can +full:- +full:secondary
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2004-2005, IBM Corp.
35 #include <asm/crashdump-ppc64.h>
51 for (i = 0; i < image->nr_segments; i++) in machine_kexec_prepare()
52 if (image->segment[i].mem < __pa(_end)) in machine_kexec_prepare()
53 return -ETXTBSY; in machine_kexec_prepare()
57 basep = of_get_property(node, "linux,tce-base", NULL); in machine_kexec_prepare()
58 sizep = of_get_property(node, "linux,tce-size", NULL); in machine_kexec_prepare()
65 for (i = 0; i < image->nr_segments; i++) { in machine_kexec_prepare()
66 begin = image->segment[i].mem; in machine_kexec_prepare()
67 end = begin + image->segment[i].memsz; in machine_kexec_prepare()
71 return -ETXTBSY; in machine_kexec_prepare()
116 long i, nr_segments = image->nr_segments; in kexec_copy_flush()
120 memcpy(ranges, image->segment, sizeof(ranges)); in kexec_copy_flush()
128 copy_segments(image->head); in kexec_copy_flush()
149 get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; in kexec_smp_down()
155 * Now every CPU has IRQs off, we can clear out any pending in kexec_smp_down()
169 int my_cpu, i, notified=-1; in kexec_prepare_cpus_wait()
177 * start-cpu, but somehow that CPU doesn't write callin_cpu_map[] in in kexec_prepare_cpus_wait()
179 * stuff, the secondary will start up (paca_ptrs[]->cpu_start was in kexec_prepare_cpus_wait()
181 * If the platform supports smp_ops->take_timebase(), the secondary CPU in kexec_prepare_cpus_wait()
183 * secondary will continue on and try to online itself/idle/etc. If it in kexec_prepare_cpus_wait()
185 * possible-but-not-online-but-should-be CPUs and chaperone them into in kexec_prepare_cpus_wait()
192 while (paca_ptrs[i]->kexec_state < wait_state) { in kexec_prepare_cpus_wait()
197 i, paca_ptrs[i]->hw_cpu_id, wait_state); in kexec_prepare_cpus_wait()
207 * the device tree and assume primary threads are online and query secondary
209 * threads, they will be stuck. However, we also online secondary threads as we
210 * may be using 'cede offline'. In this case RTAS doesn't see the secondary
211 * threads as offline -- and again, these CPUs will be stuck.
213 * So, we online all CPUs that should be running, including secondary threads.
236 get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; in kexec_prepare_cpus()
260 * move the secondarys to us so that we can copy in kexec_prepare_cpus()
261 * the new kernel 0-0x100 safely in kexec_prepare_cpus()
280 * We need to make sure that this is 16384-byte aligned due to the
337 current_thread_info()->flags = 0; in default_machine_kexec()
338 current_thread_info()->preempt_count = HARDIRQ_OFFSET; in default_machine_kexec()
342 * non-static data. in default_machine_kexec()
350 if (is_secure_guest() && !(image->preserve_context || in default_machine_kexec()
351 image->type == KEXEC_TYPE_CRASH)) { in default_machine_kexec()
363 * unregistered so there is not much we can do about it here. in default_machine_kexec()
368 * using Radix page tables or we are not in an LPAR since we can in default_machine_kexec()
371 * In an LPAR, we keep the MMU on otherwise we can't access beyond in default_machine_kexec()
384 * a toc is easier in C, so pass in what we can. in default_machine_kexec()
386 kexec_sequence(&kexec_stack, image->start, image, in default_machine_kexec()
387 page_address(image->control_code_page), in default_machine_kexec()
398 .name = "linux,htab-base",
404 .name = "linux,htab-size",
415 return -ENODEV; in export_htab_values()
419 return -ENODEV; in export_htab_values()
421 /* remove any stale properties so ours can be found */ in export_htab_values()
438 * add_node_props - Reads node properties from device node structure and add
452 return -EINVAL; in add_node_props()
455 ret = fdt_setprop(fdt, node_offset, pp->name, pp->value, pp->length); in add_node_props()
457 pr_err("Unable to add %s property: %s\n", pp->name, fdt_strerror(ret)); in add_node_props()
465 * update_cpus_node - Update cpus node of flattened device tree using of_root
483 if (cpus_offset < 0 && cpus_offset != -FDT_ERR_NOTFOUND) { in update_cpus_node()
490 /* Delete sub-nodes of /cpus node with device_type == "cpu" */ in update_cpus_node()
494 if (!prop || strcmp(prop->data, "cpu")) { in update_cpus_node()
501 pr_err("Failed to delete a cpus sub-node: %s\n", fdt_strerror(ret)); in update_cpus_node()
515 return -EINVAL; in update_cpus_node()
518 /* Add all /cpus sub-nodes of device_type == "cpu" to FDT */ in update_cpus_node()
527 cpus_subnode_offset = fdt_add_subnode(fdt, cpus_offset, dn->full_name); in update_cpus_node()
529 pr_err("Unable to add %s subnode: %s\n", dn->full_name, in update_cpus_node()