Re: kvm-60: kexec in guest crashes the host

Dan Aloni
2008-02-20T10:48:39Z

[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]

On Wed, Feb 20, 2008 at 11:09:44AM +0200, Avi Kivity wrote:
> Dan Aloni wrote:
> > It happens at 100% of the times I invoke kexec.
> >
> >
>
> Can you provide a commandline which triggers this? I'm completely
> ignorant wrt kexec.

I managed to verify that this problem can be reproduced with the
2.6.16.60 tree.

Also, it's worth to note that with '-no-kvm' the kexec procedure works
successfully and the second kernel executes.

Please use the .config that that I attached to this mail, and also apply
the patch I supplied (it fixes a build problem that 2.6.16 has with the
newer binutils versions and x86_64). I use gcc-4.1.2 to build the kernel.

Once you have the bzImage of that guest kernel, use a root filesystem
and boot it straight into /bin/bash.

Now, assuming that your guest rootfs has kexec-utils package installed,
do the following:

mount -t proc proc /proc
kexec -l bzImage --command-line='ro root=/dev/hda1 init=/bin/bash'
kexec -e

BTW, if you use the serial console with the '-nographic' switch, then
you might want to use kexec a little differently:

kexec -l bzImage --command-line='ro root=/dev/hda1 init=/bin/bash console=ttyS0,115200' --serial=ttyS0 --serial-baud=115200

Good luck,

--
Dan Aloni
XIV, an IBM (R) company. http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il

[-- Attachment #2: 2.6.16.60-guest-config.gz --]
[-- Type: application/octet-stream, Size: 7279 bytes --]

[-- Attachment #3: 2.6.16.60-build-patch.diff --]
[-- Type: text/x-diff, Size: 1266 bytes --]

diff --git a/arch/x86_64/boot/compressed/Makefile b/arch/x86_64/boot/compressed/Makefile
index f89d96f..c9688fb 100644
--- a/arch/x86_64/boot/compressed/Makefile
+++ b/arch/x86_64/boot/compressed/Makefile
@@ -12,6 +12,7 @@ EXTRA_AFLAGS := -traditional -m32
# cannot use EXTRA_CFLAGS because base CFLAGS contains -mkernel which conflicts with
# -m32
CFLAGS := -m32 -D__KERNEL__ -Iinclude -O2 -fno-strict-aliasing
+AFLAGS := $(CFLAGS) -D__ASSEMBLY__
LDFLAGS := -m elf_i386

LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 -m elf_i386
diff --git a/arch/x86_64/boot/tools/build.c b/arch/x86_64/boot/tools/build.c
index c44f5e2..bcdbaf1 100644
--- a/arch/x86_64/boot/tools/build.c
+++ b/arch/x86_64/boot/tools/build.c
@@ -149,8 +149,8 @@ int main(int argc, char ** argv)
sz = sb.st_size;
fprintf (stderr, "System is %d kB\n", sz/1024);
sys_size = (sz + 15) / 16;
- /* 0x40000*16 = 4.0 MB, reasonable estimate for the current maximum */
- if (sys_size > (is_big_kernel ? 0x40000 : DEF_SYSSIZE))
+ /* 0x60000*16 = 6.0 MB, reasonable estimate for the current maximum */
+ if (sys_size > (is_big_kernel ? 0x60000 : DEF_SYSSIZE))
die("System is too big. Try using %smodules.",
is_big_kernel ? "" : "bzImage or ");
while (sz > 0) {

[-- Attachment #4: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #5: Type: text/plain, Size: 158 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net