Skip to contentSkip to conversation

kvm-76 --std-vga problem

DISCUSSION Michael Malone 5 participants 7 messages Sep 28, 2008 – Oct 1, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Hi Everyone,

I just downloaded and ran the new kvm-76 (upgrading from kvm-74) and I have a few issues.
I am running Ubuntu 8.04 (Hardy) as my host and Windows XP as my guest. I am using VT-d and the kernel modules loaded correctly.

Here is the command I use to start kvm:
kvm-bridge -hda windows2.img -boot c -m 1000 -serial /dev/ttyUSB0 -serial file:serial.out -smp 2 -usb -usbdevice "tablet" -full-screen -cdrom /dev/cdrom

kvm-bridge is a script that configures my network and passes the other options straight through to qemu-system-x86_64

1) what is the difference between running qemu-system-x86_64 and kvm directly? Because, when I run kvm directly, I get this error:
Traceback (most recent call last):
File "/home/malonem/kvm-76/kvm", line 20, in <module>
external_module = config.get('shell', 'want_module')
File "/usr/lib/python2.5/ConfigParser.py", line 511, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'shell'

2) (this has been around for quite some time, I just haven't done anything about it) Even though I start up with -smp 2, windows only reads 1 cpu

3) When I run it using the --std-vga parameter, windows boots to just before it gets to the "welcome" screen and hangs. The output shows a multitude of "kvm: get_dirty_pages returned -2" Is this something to do with the kernel version I am using? I am using the standard Ubuntu Hardy Kernel 2.6.24-19-generic. I read the release notes about the kernel version with kvm-76 but didn't really understand them and presumed that I am using the kernel modules supplied with kvm. (I rmmod'd kvm-intel and kvm before I compiled and installed, then modprobe'd the modules afterwards and everything seemed to go ok)

Any help or insight would be much appreciated,

Michael

=======================================================================
This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email.
Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission.
=======================================================================

#1 lore raw

I can confirm problems with --std-vga.

I had 4 running win xp sp3 guest with --std-vga (KVM-75).
Now, after upgrading to KVM-76 the screen goes black, just before the "welcome" and hangs.

Im using a 2.6.24 kernel (Debian 64)

Best Regards,

Martin Maurer

[email protected]
http://www.proxmox.com

Quoted 66 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael Malone
Sent: Sonntag, 28. September 2008 23:45
To: kvm mailing list
Subject: kvm-76 --std-vga problem

Hi Everyone,

I just downloaded and ran the new kvm-76 (upgrading from kvm-74) and I have a few issues.
I am running Ubuntu 8.04 (Hardy) as my host and Windows XP as my guest. I am using VT-d and the kernel modules loaded correctly.

Here is the command I use to start kvm:
kvm-bridge -hda windows2.img -boot c -m 1000 -serial /dev/ttyUSB0

(quoted diff) +0 -2
-serial file:serial.out -smp 2 -usb -usbdevice "tablet" -full-screen
-cdrom /dev/cdrom

kvm-bridge is a script that configures my network and passes the other options straight through to qemu-system-x86_64

1) what is the difference between running qemu-system-x86_64 and kvm directly?
Because, when I run kvm directly, I get this error:
Traceback (most recent call last):
File "/home/malonem/kvm-76/kvm", line 20, in <module>
external_module = config.get('shell', 'want_module')
File "/usr/lib/python2.5/ConfigParser.py", line 511, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'shell'

2) (this has been around for quite some time, I just haven't done anything about it)
Even though I start up with -smp 2, windows only reads 1 cpu

3) When I run it using the --std-vga parameter, windows boots to just before it gets to the "welcome" screen and hangs. The output shows a multitude of "kvm: get_dirty_pages returned -2" Is this something to do with the kernel version I am using? I am using the standard Ubuntu Hardy Kernel 2.6.24-19-generic. I read the release notes about the kernel version with kvm-76 but didn't really understand them and presumed that I am using the kernel modules supplied with kvm. (I rmmod'd kvm-intel and kvm before I compiled and installed, then modprobe'd the modules afterwards and everything seemed to go ok)

Any help or insight would be much appreciated,

Michael

=======================================================================
This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Michael Malone
Quoted 15 lines · Michael Malone

Hi Everyone,

I just downloaded and ran the new kvm-76 (upgrading from kvm-74) and I have a few issues.
I am running Ubuntu 8.04 (Hardy) as my host and Windows XP as my guest. I am using VT-d and the kernel modules loaded correctly.

Here is the command I use to start kvm:
kvm-bridge -hda windows2.img -boot c -m 1000 -serial /dev/ttyUSB0

(quoted diff) +0 -2
-serial file:serial.out -smp 2 -usb -usbdevice "tablet" -full-screen
-cdrom /dev/cdrom

kvm-bridge is a script that configures my network and passes the other options straight through to qemu-system-x86_64

Quoted 9 lines

1) what is the difference between running qemu-system-x86_64 and kvm directly?
Because, when I run kvm directly, I get this error:
Traceback (most recent call last):
File "/home/malonem/kvm-76/kvm", line 20, in <module>
external_module = config.get('shell', 'want_module')
File "/usr/lib/python2.5/ConfigParser.py", line 511, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'shell'

That's a python qemu wrapper (which is unfortunately named kvm). That is not the same as the kvm binary which most distros install. You'll want to use the qemu-system-x86_64 binary in the qemu/x86_64-softmmu dir if you want to run directly from the source dir. But it looks like you've already installed it to the system, so I wouldn't bother.

Quoted 4 lines

2) (this has been around for quite some time, I just haven't done anything about it)
Even though I start up with -smp 2, windows only reads 1 cpu

You probably installed the guest with -smp 1. In which case, XP would have installed the Uniprocessor HAL. You'd have to change that out or reinstall the guest to be able to use more than one CPU.

Quoted 10 lines

3) When I run it using the --std-vga parameter, windows boots to just before it gets to the "welcome" screen and hangs. The output shows a multitude of "kvm: get_dirty_pages returned -2" Is this something to do with the kernel version I am using? I am using the standard Ubuntu Hardy Kernel 2.6.24-19-generic. I read the release notes about the kernel version with kvm-76 but didn't really understand them and presumed that I am using the kernel modules supplied with kvm. (I rmmod'd kvm-intel and kvm before I compiled and installed, then modprobe'd the modules afterwards and everything seemed to go ok)

I don't know about this, but it seems that someone else verified, so hopefully the devs will be on it soon.

Quoted 4 lines

Any help or insight would be much appreciated,

Michael

#3 lore raw
In reply to Michael Malone
Quoted 8 lines · Michael Malone

2) (this has been around for quite some time, I just haven't done anything about it)
Even though I start up with -smp 2, windows only reads 1 cpu

3) When I run it using the --std-vga parameter, windows boots to just before it gets to the "welcome" screen and hangs. The output shows a multitude of "kvm: get_dirty_pages returned -2" Is this something to do with the kernel version I am using? I am using the standard Ubuntu Hardy Kernel

No. It's a regression introduced in last version. It should work using cirrus vga (can you confirm, please?)

It happens because for the specific range std vga is relying the memory will be, it do a cpu_register_physical_mem(). When kvm tries to create a new piece of memory in this place, it's marked as already existant.

There are some quick hacks, but I'll be trying to work on a proper fix in the following days.

Signature · 5 lines
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."
#4 lore raw
Quoted 14 lines · Glauber Costa
Quoted 8 lines · Michael Malone

2) (this has been around for quite some time, I just haven't done anything about it)
Even though I start up with -smp 2, windows only reads 1 cpu

3) When I run it using the --std-vga parameter, windows boots to just before it gets to the "welcome" screen and hangs. The output shows a multitude of "kvm: get_dirty_pages returned -2" Is this something to do with the kernel version I am using? I am using the standard Ubuntu Hardy Kernel

No. It's a regression introduced in last version. It should work using cirrus vga (can you confirm, please?)

Quoted 7 lines

It happens because for the specific range std vga is relying the memory will be, it do a cpu_register_physical_mem(). When kvm tries to create a new piece of memory in this place, it's marked as already existant.

There are some quick hacks, but I'll be trying to work on a proper fix in the following days.

This is a band aid, but proves the general idea. Can you confirm that it fixes the problem for you ?

Signature · 5 lines
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."
libkvm/libkvm.c +18 -2
index dfa63bb..6abb3b9 100644
@@ -399,8 +399,7 @@ int kvm_create(kvm_context_t kvm, unsigned long phys_mem_bytes, void **vm_mem)
 	return 0;
 }
 
-
-void *kvm_create_phys_mem(kvm_context_t kvm, unsigned long phys_start,
+void *kvm_set_phys_mem(kvm_context_t kvm, unsigned long phys_start,
 			  unsigned long len, int log, int writable)
 {
 	int r;
@@ -441,6 +440,23 @@ void *kvm_create_phys_mem(kvm_context_t kvm, unsigned long phys_start,
         return ptr;
 }
 
+void *kvm_create_phys_mem(kvm_context_t kvm, unsigned long phys_start,
+			  unsigned long len, int log, int writable)
+{
+	int slot = get_container_slot(phys_start, len);
+	int flags = log ? KVM_MEM_LOG_DIRTY_PAGES : 0;
+
+	if (slot == -1) {
+		return kvm_set_phys_mem(kvm, phys_start, len, log, writable);
+	}
+	if (slots[slot].flags == flags) {
+		return slots[slot].userspace_addr;
+	} else {
+		kvm_destroy_phys_mem(kvm, phys_start, len);
+		return kvm_set_phys_mem(kvm, phys_start, len, log, writable);
+	}
+}
+
 int kvm_register_phys_mem(kvm_context_t kvm,
 			  unsigned long phys_start, void *userspace_addr,
 			  unsigned long len, int log)
#5 lore raw
In reply to Michael Malone
Quoted 4 lines · Michael Malone

1) what is the difference between running qemu-system-x86_64 and kvm directly? Because, when I run kvm directly, I get this error:

The kvm script was mostly a development tool. I don't actually use it anymore. The main drawback is that you have to teach it about all qemu options, and there are many; the only value it provides is reloading the module (useful when you make changes), and not requiring the bios to be installed.

Quoted 2 lines

2) (this has been around for quite some time, I just haven't done anything about it) Even though I start up with -smp 2, windows only reads 1 cpu

What HAL does Windows use? (Device Manager, properties on the Computer object)

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
#6 lore raw
Quoted 6 lines · Avi Kivity
Quoted 4 lines · Michael Malone

1) what is the difference between running qemu-system-x86_64 and kvm directly? Because, when I run kvm directly, I get this error:

Quoted 7 lines

The kvm script was mostly a development tool. I don't actually use it anymore. The main drawback is that you have to teach it about all qemu options, and there are many; the only value it provides is reloading the module (useful when you make changes), and not requiring the bios to be installed.

Quoted 2 lines

2) (this has been around for quite some time, I just haven't done anything about it) Even though I start up with -smp 2, windows only reads 1 cpu

What HAL does Windows use? (Device Manager, properties on the Computer object)

Yes, Glauber Costa pointed that one out to me. It is using the Uniprocessor HAL and I am about to re-install Windows to get around that one. Thanks though!

Michael

=======================================================================
This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email.
Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission.
=======================================================================