RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Leendert van Doorn
Date: Sunday, January 4, 2009 - 10:12 am

Avi wrote:


Yep. I'll create a less invasive patch. I've been looking at SEABIOS which
seems a much better alternative but the GPLv3 license worries me, especially
when you have proprietary guests that calls back into it. 


You have to initialize the PCI subsystem before you can initialize the
VGABIOS. The PCI bus scan may have discovered the primary graphics adapter
and copied its BIOS to 0xC0000. By convention the primary VGA adapter ROM
always resides at 0xC0000.

I also have a patch for the cirrus-vga emulation so that it properly
emulates the PCI ROM BAR. I'll clean that up and submit it.



The problem is that the device-assignment code doesn't update the cards
BARs, it just emulates them and maps the guest BARs onto the correct host
BARs. Unfortunately, the graphics card has undocumented interfaces for
obtaining the memory regions (faster than a full PCI lookup) and they of
course return the host mappings as opposed to the guest mappings.

My first attempt was to implement a state machine that would emulate these
interfaces and rewrite them but this got pretty ugly pretty fast. Ensuring
the same mappings was much cleaner.

Of course, my goal is to run unmodified BIOS/drivers. You could always
change the drivers.


Yes but that all depends on what the host BIOS does. Most of my experiments
have been on a Dell optiplex 755 where all the PCI BARs are allocated at the
top of the 32-bit range (I run a 64-bit host and 32-bit guest). Arguably, my
rombios patch should do more validation than it does today.


I'll clean things up and resubmit.

	Leendert


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH][v2] kvm-userspace: Load PCI option ROMs, Liu, Kechao, (Sun Dec 28, 8:51 pm)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Mon Dec 29, 1:28 am)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Liu, Kechao, (Mon Dec 29, 2:36 am)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Mon Dec 29, 2:49 am)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Shan, Haitao, (Mon Dec 29, 6:01 pm)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Tue Dec 30, 8:51 am)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Shan, Haitao, (Tue Dec 30, 7:06 pm)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Wed Dec 31, 2:28 am)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Shan, Haitao, (Fri Jan 2, 7:29 pm)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Shan, Haitao, (Sat Jan 3, 7:12 pm)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Leendert van Doorn, (Sat Jan 3, 8:54 pm)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Shan, Haitao, (Sat Jan 3, 9:58 pm)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Sun Jan 4, 3:26 am)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Leendert van Doorn, (Sun Jan 4, 10:12 am)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Sun Jan 4, 10:28 am)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Sun Jan 4, 10:29 am)
RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Leendert van Doorn, (Sun Jan 4, 10:54 am)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Kevin O'Connor, (Sun Jan 4, 11:03 am)
Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs, Avi Kivity, (Sun Jan 4, 12:51 pm)