Skip to contentSkip to conversation

pv/pciback-2.6.32

GIT PULL Konrad Rzeszutek Wilk 1 participant 1 message Mar 9, 2010

lore
Share & tools
lore
#0 lore raw

Hey Jeremy

Please pull the pv/pciback-2.6.32 branch which has the back-port of the PCI backend drivers to complement the PCI front-end driver.

git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
pv/pciback-2.6.32

As in the past, I've also done a merge with xen/next, which is in the pv/merge.xen.next, since the merge is bit hairy (again!?)

I've tested this with MSI and IRQ devices where the PCI frontend and PCI backend are both xen/next.

Bugs:
- There are three different PCI backend choices: Passthrough, Slot and Virtual PCI. There is not need for all of them on X86. Will remove two soon.

How to use it:

[copy-n-paste from xen/docs/misc/vtd.txt of the appropiate section]

Title : How to do PCI Passthrough with VT-d
Authors : Allen Kay <[email protected]>
Weidong Han <[email protected]> Yuji Shimada <[email protected]>
Created : October-24-2007
Updated : July-07-2009

How to turn on VT-d in Xen
--------------------------

Xen with 2.6.32 dom0:
1 ) git clone git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git pv/merge.xen.next 3 ) cd xen.git; make menuconfig
4 ) change XEN->"PCI-device backend driver" from "M" to "*".
5 ) make all
6 ) make install && make modules_install
10) lspci - select the PCI BDF you want to assign to guest OS
11) If you see device which BAR's is not aligned you can use the 'pci=resource_alignmnet=<BDF"' command line to make it page aligned.
11) "hide" pci device from dom0 as following sample grub entry:

title Xen-Fedora Core (2.6.32-xen)

        root (hd0,0)
        kernel /boot/xen.gz com1=115200,8n1 console=com1 iommu=1
        module /boot/vmlinuz-2.6.32 root=LABEL=/ ro console=hvc0 xen-pciback.hide=(07:00.0)(08:05.0)(08:07.0)(08:07.2) pci=resource_alignment=08:05.0
        module /boot/initrd-2.6.32.img

    or use dynamic hiding via PCI backend sysfs interface:
        a) check if the driver has binded to the device
            ls -l /sys/bus/pci/devices/0000:01:00.0/driver
            ... /sys/bus/pci/devices/0000:01:00.0/driver -> ../../../../bus/pci/drivers/igb
        b) if yes, then unload the driver first
            echo -n 0000:01:00.0 >/sys/bus/pci/drivers/igb/unbind
        c) add the device to the PCI backend
            echo -n 0000:01:00.0 >/sys/bus/pci/drivers/pciback/new_slot
        d) let the PCI backend bind to the device
            echo -n 0000:01:00.0 >/sys/bus/pci/drivers/pciback/bind

12) reboot system (not requires if you use the dynamic hiding method)
13) add "pci" line in /etc/xen/pv.conf for to assigned devices

        pci = [ '01:00.0', '03:00.0' ]

15) start PV guest and use "lspci" to see the passthru device and "ifconfig" to see if IP address has been assigned to NIC devices.

[ rest is cut off since it talks about HVM/VT-D which is not the point of this patch ]