Multiboot2 xen 4.14.5 kernel

Azurya Development dev at azurya.net
Tue Oct 11 11:02:41 PDT 2022


Hi,

I'm trying to kexec from a Linux kernel to a Xen supporting multiboot2. 
My GRUB2 config manages to launch Xen without any issues, but I haven't 
been able to reproduce a similar setup using the latest kexec binary.

Here's the relevant (working) grub.cfg section:

 > echo    'Loading Xen 4.14.5 ...'
 >     if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then
 >         xen_rm_opts=
 >     else
 >         xen_rm_opts="no-real-mode edd=off"
 >     fi
 > multiboot2    /xen-4.14.5.gz placeholder  console=none 
dom0_mem=min:1024M dom0_mem=max:4096M ucode=scan smt=off 
gnttab_max_frames=2048 gnttab_max_maptrack_frames=4096 ${xen_rm_opts}
 > echo    'Loading Linux 5.15.64-1.fc32.qubes.x86_64 ...'
 > module2    /vmlinuz-5.15.64-1.fc32.qubes.x86_64 placeholder 
root=/dev/mapper/qubes_dom0-root ro 
rd.luks.uuid=luks-4272e2eb-2f6f-4532-a801-cfb3029b1080 
rd.lvm.lv=qubes_dom0/root rd.lvm.lv=qubes_dom0/swap 
plymouth.ignore-serial-consoles rd.driver.pre=btrfs rhgb quiet
 > echo    'Loading initial ramdisk ...'
 > module2    --nounzip /initramfs-5.15.64-1.fc32.qubes.x86_64.img

And here is my unsuccessful attempt at reproducing this behavior (from a 
Linux LiveUSB):

 > mkdir /mnt/boot && mount /dev/sda2 /mnt/boot && mount /dev/sda1 
/mnt/boot/efi
 > kexec \
 >     -l /mnt/boot/xen-4.14.5.gz \
 >     -t multiboot2-x86 \
 >     --command-line="console=vga dom0_mem=min:1024M dom0_mem=max:4096M 
ucode=scan smt=off gnttab_max_frames=2048 gnttab_max_maptrack_frames=4096" \
 >     --module="/mnt/boot/vmlinuz-5.15.64-1.fc32.qubes.x86_64 
root=/dev/mapper/qubes_dom0-root ro 
rd.luks.uuid=luks-4272e2eb-2f6f-4532-a801-cfb3029b1080 
rd.lvm.lv=qubes_dom0/root rd.lvm.lv=qubes_dom0/swap 
plymouth.ignore-serial-consoles rd.driver.pre=btrfs rhgb" \
 > --module="/mnt/boot/initramfs-5.15.64-1.fc32.qubes.x86_64.img"
 > kexec -e

After the kexec -e command, the system systematically reboots instead of 
loading Xen, with no information about why.

Some things I tried:

* Removing --nounzip from grub.cfg has no effect and Xen still boots.
* Removing "quiet" from the dom0 Linux's command line. Still no output.
* kexec'ing directly into dom0 Linux kernel. This works, but it is not
what I want.
* Adding "no-real-mode" and "no-real-mode edd=off" to Xen's
command-line. No luck.
* Adding "noreboot" to Xen's command-line. With GRUB2 and a forced
crash (e.g. by omitting the module2 instructions), Xen hangs as
expected. With kexec the system reboots nonetheless, with no
information.
* I also stumbled upon [this
article](https://xenbits.xenproject.org/docs/4.14-testing/misc/kexec_and_kdump.txt)
but the `--vmm` option is IA-64 specific, while I'm on x86_64.

I'm running out of ideas how to fix this, is there something I am 
unaware with regard to booting a multiboot2 system? Or Xen in 
particular? How to reproduce GRUB2's setup using kexec?

Regards,





More information about the kexec mailing list