WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] PCI BARs from dom0

To: "'Barak Fargoun'" <barak@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] PCI BARs from dom0
From: "laurel" <laurel@xxxxxxx>
Date: Thu, 22 May 2008 13:30:07 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 22 May 2008 10:31:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <9392A06CB0FDC847B3A530B3DC174E7B053C0E36@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <8ACA1B3AF18043BD89A98472AC4D7B19@Slap> <9392A06CB0FDC847B3A530B3DC174E7B053C0E36@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aci8HrAWMpLcHZ7xTb2KZiuST42D3AABYFsgAANFdLA=
I am trying to get pass-through to work with various devices.  The issue I am seeing is that QEMU sets the p2m mappings for domU using libpci:pci_dev.base_addr[] which originate from /sys/.../resource which are not always the actual values in the BARs. Some PCI device memory regions are inaccessible from domU due to the mis-mapping.  I modified QEMU:register_real_device()  to call pci_fill_info() which updates base_addr[] to the real BARs.  This allows all the PCI device memory regions to be mapped properly and accessed from domU.  However, the new 'correct' mappings break the NIC pass-through.  I have verified that the new p2m mappings correspond to the real BARs.
 
Can someone clearly walk me through the BAR handling and how it is supposed to work?  Why does sysfs report different values?  Does dom0 use guest physical addresses instead of machine addresses?  Why does libpci 'cache' config BARs in base_addr[]?
 
- steve
 


From: Barak Fargoun [mailto:barak@xxxxxxxxxxxx]
Sent: Thursday, May 22, 2008 11:56 AM
To: laurel; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] PCI BARs from dom0

This might be related to the fact that ‘lspci –v’ the values which the OS has seen and configured, and ‘lspci –x’ shows the actual values which resides now in the values.

 

From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of laurel
Sent: Thursday, May 22, 2008 18:16 PM
To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] PCI BARs from dom0

 

Lspci -v and -x show different values for various PCI BARs in my system.  It appears that reading 'resource' and 'config' from sysfs in dom0 yields the differing data.  The 'config' data matches what is actually programmed into the BARs.  Why are these different?

 

- steve

 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>