From: "laurel" Subject: RE: PCI BARs from dom0 Date: Thu, 22 May 2008 13:30:07 -0400 Message-ID: References: <8ACA1B3AF18043BD89A98472AC4D7B19@Slap> <9392A06CB0FDC847B3A530B3DC174E7B053C0E36@mse10be1.mse10.exchange.ms> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1018922692==" Return-path: In-Reply-To: <9392A06CB0FDC847B3A530B3DC174E7B053C0E36@mse10be1.mse10.exchange.ms> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: 'Barak Fargoun' Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============1018922692== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0056_01C8BC0F.F60C4630" This is a multi-part message in MIME format. ------=_NextPart_000_0056_01C8BC0F.F60C4630 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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@neocleus.com] Sent: Thursday, May 22, 2008 11:56 AM To: laurel; xen-devel@lists.xensource.com 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@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of laurel Sent: Thursday, May 22, 2008 18:16 PM To: xen-devel@lists.xensource.com 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 ------=_NextPart_000_0056_01C8BC0F.F60C4630 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I am trying to get pass-through to work with = various=20 devices.  The issue I am seeing is that QEMU sets the p2m mappings = for domU=20 using libpci:pci_dev.base_addr[] which originate from /sys/.../resource = which=20 are not always the actual values in the BARs. Some PCI device=20 memory regions are inaccessible from domU due to the=20 mis-mapping.  I modified QEMU:register_real_device()  to call=20 pci_fill_info() which updates base_addr[] to the real BARs.  This=20 allows all the PCI device memory regions to be mapped properly and = accessed=20 from domU.  However, the new 'correct' mappings break the NIC=20 pass-through.  I have verified that the new p2m mappings correspond = to the=20 real BARs.
 
Can someone clearly walk me through the BAR = handling and=20 how it is supposed to work?  Why does sysfs report different = values? =20 Does dom0 use guest physical addresses instead of machine=20 addresses?  Why does libpci 'cache' config BARs=20 in base_addr[]?
 
-=20 steve
 


From: Barak Fargoun=20 [mailto:barak@neocleus.com]
Sent: Thursday, May 22, 2008 = 11:56=20 AM
To: laurel; = xen-devel@lists.xensource.com
Subject: RE:=20 [Xen-devel] PCI BARs from dom0

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

 

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

 

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

 

-=20 steve

 

------=_NextPart_000_0056_01C8BC0F.F60C4630-- --===============1018922692== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1018922692==--