Sample Header Ad - 728x90

How should I fix a failed kexec that produces "CPUs are stuck in the kernel" in dmesg?

3 votes
0 answers
1025 views
I have built both a kernel from the Raspberry Pi sources and kexec-tools for arm64, and booted my kernel on a Raspberry Pi 4. When I attempt to run kexec, it produces no output, exits with a nonzero return code, and an error message is posted to dmesg. ## The debug output While running kexec normally prints no output, running with --debug to show debug messages shows:
# kexec -s -l /media/sda1/boot/vmlinuz-rpi4barb --initrd /media/sda1/boot/initramfs-rpi4barb --reuse-cmdline --debug
arch_process_options:178: command_line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 smsc95xx.macaddr=DC:A6:32:09:35:A1 vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  modules=loop,squashfs,sd-mod,usb-storage quiet console=tty1 console=ttyS0,115200
arch_process_options:180: initrd: /media/sda1/boot/initramfs-rpi4barb
arch_process_options:182: dtb: (null)
arch_process_options:185: console: (null)
Try gzip decompression.
Try LZMA decompression.
lzma_decompress_file: read on /media/sda1/boot/vmlinuz-rpi4barb of 65536 bytes failed
elf_arm64_probe: Not an ELF executable.

# echo $?
255
My kernel _did_ boot (so it must be _some_ kind of executable). file claims:
# file /media/sda1/boot/vmlinuz-rpi4barb
/media/sda1/boot/vmlinuz-rpi4barb: Linux kernel ARM64 boot executable Image, little-endian, 4K pages
## The dmesg output When I run kexec, the line Can't kexec: CPUs are stuck in the kernel appears in dmesg. What does it mean that CPUs are stuck in the kernel, and what should I do to resolve this problem? I have googled the message, and found mostly the code that generates it and a few unanswered questions. ## Is this related to PSCI? [One mailing list thread](http://lists.infradead.org/pipermail/kexec/2017-April/018569.html) which did have some replies indicated the problem may lie with something called [PSCI](https://linux-sunxi.org/PSCI) . Running the suggested command dmesg | grep -E 'psci|started in' results in no output, indicating that PSCI is not supported in the kernel that I built. I don't understand that answer. The kernel docs [place PSCI under kvm](https://www.kernel.org/doc/html/latest/virt/kvm/arm/psci.html) , but my kernel is booting to physical hardware. Am I missing something? ## Any help greatly appreciated Have I built my kernel wrong? Are there any docs or posts I've missed showing the right way to do this? Thanks for looking.
Asked by Micah R Ledbetter (141 rep)
Feb 25, 2021, 04:49 PM