70765aa4bd
I have tweaked this patch slightly to handle an empty list of pages to relocate passed to relocate_new_kernel. And I have added ppc_md.machine_crash_shutdown. To keep up with the changes in the generic kexec infrastructure. From: Albert Herranz <albert_herranz@yahoo.es> The following patch adds support for kexec on the ppc32 platform. Non-OpenFirmware based platforms are likely to work directly without additional changes on the kernel side. The kexec-tools userland package may need to be slightly updated, though. For OpenFirmware based machines, additional work is still needed on the kernel side before kexec support is ready. Benjamin Herrenschmidt is kindly working on that part. In order for a ppc platform to use the kexec kernel services it must implement some ppc_md hooks. Otherwise, kexec will be explicitly disabled, as suggested by benh. There are 3+1 new ppc_md hooks that a platform supporting kexec may implement. Two of them are mandatory for kexec to work. See include/asm-ppc/machdep.h for details. - machine_kexec_prepare(image) This function is called to make any arrangements to the image before it is loaded. This hook _MUST_ be provided by a platform in order to activate kexec support for that platform. Otherwise, the platform is considered to not support kexec and the kexec_load system call will fail (that makes all existing platforms by default non-kexec'able). - machine_kexec_cleanup(image) This function is called to make any cleanups on image after the loaded image data it is freed. This hook is optional. A platform may or may not provide this hook. - machine_kexec(image) This function is called to perform the _actual_ kexec. This hook _MUST_ be provided by a platform in order to activate kexec support for that platform. If a platform provides machine_kexec_prepare but forgets to provide machine_kexec, a kexec will fall back to a reboot. A ready-to-use machine_kexec_simple() generic function is provided to, hopefully, simplify kexec adoption for embedded platforms. A platform may call this function from its specific machine_kexec hook, like this: void myplatform_kexec(struct kimage *image) { machine_kexec_simple(image); } - machine_shutdown() This function is called to perform any machine specific shutdowns, not already done by drivers. This hook is optional. A platform may or may not provide this hook. An example (trimmed) platform specific module for a platform supporting kexec through the existing machine_kexec_simple follows: /* ... */ #ifdef CONFIG_KEXEC int myplatform_kexec_prepare(struct kimage *image) { /* here, we can place additional preparations */ return 0; /* yes, we support kexec */ } void myplatform_kexec(struct kimage *image) { machine_kexec_simple(image); } #endif /* CONFIG_KEXEC */ /* ... */ void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { /* ... */ #ifdef CONFIG_KEXEC ppc_md.machine_kexec_prepare = myplatform_kexec_prepare; ppc_md.machine_kexec = myplatform_kexec; #endif /* CONFIG_KEXEC */ /* ... */ } The kexec ppc kernel support has been heavily tested on the GameCube Linux port, and, as reported in the fastboot mailing list, it has been tested too on a Moto 82xx ppc by Rick Richardson. Signed-off-by: Albert Herranz <albert_herranz@yahoo.es> Signed-off-by: Eric Biederman <ebiederm@xmission.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org> |
||
---|---|---|
.. | ||
8xx_immap.h | ||
8253pit.h | ||
a.out.h | ||
agp.h | ||
amigahw.h | ||
amigaints.h | ||
amigappc.h | ||
amigayle.h | ||
amipcmcia.h | ||
ans-lcd.h | ||
atomic.h | ||
backlight.h | ||
bitops.h | ||
bootinfo.h | ||
bootx.h | ||
bseip.h | ||
btext.h | ||
bug.h | ||
bugs.h | ||
byteorder.h | ||
cache.h | ||
cacheflush.h | ||
checksum.h | ||
commproc.h | ||
cpm2.h | ||
cputable.h | ||
cputime.h | ||
current.h | ||
dbdma.h | ||
delay.h | ||
div64.h | ||
dma-mapping.h | ||
dma.h | ||
elf.h | ||
errno.h | ||
fcntl.h | ||
floppy.h | ||
gg2.h | ||
gt64260_defs.h | ||
gt64260.h | ||
hardirq.h | ||
harrier.h | ||
hawk_defs.h | ||
hawk.h | ||
hdreg.h | ||
heathrow.h | ||
highmem.h | ||
hw_irq.h | ||
hydra.h | ||
i8259.h | ||
ibm4xx.h | ||
ibm44x.h | ||
ibm403.h | ||
ibm405.h | ||
ibm_ocp_pci.h | ||
ibm_ocp.h | ||
ide.h | ||
immap_85xx.h | ||
immap_cpm2.h | ||
io.h | ||
ioctl.h | ||
ioctls.h | ||
ipc.h | ||
ipcbuf.h | ||
ipic.h | ||
irq.h | ||
kexec.h | ||
keylargo.h | ||
kgdb.h | ||
kmap_types.h | ||
linkage.h | ||
local.h | ||
m48t35.h | ||
m8260_pci.h | ||
machdep.h | ||
macio.h | ||
mc146818rtc.h | ||
md.h | ||
mediabay.h | ||
mk48t59.h | ||
mman.h | ||
mmu_context.h | ||
mmu.h | ||
module.h | ||
mpc8xx.h | ||
mpc10x.h | ||
mpc52xx_psc.h | ||
mpc52xx.h | ||
mpc83xx.h | ||
mpc85xx.h | ||
mpc8260_pci9.h | ||
mpc8260.h | ||
msgbuf.h | ||
mv64x60_defs.h | ||
mv64x60.h | ||
namei.h | ||
nvram.h | ||
ocp_ids.h | ||
ocp.h | ||
of_device.h | ||
ohare.h | ||
open_pic.h | ||
page.h | ||
param.h | ||
parport.h | ||
pc_serial.h | ||
pci-bridge.h | ||
pci.h | ||
percpu.h | ||
perfmon.h | ||
pgalloc.h | ||
pgtable.h | ||
pmac_feature.h | ||
pmac_low_i2c.h | ||
pnp.h | ||
poll.h | ||
posix_types.h | ||
ppc4xx_dma.h | ||
ppc4xx_pic.h | ||
ppc_asm.h | ||
ppc_sys.h | ||
ppcboot.h | ||
prep_nvram.h | ||
processor.h | ||
prom.h | ||
ptrace.h | ||
raven.h | ||
reg_booke.h | ||
reg.h | ||
residual.h | ||
resource.h | ||
rheap.h | ||
rtc.h | ||
rwsem.h | ||
scatterlist.h | ||
seccomp.h | ||
sections.h | ||
segment.h | ||
semaphore.h | ||
sembuf.h | ||
serial.h | ||
setup.h | ||
shmbuf.h | ||
shmparam.h | ||
sigcontext.h | ||
siginfo.h | ||
signal.h | ||
smp.h | ||
socket.h | ||
sockios.h | ||
spinlock.h | ||
stat.h | ||
statfs.h | ||
string.h | ||
suspend.h | ||
system.h | ||
termbits.h | ||
termios.h | ||
thread_info.h | ||
time.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
todc.h | ||
topology.h | ||
traps.h | ||
types.h | ||
uaccess.h | ||
ucontext.h | ||
unaligned.h | ||
uninorth.h | ||
unistd.h | ||
user.h | ||
vga.h | ||
xmon.h | ||
xor.h | ||
xparameters.h | ||
zorro.h |