Bug 494376

Summary: qemu-kvm -vga std fails because of ROM space increase patch
Product: [Fedora] Fedora Reporter: Tom London <selinux>
Component: qemuAssignee: Glauber Costa <gcosta>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: rawhideCC: dwmw2, gcosta, markmc, moneta.mace, phuang, sergei.litvinenko, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-21 08:53:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 480593    

Description Tom London 2009-04-06 16:33:53 UTC
Description of problem:
After upgrading from qemu-*-0.10-0.12.kvm20090323git.fc11.x86_64 to qemu-*-0.10-6.fc11.x86_64, my WinXP images no longer run:

alias kvm='qemu-kvm -localtime -vga std -m 512 -usbdevice tablet -name "Windows XP" -hda ~/VirtualMachines/raw.img -k en-us'


[tbl@tlondon ~]$ kvm
create_userspace_phys_mem: Invalid argument
kvm_cpu_register_physical_memory: failed
[tbl@tlondon ~]$ 

"Reverting" to qemu-*-0.10-3.fc11.x86_64 makes it "work for me"

System is Rawhide, Thinkpad X200.  No issues before the update.

See no messages in /var/log/messages nor in ~/.xsession-errors.


Version-Release number of selected component (if applicable):
qemu-common-0.10-[456].fc11.x86_64
qemu-system-x86-0.10-[456].fc11.x86_64
qemu-img-0.10-[456].fc11.x86_64
qemu-kvm-tools-0.10-[456].fc11.x86_64


How reproducible:
Every time.

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Tom London 2009-04-06 16:52:55 UTC
Forgot to include: running kernel-2.6.29.1-52.fc11.x86_64

Comment 2 Mark McLoughlin 2009-04-06 17:23:06 UTC
Okay, 0.10-4 was the change to increase the ROM space:

* Thu Apr 02 2009 Glauber Costa <glommer> - 2:0.10-4
- Support botting gpxe roms.

Comment 3 Sergei LITVINENKO 2009-04-06 18:19:01 UTC
Emulation video-cards vga and vmware cause start virtual machine problem

==
root# qemu-kvm -localtime -vga std -hda centos-5.img -boot c -net nic,macaddr=52:54:00:12:34:C5,model=e1000 -net tap -m 2047
===

cause error message:

---
create_userspace_phys_mem: Invalid argument
kvm_cpu_register_physical_memory: failed
---

Emulation of "cirrus" card is much better, but text console inside virtual machine is buggy. Scrolling do not work correct.

Try to login into text console and press <enter> more as 25 times. Cursor will leave view area.

`clear` or `reset` can return the cursor inside of view area


[root@homedesk QEMU]# rpm -qf `which qemu-kvm`
qemu-system-x86-0.10-6.fc11.i586

[root@homedesk QEMU]# uname -r
2.6.29.1-46.fc11.i686.PAE

Comment 4 Glauber Costa 2009-04-07 02:05:39 UTC
this has nothing to do with windows xp.

Actually, I've already tracked it down (thanks for the report!), and the issue
seems related to -vga std option. I have a patch ready, will send upstream in a while.

thanks for reporting this!

Comment 5 Mark McLoughlin 2009-04-09 14:42:10 UTC
Glauber's patch for this is here:

http://www.mail-archive.com/kvm@vger.kernel.org/msg12644.html

Glauber - this looks fairly non-invasive ... if we're going to carry the "give ROMs more room" patch for F-11, it makes sense to pull this in too

Comment 6 Tom London 2009-04-09 16:33:15 UTC
I noticed qemu-img-0.10-7.fc11.x86_64 in koji; downloaded/installed.

It does not fix the issue for me:

[tbl@tlondon ~]$ qemu-kvm -localtime -vga std -m 512 -usbdevice tablet -name "Windows XP" -hda ~/VirtualMachines/raw.img -k en-us
create_userspace_phys_mem: Invalid argument
kvm_cpu_register_physical_memory: failed
[tbl@tlondon ~]$ rpm -qa qemu\*
qemu-img-0.10-7.fc11.x86_64
qemu-kvm-tools-0.10-7.fc11.x86_64
qemu-common-0.10-7.fc11.x86_64
qemu-system-x86-0.10-7.fc11.x86_64
[tbl@tlondon ~]$ 

Reverting back to qemu-*-0.10-3.fc11.x86_64 .....

Comment 7 Tom London 2009-04-11 15:42:10 UTC
Realize I haven't provided much info here...

Anything else I can do/provide to help this along?

Comment 8 Sergei LITVINENKO 2009-04-12 12:30:28 UTC
As I know, original version from official site http://sourceforge.net/project/showfiles.php?group_id=180599 do not crash with "-vga std" parameter.

Comment 9 Tom London 2009-04-15 13:31:59 UTC
Just FYI, this continues to fail with qemu-*-0.10-8.fc11.x86_64 as above.....

Comment 10 Tom London 2009-04-15 14:15:31 UTC
For the record:

[tbl@tlondon ~]$ rpm -qa qemu\*
qemu-system-ppc-0.10-8.fc11.x86_64
qemu-img-0.10-8.fc11.x86_64
qemu-system-x86-0.10-8.fc11.x86_64
qemu-common-0.10-8.fc11.x86_64
qemu-kvm-tools-0.10-8.fc11.x86_64
[tbl@tlondon ~]$ qemu-kvm -localtime -vga std -m 512 -usbdevice tablet -name "Windows XP" -hda ~/VirtualMachines/raw.img -k en-us
create_userspace_phys_mem: Invalid argument
kvm_cpu_register_physical_memory: failed
[tbl@tlondon ~]$ 

On the other hand, Fedora iso seems to work just fine:

[tbl@tlondon VirtualMachines]$ qemu-kvm -m 512 -cdrom Fedora-11-Snap1-x86_64-Live.iso -boot d
[tbl@tlondon VirtualMachines]$ 

The only message I see in /var/log/messages is:

Apr 15 07:07:56 tlondon kernel: kvm: 12797: cpu0 unhandled wrmsr: 0xc0010117 data 0


Reverting back to 0.10-3 "fixes", but "adds" one more message in /var/log/messages:

Apr 15 07:11:55 tlondon kernel: kvm: 20256: cpu0 unhandled wrmsr: 0xc0010117 data 0
Apr 15 07:12:05 tlondon kernel: kvm: emulating exchange as write

Comment 11 Sergei LITVINENKO 2009-04-16 18:31:43 UTC
http://www.mail-archive.com/kvm@vger.kernel.org/msg12644.html

OK, it works for me :)

I have used http://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/qemu-0.10-8.fc11.src.rpm as base and this patch.

sh ./qemu-kvm -localtime -vga std -hda centos-5.img -boot c -m 2047

Good result.

PS: I'm waiting for this modification in next version of qemu-kvm

Comment 12 Tom London 2009-04-16 23:25:24 UTC
I can confirm: a local build with the 2047->4095 patch above makes 0.10-8 "work for me".

Comment 13 Mark McLoughlin 2009-04-19 10:32:34 UTC
*** Bug 495449 has been marked as a duplicate of this bug. ***

Comment 14 Mark McLoughlin 2009-04-19 12:18:58 UTC
Okay, AFAICS, this commit on the unstable branch upstream fixes the issue:

http://git.kernel.org/?p=virt/qemu/qemu.git;a=commitdiff;h=f753ff16382643e4e8917d36d07c41ba8705af21

The key part is this:

+    cpu_register_physical_memory(0xc0000, 0x20000,
+                                 option_rom_offset | IO_MEM_ROM);
+

Now the entire 128kb region is being registered at once, meaning it is naturally 4k aligned for KVM's memory registration.

This code is a bit too invasive for this stage of F11, and it's our qemu-roms-more-room.patch which is causing the problem anyway ... so, I've gone ahead and built with Glauber's original simple patch:

  http://www.mail-archive.com/kvm@vger.kernel.org/msg12644.html

Tom, Sergei, Peng - could one of you try it out and confirm it fixes the problem for you?

  https://koji.fedoraproject.org/koji/buildinfo?buildID=98616

Comment 15 Tom London 2009-04-19 16:34:18 UTC
I can confirm that qemu-*-0.10-10.fc11.x86_64 from koji "works for me".

Comment 16 Sergei LITVINENKO 2009-04-20 11:00:57 UTC
I can confirm that qemu-*-0.10-9.fc11.i586.rpm from http://koji.fedoraproject.org/koji/buildinfo?buildID=98616 with "-vga std" works for me correct.

[root@homedesk QEMU]# rpm -qa | grep qemu

qemu-img-0.10-9.fc11.i586
qemu-common-0.10-9.fc11.i586
qemu-system-x86-0.10-9.fc11.i586

Comment 17 Peng Huang 2009-04-21 08:18:48 UTC
Using the qemu-system-x86-0.10-10 with -vga std. I can boot winxp in safe mode successfully. But can not boot winxp in normal mode.

Comment 18 Mark McLoughlin 2009-04-21 08:53:00 UTC
Many thanks Peng, Sergei and Tom

qemu-0.10-11.fc11 now tagged in dist-f11