Problem with QEMU on KVM
Hello,
Booting DOS 6.22 with NT4 Bootloader works fine. With enabled KVM it boots, but hangs at counting down the boot loader selection menu (30s, 29s, hang). Booting Knoppix 6.2 from CD wwith KVM orks well.
Versions (0.12.3):
x86_64-softmmu: OK
i386-softmmu: OK
x86_64-softmmu with -enable-kvm: Boot problem
i386-softmmu with -enable-kvm: Boot problem
Host is: Fedora 11 2.6.30.10-105.2.23.fc11.x86 on AMD Phenom II Quad Core
Any ideas?
Thanx.
Ciao,
Gerhard
Hi...
Quoted 6 lines · Gerhard Wiesinger
Hello,
Booting DOS 6.22 with NT4 Bootloader works fine. With enabled KVM it boots, but hangs at counting down the boot loader selection menu (30s, 29s, hang). Booting Knoppix 6.2 from CD wwith KVM orks well.
Quoted 8 lines
Versions (0.12.3):
x86_64-softmmu: OK
i386-softmmu: OK
x86_64-softmmu with -enable-kvm: Boot problem
i386-softmmu with -enable-kvm: Boot problemHost is: Fedora 11 2.6.30.10-105.2.23.fc11.x86 on AMD Phenom II Quad Core
IMHO, the problem is, we have to find out first, how the bootloader do the timing. Is it using tight loop? Counting from TSC? PIT? or else?
I suggest to dump the executed TB in Qemu. Please read about -d option.
NB: I am not an expert, just trying to help....
Signature · 7 lines
regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Quoted 18 lines · Mulyadi Santosa
Hi...
Quoted 6 lines · Gerhard Wiesinger
Hello,
Booting DOS 6.22 with NT4 Bootloader works fine. With enabled KVM it boots, but hangs at counting down the boot loader selection menu (30s, 29s, hang). Booting Knoppix 6.2 from CD wwith KVM orks well.
Quoted 8 lines
Versions (0.12.3):
x86_64-softmmu: OK
i386-softmmu: OK
x86_64-softmmu with -enable-kvm: Boot problem
i386-softmmu with -enable-kvm: Boot problemHost is: Fedora 11 2.6.30.10-105.2.23.fc11.x86 on AMD Phenom II Quad Core
Quoted 6 lines
IMHO, the problem is, we have to find out first, how the bootloader do the timing. Is it using tight loop? Counting from TSC? PIT? or else?
I suggest to dump the executed TB in Qemu. Please read about -d option.
NB: I am not an expert, just trying to help....
OK, uses the following ports:
Port 0x20: 8259 interrupt controller
Port 0x40: 8253 timer
Interrupt 0x1A:
ah=0x00: fetches system timer counters
ah=0x02: reads the clock
ah=0x04: fetches date
So there must be something wrong with KVM with the above functionality (I guess the timers).
Ciao,
Gerhard
Hi Gerhard...
Quoted 11 lines · Gerhard Wiesinger
OK, uses the following ports:
Port0x20: 8259 interrupt controller
Port0x40: 8253 timerInterrupt
0x1A:
ah=0x00: fetches system timer counters
ah=0x02: reads the clock
ah=0x04: fetches dateSo there must be something wrong with KVM with the above functionality (I guess the timers).
Hmm, my silly guess is, maybe the timer is seen as decremented....or at least "stuck".
I have very little knowledge about git, but maybe you can start doing git bisect to narrow which git commit that introduce such behaviour. Meanwhile, let's wait for comments from one of the KVM developers.
Signature · 7 lines
regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Quoted 15 lines · Mulyadi Santosa
Hi Gerhard...
Quoted 11 lines · Gerhard Wiesinger
OK, uses the following ports:
Port0x20: 8259 interrupt controller
Port0x40: 8253 timerInterrupt
0x1A:
ah=0x00: fetches system timer counters
ah=0x02: reads the clock
ah=0x04: fetches dateSo there must be something wrong with KVM with the above functionality (I guess the timers).
Quoted 6 lines
Hmm, my silly guess is, maybe the timer is seen as decremented....or at least "stuck".
I have very little knowledge about git, but maybe you can start doing git bisect to narrow which git commit that introduce such behaviour. Meanwhile, let's wait for comments from one of the KVM developers.
There are various -no-kvm-XXX options to try:
-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC
-no-kvm-pit disable KVM kernel mode PIT
-no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjection
Any of them might be causing this problem.
They disable in-kernel emulation of the interrupt controller and timer chips, and force the qemu version to be used. It's possible the in-kernel emulation is buggier than the qemu version.
-- Jamie
Hi Jamie...
Review
Quoted 5 lines · Jamie Lokier
There are various -no-kvm-XXX options to try:
(quoted diff) +0
-3-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC -no-kvm-pit disable KVM kernel mode PIT -no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjection
I try to read the source code without too much luck understanding the meaning of the above parameters, especially the reinjection. Please CMIIW, interrupt reinjection is a way to handle lost ticks, right?
Signature · 7 lines
regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Quoted 5 lines · Mulyadi Santosa
Hi Jamie...
Quoted 2 lines · Jamie Lokier
There are various -no-kvm-XXX options to try:
Quoted 7 lines
Review
Quoted 3 lines
(quoted diff) +0
-3-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC -no-kvm-pit disable KVM kernel mode PIT -no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjectionI try to read the source code without too much luck understanding the meaning of the above parameters, especially the reinjection. Please CMIIW, interrupt reinjection is a way to handle lost ticks, right?
Those switches only exist in the qemu-kvm branch. The fact that -enable-kvm has some effect for you makes me think that you tried upstream KVM support (ie. the one that comes with vanilla QEMU), right?
It would be interesting to check if you can reproduce the problem also with qemu-kvm(-0.12.3 or git head). As you may also face an issue of the kvm kernel bits, it would be furthermore helpful to check with the latest kernel from kvm.git or the modules build via kvm-kmod as well.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 14 lines · Jan Kiszka
Quoted 5 lines · Mulyadi Santosa
Hi Jamie...
Quoted 2 lines · Jamie Lokier
There are various -no-kvm-XXX options to try:
Quoted 7 lines
Review
Quoted 3 lines
(quoted diff) +0
-3-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC -no-kvm-pit disable KVM kernel mode PIT -no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjectionI try to read the source code without too much luck understanding the meaning of the above parameters, especially the reinjection. Please CMIIW, interrupt reinjection is a way to handle lost ticks, right?
Quoted 4 lines
Those switches only exist in the qemu-kvm branch. The fact that -enable-kvm has some effect for you makes me think that you tried upstream KVM support (ie. the one that comes with vanilla QEMU), right?
I tried 0.12.3 stable and also qemu git master:
http://git.savannah.gnu.org/cgit/qemu.git/log/
Quoted 4 lines
It would be interesting to check if you can reproduce the problem also with qemu-kvm(-0.12.3 or git head). As you may also face an issue of the kvm kernel bits, it would be furthermore helpful to check with the latest kernel from kvm.git or the modules build via kvm-kmod as well.
Can you please post links to the different git repositories, since a lot of different repositories exist here (qemu-kvm and kernel).
Thnx.
Ciao,
Gerhard
Quoted 22 lines · Gerhard Wiesinger
Quoted 12 lines · Jan Kiszka
Quoted 11 lines · Mulyadi Santosa
Hi Jamie...
Review
Quoted 5 lines · Jamie Lokier
There are various -no-kvm-XXX options to try:
(quoted diff) +0
-3-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC -no-kvm-pit disable KVM kernel mode PIT -no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjectionI try to read the source code without too much luck understanding the meaning of the above parameters, especially the reinjection. Please CMIIW, interrupt reinjection is a way to handle lost ticks, right?
Quoted 4 lines
Those switches only exist in the qemu-kvm branch. The fact that -enable-kvm has some effect for you makes me think that you tried upstream KVM support (ie. the one that comes with vanilla QEMU), right?
I tried 0.12.3 stable and also qemu git master:
http://git.savannah.gnu.org/cgit/qemu.git/log/
Quoted 7 lines
Quoted 4 lines
It would be interesting to check if you can reproduce the problem also with qemu-kvm(-0.12.3 or git head). As you may also face an issue of the kvm kernel bits, it would be furthermore helpful to check with the latest kernel from kvm.git or the modules build via kvm-kmod as well.
Can you please post links to the different git repositories, since a lot of different repositories exist here (qemu-kvm and kernel).
http://www.linux-kvm.org/page/Code
HTH,
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 29 lines · Jamie Lokier
Quoted 15 lines · Mulyadi Santosa
Hi Gerhard...
Quoted 11 lines · Gerhard Wiesinger
OK, uses the following ports:
Port0x20: 8259 interrupt controller
Port0x40: 8253 timerInterrupt
0x1A:
ah=0x00: fetches system timer counters
ah=0x02: reads the clock
ah=0x04: fetches dateSo there must be something wrong with KVM with the above functionality (I guess the timers).
Quoted 6 lines
Hmm, my silly guess is, maybe the timer is seen as decremented....or at least "stuck".
I have very little knowledge about git, but maybe you can start doing git bisect to narrow which git commit that introduce such behaviour. Meanwhile, let's wait for comments from one of the KVM developers.
There are various -no-kvm-XXX options to try:
(quoted diff) +0
-3-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC -no-kvm-pit disable KVM kernel mode PIT -no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjection
Quoted 5 lines
Any of them might be causing this problem.
They disable in-kernel emulation of the interrupt controller and timer chips, and force the qemu version to be used. It's possible the in-kernel emulation is buggier than the qemu version.
Hello Jamie, thanx so far.
I'm starting in this way:/root/download/qemu/qemu-0.12.3/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -a_lot_of_other_options
All options you mentioned don't work:/root/download/qemu/qemu-0.12.3/x86_64-softmmu/qemu-system-x86_64: invalid option -- '-no-kvm-irqchip' /root/download/qemu/qemu-0.12.3/x86_64-softmmu/qemu-system-x86_64: invalid option -- '-no-kvm-pit' /root/download/qemu/qemu-0.12.3/x86_64-softmmu/qemu-system-x86_64: invalid option -- '-no-kvm-no-kvm-irqchip'
Is there another way of startup or is it working only on newer versions?
BTW: For me it is very unclear what's the difference between the following commands:
qemu
qemu -enable-kvm
kvm
How can I build the kvm executable? Different source tree? Newer version from branch?
Maybe someone can explain the different versions of qemu/kvm and branches etc. and possible features in detail.
Thnx.
Ciao,
Gerhard
Quoted 4 lines · Gerhard Wiesinger
Hello,
Booting DOS 6.22 with NT4 Bootloader works fine. With enabled KVM it boots, but hangs at counting down the boot loader selection menu (30s, 29s, hang). Booting Knoppix 6.2 from CD wwith KVM orks well.
Quoted 8 lines
Versions (0.12.3):
x86_64-softmmu: OK
i386-softmmu: OK
x86_64-softmmu with -enable-kvm: Boot problem
i386-softmmu with -enable-kvm: Boot problemHost is: Fedora 11 2.6.30.10-105.2.23.fc11.x86 on AMD Phenom II Quad Core
Hello,
OK, works well with version fromgit://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
The only thing which is broken so far in DOS: PS/2 mouse does not work correctly with VNC (buttons are pressed even if no button is pressed, position is random). This also happens with the unstable version of QEMU, so this is looks like not to be KVM related:
http://git.savannah.gnu.org/cgit/qemu.git/
(Works well with 0.12.3 stable)
Any ideas from which change this might come (PS/2 mouse code seems to be stable only keyboard LEDs added by Gerd)?
Ciao,
Gerhard
Quoted 2 lines · Gerhard Wiesinger
Any ideas from which change this might come (PS/2 mouse code seems to be stable only keyboard LEDs added by Gerd)?
No, but you might find it with "git bisect" since you have a working and non-working version.
-- Jamie
Quoted 6 lines · Jamie Lokier
Quoted 2 lines · Gerhard Wiesinger
Any ideas from which change this might come (PS/2 mouse code seems to be stable only keyboard LEDs added by Gerd)?
No, but you might find it with "git bisect" since you have a working and non-working version.
Tried that, but no useful output (at least for me):
git bisect start
git bisect bad
git bisect good v0.12.3
Bisecting: a merge base must be tested [749717a0ea2f60d33d01c1e37fa24dfa7250dfc0] Add S390 maintainer information
Had also a look at ps2.c/ps2.h, pckbd.c: There were no changes which could explain such a behaviour. Also keyboard is very strange which switches to CAPS LOCK (shift state) very unmotivated.
Can someone reproduce this behaviour, maybe with VNC and also with SDL?
Any further ideas?
Thnx.
Ciao,
Gerhard
Hi,
Quoted 3 lines
Had also a look at
ps2.c/ps2.h,pckbd.c: There were no changes which could explain such a behaviour. Also keyboard is very strange which switches to CAPS LOCK (shift state) very unmotivated.
Hmm. Recent qemu tries hard to make sure vncviewer and guest capslock/numlock state are in sync. It is a heuristic though and can fail in certain cases. Try "-vnc $display,no-lock-key-sync", does that help?
cheers,
Gerd
Quoted 7 lines · Gerd Hoffmann
Hi,
Quoted 3 lines
Had also a look at
ps2.c/ps2.h,pckbd.c: There were no changes which could explain such a behaviour. Also keyboard is very strange which switches to CAPS LOCK (shift state) very unmotivated.Hmm. Recent qemu tries hard to make sure vncviewer and guest capslock/numlock state are in sync. It is a heuristic though and can fail in certain cases. Try "-vnc $display,no-lock-key-sync", does that help?
Tracked down the problem of the mouse that te mouse is in absolute mouse mode (verified by logging, therefore coordinates are very high and absolute and not relative):
static void pointer_event(VncState *vs, int button_mask, int x, int y)
{
...
if (vs->absolute) {
kbd_mouse_event(ds_get_width(vs->ds) > 1 ?
x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000,
ds_get_height(vs->ds) > 1 ?
y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000,
dz, buttons);
} else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {
x -= 0x7FFF;
y -= 0x7FFF;///////////////////////////////////////////////////////////// // We get here in (verified by core dump), but we should get into last // else /////////////////////////////////////////////////////////////
kbd_mouse_event(x, y, dz, buttons);
} else {
if (vs->last_x != -1)
kbd_mouse_event(x - vs->last_x,
y - vs->last_y,
dz, buttons);
vs->last_x = x;
vs->last_y = y;
}...
}
Guess problems comes from the following commit (not yet verified):
commit 37c34d9d5d87ea9d51760310c8863b82cb8c055a
Author: Anthony Liguori <[email protected]> Date: Wed Mar 10 09:38:29 2010 -0600
input: make vnc use mouse mode notifiers
When we switch to absolute mode, we send out a notification (if the client supports it). Today, we only send this notification when the client sends us a mouse event and we're in the wrong mode.
Ciao,
Gerhard
Quoted 47 lines · Gerhard Wiesinger
Quoted 7 lines · Gerd Hoffmann
Hi,
Quoted 3 lines
Had also a look at
ps2.c/ps2.h,pckbd.c: There were no changes which could explain such a behaviour. Also keyboard is very strange which switches to CAPS LOCK (shift state) very unmotivated.Hmm. Recent qemu tries hard to make sure vncviewer and guest capslock/numlock state are in sync. It is a heuristic though and can fail in certain cases. Try "-vnc $display,no-lock-key-sync", does that help?
Tracked down the problem of the mouse that te mouse is in absolute mouse mode (verified by logging, therefore coordinates are very high and absolute and not relative):
static voidpointer_event(VncState *vs, int button_mask, int x, int y)
{
...if (vs->absolute) { kbd_mouse_event(ds_get_width(vs->ds) > 1 ? x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000, ds_get_height(vs->ds) > 1 ? y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000, dz, buttons); } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) { x -= 0x7FFF; y -= 0x7FFF;///////////////////////////////////////////////////////////// // We get here in (verified by core dump), but we should get into last // else /////////////////////////////////////////////////////////////
kbd_mouse_event(x, y, dz, buttons); } else { if (vs->last_x != -1) kbd_mouse_event(x - vs->last_x, y - vs->last_y, dz, buttons); vs->last_x = x; vs->last_y = y;}
...
}Guess problems comes from the following commit (not yet verified):
commit37c34d9d5d87ea9d51760310c8863b82cb8c055aAuthor: Anthony Liguori <[email protected]> Date: Wed Mar 10 09:38:29 2010 -0600input: make vnc use mouse mode notifiers
Quoted 7 lines
When we switch to absolute mode, we send out a notification (if the
client
supports it). Today, we only send this notification when the client
sends us
a mouse event and we're in the wrong mode.Signed-off-by Anthony Liguori <[email protected]>
Ok, verified:
git revert -n 37c34d9d5d87ea9d51760310c8863b82cb8c055a => works well.
Ciao,
Gerhard
Quoted 13 lines · Gerhard Wiesinger
Quoted 13 lines
Guess problems comes from the following commit (not yet verified):
commit37c34d9d5d87ea9d51760310c8863b82cb8c055aAuthor: Anthony Liguori <[email protected]> Date: Wed Mar 10 09:38:29 2010 -0600input: make vnc use mouse mode notifiers
When we switch to absolute mode, we send out a notification (if the
client
supports it). Today, we only send this notification when the client
sends us
a mouse event and we're in the wrong mode.
Quoted 6 lines
Quoted 1 line
Signed-off-by Anthony Liguori <[email protected]>Ok, verified:
git revert -n37c34d9d5d87ea9d51760310c8863b82cb8c055a=> works well.
Still got no feedback and saw no further changes to fix this problem.
Thnx.
Ciao,
Gerhard
Quoted 14 lines · Gerhard Wiesinger
Quoted 13 lines · Gerhard Wiesinger
Quoted 13 lines
Guess problems comes from the following commit (not yet verified):
commit37c34d9d5d87ea9d51760310c8863b82cb8c055aAuthor: Anthony Liguori <[email protected]> Date: Wed Mar 10 09:38:29 2010 -0600input: make vnc use mouse mode notifiers
When we switch to absolute mode, we send out a notification (if
the client
supports it). Today, we only send this notification when the
client sends us
a mouse event and we're in the wrong mode.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Anthony Liguori <[email protected]>Ok, verified:
git revert -n37c34d9d5d87ea9d51760310c8863b82cb8c055a=> works well.Still got no feedback and saw no further changes to fix this problem.
Fix is on the list.
Regards,
Anthony Liguori
Quoted 8 lines
Thnx.
Ciao,
GerhardSignature · 1 line
http://www.wiesinger.com/
Problem with QEMU / KVM
Hi
I built 2.6.27.10 kernel with KVM configured as built-in.
CONFIG_HAVE_KVM=yCONFIG_VIRTUALIZATION=yCONFIG_KVM=yCONFIG_KVM_INTEL=y
I built qemu-kvm 0.12.2 from sources pointing to above kernel. When I spawn a VM, it hangs at boot. Pl see below. I copied qemu-kvm binary and bios, vga etc binaries. I installed grub on a manually created img file. This image has nothing but grub, its stage1,1_5,stage2, my kernel and initrd files.
Am spawning VM as below:
qemu-system-x86_64 -hda vmhd.img -L . -curses -show-cursor
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> kernel /boot/vmos root=/dev/ram0 ramdisk_size=32768 rw single
[Linux-bzImage, setup=0x1800, size=0x1cb9b0]
grub> initrd /boot/initrdfs.gz
[Linux-initrd @ 0x6751000, 0x189b587 bytes]
grub> boot
I copied all these binaries from my dev host to this linux box.
-rw-r--r-- 1 root root 131072 May 2 21:31 bios.bin -rw-r--r-- 1 root root 1025 May 2 21:31 linuxboot.bin -rw-r--r-- 1 root root 1024 May 2 21:31 multiboot.bin -rw-r--r-- 1 root root 524288 May 2 21:31 ppc_rom.bin -rw-r--r-- 1 root root 72192 May 2 21:31 pxe-e1000.bin -rw-r--r-- 1 root root 56832 May 2 21:31 pxe-i82559er.bin -rw-r--r-- 1 root root 56320 May 2 21:31 pxe-ne2k_pci.bin -rw-r--r-- 1 root root 56832 May 2 21:31 pxe-pcnet.bin -rw-r--r-- 1 root root 56320 May 2 21:31 pxe-rtl8139.bin -rw-r--r-- 1 root root 56320 May 2 21:31 pxe-virtio.bin -rwxr-xr-x 1 root root 8960 May 2 21:31 vapic.bin -rw-r--r-- 1 root root 35840 May 2 21:31 vgabios-cirrus.bin -rw-r--r-- 1 root root 39936 May 2 21:31 vgabios.bin
Appreciate your help.
________________________________
From: Anthony Liguori <[email protected]>
To: Gerhard Wiesinger <[email protected]>
Cc: [email protected]; Gerd Hoffmann <[email protected]>
Sent: Tue, May 4, 2010 6:32:50 AM
Subject: Re: [Qemu-devel] Problem with QEMU on KVM
Quoted 12 lines · Gerhard Wiesinger
Quoted 11 lines · Gerhard Wiesinger
Quoted 11 lines
Guess problems comes from the following commit (not yet verified):
commit37c34d9d5d87ea9d51760310c8863b82cb8c055aAuthor: Anthony Liguori <[email protected]> Date: Wed Mar 10 09:38:29 2010 -0600input: make vnc use mouse mode notifiers
When we switch to absolute mode, we send out a notification (if the client supports it). Today, we only send this notification when the client sends us a mouse event and we're in the wrong mode.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Anthony Liguori <[email protected]>Ok, verified:
git revert -n37c34d9d5d87ea9d51760310c8863b82cb8c055a=> works well.Still got no feedback and saw no further changes to fix this problem.
Fix is on the list.
Regards,
Anthony Liguori
Quoted 7 lines
Thnx.
Ciao,
Gerhard