[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] ioemu: add libpci fixup to handle recent change in PCIUtils



On Sat, Feb 28, 2009 at 07:12:38PM +0800, Alexia Benington wrote:
> Hi,
> 
> Apologies for the delay. I was trying to trace through the mappings
> myself. It seems the incorrect mappings are not necessarily due to
> this patch, but I'm still unable to figure out why there's a
> misalignment in the port mapping.

According to the Qemu log, the I/O region of 01:00.0 has PIO address
0xc000 in the dom0, which is the host physical address (i.e. the value
in the device BAR). And the 0xc200 is guest physical address emulated
by Qemu by creating P2M mapping via hypercall. The `passthrough' doesn't
mean guest really can change PCI config space of device. Actually Qemu
emulates most of CSRs :-)

HPA of a BAR is not changed during device passthrough while GPA can
be any value programmed by guest firmware and OS. The 0xc200 was
allocated by guest BIOS and is size aligned (256 byte aligned).
So there is nothing wrong with it.

> I've attached the lspci outputs for the 2 devices I was tinkering
> with, although it was mostly 01:00.0. There's also an lspci-like
> output in the Windows guest for reference.
> 
> I also noticed that some of the registers are being emulated rather
> than passed through. I'm wondering if this will affect the
> functionality of the device in the guest.

Yes, we can't let guest directly access some CSRs due to architectural
and security reasons. Some devices aren't able to work due to this.
For example, legacy IDE controller using fixed PIO address won't work
if PIO address seen by guest is not equal to that fixed address.
But I'm not sure if it is the case of your VGA card. IIRC, someone
did successfully assign VGA card to guest. Maybe you could find some
clue by digging archive of this mailing list.

And I'll try to find a some VGA card same as yours and do some debug.
I'll keep you posted if I get some luck.

> By the way, is there any good way to step through qemu-dm instead of
> looking at the log? The log helps experienced Xen developers
> understand what's wrong with the system, but its quite challenging for
> a beginner, like myself, in understanding Xen implementation. If
> anyone prefers, I can start another thread on this.

Yes, the log is not so friendly. Any effort on improving it is appreciated!

Thanks,
Yu

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.