Skip to contentSkip to conversation

PCI BARs from dom0

DISCUSSION laurel 2 participants 3 messages May 22, 2008

lore
Share & tools
lore

laurel

author
#0 lore raw

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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

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: [email protected] [mailto:[email protected]] On Behalf Of laurel
Sent: Thursday, May 22, 2008 18:16 PM
To: [email protected]
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
[email protected]
http://lists.xensource.com/xen-devel

author
#2 lore raw

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:[email protected]]
Sent: Thursday, May 22, 2008 11:56 AM
To: laurel; [email protected]
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: [email protected] [mailto:[email protected]] On Behalf Of laurel
Sent: Thursday, May 22, 2008 18:16 PM
To: [email protected]
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
[email protected]
http://lists.xensource.com/xen-devel