Skip to contentSkip to conversation

kexec regression between 3.1.0 and 3.1.3 ?

DISCUSSION Ward Vandewege 3 participants 9 messages Aug 7, 2008 – Aug 11, 2008

lore
Share & tools
lore
#0 lore raw

(I sent this yesterday to xen-users but received no response at all. Perhaps the dev list is the proper list for this kind of thing.)

Hi there,

There seems to be a regression with regard to kexec'ing into a Xen kernel between Xen 3.1.0 (confirmed working) and 3.1.3 (confirmed not working). I would try 3.1.1 and 3.1.2 but source for 3.1 versions older than 3.1.3 no longer seems to be available for download. I still had source for 3.1.0 lying around, luckily.

I'm building and running Xen on AMD64 systems, 64 bit.

Basically, up to 3.1.0 I can kexec into a Xen kernel like this:

# kexec --console-vga --console-serial -l /boot/xen-3.1.0.gz --module="//boot/vmlinuz-2.6.18-xen
root=/dev/sda ro console=tty0 console=ttyS0,115200" --module="/boot/initrd.img-2.6.18-xen"
--command-line="com1=115200,8n1 cdb=com1"
# kexec -e
Quoted 1 line

From 3.1.3, this no longer works:

# kexec --console-vga --console-serial -l /boot/xen-3.1.3.gz --module="//boot/vmlinuz-2.6.18.8-xen
root=/dev/sda ro console=tty0 console=ttyS0,115200" --module="/boot/initrd.img-2.6.18.8-xen"
--command-line="com1=115200,8n1 cdb=com1"
# kexec -e

Kexec loads the Xen kernel fine, but hangs when trying to execute it. I've done some digging in the kexec source, and from what I can tell it hangs sometime after running the __NR_reboot syscall, so presumably somewhere early in the Xen kernel code.

If I add 'earlyprintk=ttyS0,115200,keep' to the kernel command line, I see

[    0.000000] Starting new kernel

and then nothing.

I'm using the latest version of kexec (2.0.0 from
http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/), but I've also tested older kexec versions which behave in the same way.

I first observed this on real iron, but I've now set up a test environment with qemu which behaves identically.

Any suggestions?

Thanks,
Ward.

#1 lore raw
Quoted 8 lines · Ward Vandewege

I'm using the latest version of kexec (2.0.0 from
http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/), but I've also tested older kexec versions which behave in the same way.

I first observed this on real iron, but I've now set up a test environment with qemu which behaves identically.

Any suggestions?

Try adding no-real-mode to Xen's command line.

-- Keir

#2 lore raw
Quoted 6 lines · Keir Fraser
Quoted 4 lines · Ward Vandewege

I'm using the latest version of kexec (2.0.0 from
http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/), but I've also tested older kexec versions which behave in the same way.

Quoted 6 lines
Quoted 4 lines

I first observed this on real iron, but I've now set up a test environment with qemu which behaves identically.

Any suggestions?

Try adding no-real-mode to Xen's command line.

Thank you! That fixes it for 3.1.3 and up (tested 3.1.3, 3.1.4 and 3.2.1).

Thanks,
Ward.

#3 lore raw
Quoted 5 lines · Ward Vandewege
Quoted 3 lines
Quoted 1 line

Any suggestions?

Try adding no-real-mode to Xen's command line.

Thank you! That fixes it for 3.1.3 and up (tested 3.1.3, 3.1.4 and 3.2.1).

It'd be nice to have kexec add that flag by default for Xen, or steal a new multiboot flag to mean the same thing, as this trips people up frequently I expect. Oh well, hopefully knowledge of this trick will spread.

-- Keir

#4 lore raw
Quoted 10 lines · Keir Fraser
Quoted 5 lines · Ward Vandewege
Quoted 3 lines
Quoted 1 line

Any suggestions?

Try adding no-real-mode to Xen's command line.

Thank you! That fixes it for 3.1.3 and up (tested 3.1.3, 3.1.4 and 3.2.1).

It'd be nice to have kexec add that flag by default for Xen, or steal a new multiboot flag to mean the same thing, as this trips people up frequently I expect. Oh well, hopefully knowledge of this trick will spread.

Yeah.

Is there a significant difference between booting 3.1.4 and 3.2.1 with kexec in terms of BIOS requirements?

I mentioned that with no-real-mode, I can kexec into a 3.1.3+ Xen kernel under qemu + bochs bios. I use coreboot (http://coreboot.org) on my servers though, and it seems that while kexec'ing into 3.1.3 and 3.1.4 works fine with qemu + coreboot, kexec'ing into 3.2.1 causes qemu to triple-fault and die.

I tried on real iron this morning (with coreboot), and got similar results:
kexec'ing into 3.1.3 and 3.1.4 works fine now, kexec'ing into 3.2.1 just hangs the machine.

This is likely a coreboot bug, so I'll have to track that down. Any information about differences between what 3.2.1 and 3.1.4 require to be kexec'ed into would be most helpful though.

Thanks,
Ward.

#5 lore raw
Quoted 3 lines · Ward Vandewege

This is likely a coreboot bug, so I'll have to track that down. Any information about differences between what 3.2.1 and 3.1.4 require to be kexec'ed into would be most helpful though.

If you specify no-real-mode in both cases then there should be no difference. If Xen does not drop back into real mode then it cannot make use of any legacy BIOS services.

-- Keir

#6 lore raw
In reply to Keir Fraser
Quoted 11 lines · Keir Fraser
Quoted 5 lines · Ward Vandewege
Quoted 3 lines
Quoted 1 line

Any suggestions?

Try adding no-real-mode to Xen's command line.

Thank you! That fixes it for 3.1.3 and up (tested 3.1.3, 3.1.4 and 3.2.1).

It'd be nice to have kexec add that flag by default for Xen, or steal a new multiboot flag to mean the same thing, as this trips people up frequently I expect. Oh well, hopefully knowledge of this trick will spread.

How robust is adding no-real-mode to the command line of the second kernel? It probably makes sense just to have kexec add it by default. But I am a bit reluctant to do so if it isn't always wanted.

#7 lore raw
Quoted 7 lines · Simon Horman
Quoted 3 lines

It'd be nice to have kexec add that flag by default for Xen, or steal a new multiboot flag to mean the same thing, as this trips people up frequently I expect. Oh well, hopefully knowledge of this trick will spread.

How robust is adding no-real-mode to the command line of the second kernel? It probably makes sense just to have kexec add it by default. But I am a bit reluctant to do so if it isn't always wanted.

Any Xen version which recognises the option ought to have it specified when kexec'ed. It's not usually valid to drop back into real mode and execute legacy BIOS services at that time.

-- Keir

#8 lore raw
Quoted 9 lines · Keir Fraser
Quoted 4 lines · Simon Horman
Quoted 3 lines

It'd be nice to have kexec add that flag by default for Xen, or steal a new multiboot flag to mean the same thing, as this trips people up frequently I expect. Oh well, hopefully knowledge of this trick will spread.

Quoted 7 lines
Quoted 3 lines

How robust is adding no-real-mode to the command line of the second kernel? It probably makes sense just to have kexec add it by default. But I am a bit reluctant to do so if it isn't always wanted.

Any Xen version which recognises the option ought to have it specified when kexec'ed. It's not usually valid to drop back into real mode and execute legacy BIOS services at that time.

Hi Keir,

thanks for the clarification. I'll see about adding this to kexec-tools.