Pass through in Xen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 7 lines · On Thu, Jul 20, 2017 at 12:06:18PM +0530, ajmalmalib4u wrote:
Hi,Quoted 1 line
Quoted 1 line
Quoted 1 line
Can anyone please explain or point me to a thread where I can read
about
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
the internals of PCI passthrough or How passthrough actually works?
For PV:
Quoted 8 lines
Quoted 2 lines
I tried going through the source code but I'am unable to derive a flow of control through the drivers.
Is there any source which can explain the behavior of these drivers elaborately?
How are xen-pciback and xen-pcifront utilizing the PCI functions offered by Linux?
No, I'm afraid there's no other source of documentation for Xen pciback/pcifront in Linux. There's also a pciback/pcifront implementation in NetBSD, you might find that one easier to understand:
http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/arch/xen/xen/pciback.c?rev=1.12&content-type=text/plain
http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/arch/xen/xen/xpci_xenbus.c?rev=1.14.10.1&content-type=text/plain
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · On Tue, Jul 25, 2017 at 05:59:04PM +0530, ajmalmalib4u wrote:
Hi,
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I have successfully tested a PCI device in my PC.
As per my current understanding, the control flow for PCI passthroughis
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
“xen-pcifront -> xen-pciback -> driver”. Is this correct?
That's for PV guests, and only for accesses to the PCI config space. Device MMIO regions are mapped directly into DomU.
I am using PV guests.
Where does the PCI MMIO gets mapped to DomU? Is it done by the front and back drivers?
I don't think so, AFAIK (and I'm not expert in PV passthrough), the toolstack sets the permissions of the DomU to allow it to map MMIO regions that belong to the device (see do_pci_add in libxl_pci.c), and then the DomU itself establishes the mappings using the PV MMU interface.
Quoted 2 lines
Or Is the mapping only happening at the hardware level where IOMMU handles it without Dom0's or DomU's knowledge?
How's that possible? IOMMU needs to know the GFN -> MFN relation, so some entity in the system has to program it.
Quoted 4 lines
If possible, could you please point me to the right source file or block of code in Xen source which handles this mapping of PCI memory regions? Also, Does the normal PCI driver in the Linux kernel plays any role in PCI passthrough?
Yes, the native Linux driver is still used. Pcifront is only used as a different mechanism to access the configuration space, but that's just it, it's just a different transport than writing to IO ports or MMCFG areas.
Quoted 3 lines
Or Is it the front and back drivers, that does all of it?
Does the front and back drivers access the PCI driver in the Linux kernel at any point?
No, the flow is the following:
Config space Shared ring
Native driver +--------> pcifront +-------> pciback
+
|
| BAR access
+-----------------> MMIORoger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel