[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] Pass through in Xen
Hi,
>> > Can anyone please explain or point me to a thread where I can read about
>> > the internals of PCI passthrough or How passthrough actually works?
>>
>> For PV:
>>
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?
Regards,
Ajmal
On 18-Jul-2017 4:53 PM, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote: On Tue, Jul 18, 2017 at 04:43:53PM +0530, ajmalmalib4u wrote:
> Hi,
>
> I am trying to learn how Passthrough works in xen. As an initial step I
> have tried to do PCI passthrough in my PC with Ubuntu 16.04 LTS (Xenial
> Xerus) as Dom0 and DomU. For that I had to rebuild the kernel to add xen
> support and with the procedure explained in,
>
> https://wiki.xenproject.org/wiki/Xen_PCI_Passthrough
Not really sure whether you need to do that anymore, I would expect
Ubuntu to ship a kernel with pcifront/pciback already enabled, at
least as modules.
> I have successfully tested a PCI device in my PC.
> As per my current understanding, the control flow for PCI passthrough is
> “xen-pcifront -> xen-pciback -> driver”. Is this correct?
That's for PV guests, and only for accesses to the PCI config space.
Device MMIO rehions are mapped directy into DomU.
For HVM guests QEMU is used instead, which emulates and forwards PCI
config space accesses from DomU to the real hardware.
> Should the Dom0 and DomU have the Driver enabled in there kernel?
Which Driver? If you mean the device driver, then yes, you need a
driver in order to operate the hardware in DomU, just as you do on
native.
It's not needed on Dom0 if you never plan to use the device on Dom0.
> Can anyone please explain or point me to a thread where I can read about
> the internals of PCI passthrough or How passthrough actually works?
For PV:
http://elixir.free-electrons.com/linux/latest/source/drivers/xen/xen-pciback
http://elixir.free-electrons.com/linux/latest/source/drivers/pci/xen-pcifront.c
For HVM:
http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt.c
http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt_config_init.c
http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt_graphics.c
http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt_msi.c
Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|