kexec: kexec.ppc
PATCH 14/14 kexec: kexec.ppc
Finally the ppc port of kexec. So far it has
not been tested on anything except a gamecube but it should work in general.
Little things like fleshing out machine_shutdown still need to happen though.
arch/ppc/Kconfig +20 -0
@@ -1220,6 +1220,26 @@ depends on SERIAL_SICC && UART0_TTYS1 default y +config KEXEC + bool "kexec system call (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + kexec is a system call that implements the ability to shutdown your + current kernel, and to start another kernel. It is like a reboot + but it is indepedent of the system firmware. And like a reboot + you can start any kernel with it, not just Linux. + + The name comes from the similiarity to the exec system call. + + It is an ongoing process to be certain the hardware in a machine + is properly shutdown, so do not be surprised if this code does not + initially work for you. It may help to enable device hotplugging + support. As of this writing the exact hardware interface is + strongly in flux, so no good recommendation can be made. + + In the GAMECUBE implementation, kexec allows you to load and + run DOL files, including kernel and homebrew DOLs. + endmenu source "lib/Kconfig"
arch/ppc/kernel/Makefile +1 -0
@@ -24,6 +24,7 @@ obj-$(CONFIG_SMP) += smp.o smp-tbsync.o obj-$(CONFIG_TAU) += temp.o obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o +obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o ifdef CONFIG_MATH_EMULATION obj-$(CONFIG_8xx) += softemu8xx.o
arch/ppc/kernel/machine_kexec.c +132 -0
132 lines not on this page · raw message
arch/ppc/kernel/misc.S +1 -1
@@ -1449,7 +1449,7 @@ .long sys_mq_timedreceive /* 265 */ .long sys_mq_notify .long sys_mq_getsetattr - .long sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .long sys_kexec_load .long sys_perfctr_info .long sys_vperfctr_open /* 270 */ .long sys_vperfctr_control
arch/ppc/kernel/relocate_kernel.S +127 -0
127 lines not on this page · raw message
include/asm-ppc/kexec.h +26 -0
@@ -0,0 +1,26 @@ +#ifndef _PPC_KEXEC_H +#define _PPC_KEXEC_H + +#ifdef CONFIG_KEXEC +/* +* KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. +* I.e. Maximum page that is mapped directly into kernel memory, +* and kmap is not required. +* +* Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct +* calculation for the amount of memory directly mappable into the +* kernel memory space. +*/ + +/* Maximum physical address we can use pages from */ +#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) +/* Maximum address we can reach in physical address mode */ +#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL) +/* Maximum address we can use for the control code buffer */ +#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE + +#define KEXEC_CONTROL_CODE_SIZE 4096 + +#endif /* CONFIG_KEXEC */ + +#endif /* _PPC_KEXEC_H */