for (i = 0; i < kimage->nr_segments; i++) {
pr_debug(" segment[%lu]: %016lx - %016lx, 0x%lx bytes, %lu pages\n",
i,
kimage->segment[i].mem,
kimage->segment[i].mem + kimage->segment[i].memsz,
(unsignedlong)kimage->segment[i].memsz,
(unsignedlong)kimage->segment[i].memsz / PAGE_SIZE);
}
}
#ifdef CONFIG_UHI_BOOT
staticint uhi_machine_kexec_prepare(struct kimage *kimage)
{ int i;
/* * In case DTB file is not passed to the new kernel, a flat device * tree will be created by kexec tool. It holds modified command * line for the new kernel.
*/ for (i = 0; i < kimage->nr_segments; i++) { struct fdt_header fdt;
if (kimage->segment[i].memsz <= sizeof(fdt)) continue;
if (copy_from_user(&fdt, kimage->segment[i].buf, sizeof(fdt))) continue;
/* * We know we were online, and there will be no incoming IPIs at * this point. Mark online again before rebooting so that the crash * analysis tool will see us correctly.
*/
set_cpu_online(smp_processor_id(), true);
/* Ensure remote CPUs observe that we're online before rebooting. */
smp_mb__after_atomic();
#ifdef CONFIG_SMP if (smp_processor_id() > 0) { /* * Instead of cpu_relax() or wait, this is needed for kexec * smp reboot. Kdump usually doesn't require an smp new * kernel, but kexec may do.
*/
kexec_nonboot_cpu();
/* NOTREACHED */
} #endif
/* * Make sure we get correct instructions written by the * machine_kexec() CPU.
*/
local_flush_icache_range(reboot_code_buffer,
reboot_code_buffer + relocate_new_kernel_size);
/* * The generic kexec code builds a page list with physical * addresses. they are directly accessible through KSEG0 (or * CKSEG0 or XPHYS if on 64bit system), hence the * phys_to_virt() call.
*/ for (ptr = &image->head; (entry = *ptr) && !(entry &IND_DONE);
ptr = (entry & IND_INDIRECTION) ?
phys_to_virt(entry & PAGE_MASK) : ptr + 1) { if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
*ptr & IND_DESTINATION)
*ptr = (unsignedlong) phys_to_virt(*ptr);
}
/* Mark offline BEFORE disabling local irq. */
set_cpu_online(smp_processor_id(), false);
/* * we do not want to be bothered.
*/
local_irq_disable();
printk("Will call new kernel at %08lx\n", image->start);
printk("Bye ...\n"); /* Make reboot code buffer available to the boot CPU. */
__flush_cache_all(); #ifdef CONFIG_SMP /* All secondary cpus now may jump to kexec_wait cycle */
relocated_kexec_smp_wait = reboot_code_buffer +
(void *)(kexec_smp_wait - relocate_new_kernel);
smp_wmb();
atomic_set(&kexec_ready_to_reboot, 1); #endif
kexec_reboot();
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.