kvm problems with Intel host and netbsd/linux guests
Hi,
I'm having trouble getting kvm to work on my system.
The host has 2 dual-core Intel Xeon 5130 CPUs (flags: lm vmx) and is running Linux 2.6.20.1 with kvm-15 (although I've had no luck with kvm-12 or kvm-14 either)
If I take (for example) the NetBSD amd64 installation:
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/amd64/installation/cdrom/amd64cd-3.1.iso
and run it with
qemu-img create hda.img 4G
qemu-system-x86_64 -cdrom amd64cd-3.1.iso -hda hda.img -boot d
then the screen flashes briefly but qemu crashes with
unhandled vm exit: 0x80000021
rax 0000000000000000 rbx 0000000000000000 rcx 0000000000000000 rdx 0000000000000600 rsi 0000000000000000 rdi 0000000000000000 rsp 0000000000000000 rbp 0000000000000000 r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 rip 000000000000fff0 rflags 00023002
cs f000 (ffff0000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ds 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) es 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) fs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) tr 0000 (08850000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 0 l 0 g 0 avl 0) gdt 0/ffff
idt 0/ffff
cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
Aborted
If I try to run it without kvm:
qemu-system-x86_64 -no-kvm -cdrom amd64cd-3.1.iso -hda hda.img -boot d
Then I get a blank SDL window that is entirely frozen (can't even switch to the qemu monitor). If I use a stock qemu 0.8.2 to boot the cdrom and run the installer, then try to boot the resulting disk image with kvm:
qemu-system-x86_64 -hda hda.img -boot c
qemu-system-x86_64 -no-kvm -hda hda.img -boot c
then I get the exact same results -- the first crashes with "unhandled vm exit" and the second freezes.
Any suggestions?
Also, on the Linux side of things, I have a disk image from a computer that also crashes when I try to boot it. It dies with "exception 14" after Grub. But, it does work fine with -no-kvm. The kernel it's booting is a 32-bit k7 optimized kernel; is it expected behavior for that to work fine under -no-kvm but crash on an Intel host?
-jim
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Quoted 28 lines · Jim Paris
Hi,
I'm having trouble getting kvm to work on my system.
The host has 2 dual-core Intel Xeon 5130 CPUs (flags: lm vmx) and is running Linux 2.6.20.1 with kvm-15 (although I've had no luck with kvm-12 or kvm-14 either)If I take (for example) the NetBSD amd64 installation:
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/amd64/installation/cdrom/amd64cd-3.1.iso
and run it with
qemu-img create hda.img 4G
qemu-system-x86_64 -cdrom amd64cd-3.1.iso -hda hda.img -boot dthen the screen flashes briefly but qemu crashes with
unhandled vm exit:
0x80000021
rax 0000000000000000 rbx 0000000000000000 rcx 0000000000000000 rdx 0000000000000600 rsi 0000000000000000 rdi 0000000000000000 rsp 0000000000000000 rbp 0000000000000000 r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 rip000000000000fff0rflags 00023002
cs f000 (ffff0000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ds 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) es 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
Quoted 10 lines
fs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) tr 0000 (08850000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0) ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 0 l 0 g 0 avl 0) gdt 0/ffff
idt 0/ffff
cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
Aborted
It looks like the guest is rebooting (rip = 0xfff0), probably due to an earlier bug, so the register dump doesn't tell us much.
Quoted 15 lines
If I try to run it without kvm:
qemu-system-x86_64 -no-kvm -cdrom amd64cd-3.1.iso -hda hda.img -boot d
Then I get a blank SDL window that is entirely frozen (can't even switch to the qemu monitor). If I use a stock qemu 0.8.2 to boot the cdrom and run the installer, then try to boot the resulting disk image with kvm:
qemu-system-x86_64 -hda hda.img -boot c
qemu-system-x86_64 -no-kvm -hda hda.img -boot cthen I get the exact same results -- the first crashes with "unhandled vm exit" and the second freezes.
Quoted 8 lines
Any suggestions?
Also, on the Linux side of things, I have a disk image from a computer that also crashes when I try to boot it. It dies with "exception 14" after Grub. But, it does work fine with -no-kvm. The kernel it's booting is a 32-bit k7 optimized kernel; is it expected behavior for that to work fine under -no-kvm but crash on an Intel host?
If the kernel uses AMD-specific instructions, yes. Can you send .config for that kernel?
Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Quoted 9 lines · Avi Kivity
Quoted 6 lines
Also, on the Linux side of things, I have a disk image from a computer that also crashes when I try to boot it. It dies with "exception 14" after Grub. But, it does work fine with -no-kvm. The kernel it's booting is a 32-bit k7 optimized kernel; is it expected behavior for that to work fine under -no-kvm but crash on an Intel host?
If the kernel uses AMD-specific instructions, yes. Can you send .config for that kernel?
I think it's the stock debian 2.6.18-1-k7 kernel, not sure as it's a disk image from someone else's machine. The config has
CONFIG_X86_32=y
CONFIG_MK7=y
http://jim.sh/~jim/tmp/config-2.6.18-1-k7
I've managed to get it to boot with KVM by booting first with -no-kvm and installing the 2.6.18-1-686 kernel. And that seems to mostly work, except that I get occasional random segfaults inside the guest OS. I also get the same thing when booting e.g. a FreeBSD liveCD (FreeSBIE). Sigh. Not sure how to easily reproduce or debug that.
-jim
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV