[PATCH 0/2] Two patches for kexec for arm

Wang Nan wangnan0 at huawei.com
Wed Mar 19 22:36:31 EDT 2014


Hi Dave and Simon,

   Sorry for the long delay. We have discussed kexec on arm at January
   this year:
   http://lists.infradead.org/pipermail/kexec/2014-February/011031.html

   I rewrite 2 patches and tested on QEMU, both crash dump and normal
   kexec is okay (kernel is 3.10.33). Please check.

   The first patch makes initrd to be loaded at page boundary.

   The second patch passes kernel command line and initrd infomation
   through dtb.

   Without these two patches kexec, failed to work on arm.

   I tested using following commands:

Start qemu:
$ qemu-system-arm -kernel $KERNEL_PATH -M versatilepb -initrd $INITRD_PATH \
       -no-reboot -show-cursor  -vnc 0.0.0.0:0 -machine type=vexpress-a9 \
       -cpu cortex-a9 -m 512  --append "console=ttyAMA0 \
       ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=512M highres=off \
       rdinit=/sbin/init crashkernel=72M at 0x70000000" -serial stdio


Crash dump case:
$ kexec -p /zImage -d -t zImage --dtb=/vexpress-v2p-ca9-512m.dtb \
        --initrd=/initrd.cpio.gz \
	--command-line="maxcpus=1 console=ttyAMA0 highres=off \
	rdinit=/sbin/init"
$ echo c > /proc/sysrq-trigger


kexec case:
$ kexec -f /zImage -d -t zImage --dtb=/vexpress-v2p-ca9-512m.dtb \
        --initrd=initrd.cpio.gz --command-line="maxcpus=1 console=ttyAMA0 \
        highres=off rdinit=/sbin/init"


Kernel configuration is based on arch/arm/configs/vexpress_defconfig,
with CONFIG_KEXEC selected.

Because we use only 512m memory, related dtb must be modified (in crash
dump case, it is no problem because memory size is clamped by command
line, but it is essential in normal kexec case). I haven't
check atags.

vexpress-v2p-ca9-512m.dtb is generated by
arch/arm/boot/dts/vexpress-v2p-ca9.dts with following patch:

--- vexpress-v2p-ca9.dts	2014-02-25 13:06:34.000000000 +0800
+++ vexpress-v2p-ca9-512m.dts	2014-03-19 17:14:40.000000000 +0800
@@ -64,7 +64,7 @@
 
 	memory at 60000000 {
 		device_type = "memory";
-		reg = <0x60000000 0x40000000>;
+		reg = <0x60000000 0x20000000>;
 	};
 
 	clcd at 10020000 {

WangNan (2):
  kexec: align initrd when no --image-size passed
  kexec: pass initrd position in dtb

 kexec/arch/arm/kexec-zImage-arm.c | 88 +++++++++++++++++++++++++++------------
 1 file changed, 61 insertions(+), 27 deletions(-)

-- 
1.8.4




More information about the kexec mailing list