My kexec test patches for OpenBMC
Joel Stanley
joel at jms.id.au
Wed Feb 24 19:03:56 AEDT 2021
On Fri, 19 Feb 2021 at 00:53, Bruce Mitchell <Bruce.Mitchell at ibm.com> wrote:
>
> Hello Joel,
>
> Per your request yesterday, I am emailing the details of my kexec/kdump development efforts.
Thanks. Here's what I tested:
https://github.com/shenki/linux/commits/ast2600-kexec
>
> I am running QEMU
>
> qemu-system-arm --version
> QEMU emulator version 5.2.0 (v5.1.0-3479-g27ca38d3db)
That looks fine. I'm using cedric's tree, but anything that will boot
your kernel is fine.
> qemu-system-arm -d cpu_reset -M tacoma-bmc -kernel /tmp/tmp.y2fpdAXM1h.kernel -dtb /tmp/tmp.BWkadwNbTf.dtb -initrd /tmp/tmp.jRpFbzfpBs.initrd -drive file=obmc-phosphor-image-witherspoon-tacoma.wic,if=sd,format=raw,index=2 -net nic -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostname=qemu -nographic -append "crashkernel=64M console=ttyS4,115200n8 rootwait root=PARTLABEL=rofs-a"
You could simplify your qemu setup if you want. Here's how I tested:
$ qemu-system-arm -M tacoma-bmc -nographic -net nic -nic
user,hostfwd=::2222-:22,tftp=/srv/tftp/ -kernel
aspeed-g5-dev/arch/arm/boot/zImage -dtb
aspeed-g5-dev/arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dtb -initrd
~/dev/kernels/misc/rootfs.cpio.xz
This uses a small initramfs with the kexec utility, and has a copy of
the kernel, initrd and dtb inside to make testing easy.
Or, if you want, you can copy files into the system over the ssh port:
I have this in my ~/.ssh/config:
Host qemu
Hostname localhost
Port 2222
User root
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
And then you can use scp like this:
scp aspeed-g5-dev/arch/arm/boot/zImage
aspeed-g5-dev/arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dtb
/home/joel/dev/kernels/misc/rootfs.cpio.xz qemu:
> From OpenBMC within QEMU I am using the following to test kexec
>
> kexec -d -l /home/kexec_files/tmp.y2fpdAXM1h.kernel --initrd=/home/kexec_files/tmp.jRpFbzfpBs.initrd --dtb=/home/kexec_files/tmp.BWkadwNbTf.dtb --append="earlycon console=ttyS4,115200n8 rootwait root=PARTLABEL=rofs-a 1 maxcpus=1 reset_devices"
> kexec -d -e
Here's how I was running it:
# kexec -l zImage --dtb aspeed-bmc-opp-tacoma.dtb --initrd rootfs.cpio.xz
# kexec -e
I haven't set a new command line, so it uses the command line from the
device tree (console=ttyS4,115200n8).
With my patch we will not get the secondary CPU:
[ 0.039517] ASPEED AST2600 rev A1 (05010303)
[ 0.042030] smp: Bringing up secondary CPUs ...
[ 1.163950] CPU1: failed to come online
[ 1.167999] smp: Brought up 1 node, 1 CPU
[ 1.168164] SMP: Total of 1 processors activated (2250.00 BogoMIPS).
That should be the next step in working on the kexec patches. We want
the secondary CPU to be in a state such that the new kernel can take
control as it would in a firmware boot.
Note that this didn't require any changes to the system beyond the
kernel patch. I'm using the same defconfig as we have in the tree.
Cheers,
Joel
More information about the openbmc
mailing list