Splitting a multi-function PCI device between guests with VFIO?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I'm updating my dev environment to use the shiny new vfio
infrastructure for PCI assignment to kvm guests, and I'm not able to
do what I used to do with the old-school KVM passthrough.  In
particular, I have, say, a two-port QLogic adapter that looks like:

    82:00.0 0200: 1077:8030 (rev 02)
    82:00.1 0200: 1077:8030 (rev 02)
    82:00.2 0c04: 1077:8031 (rev 02)
    82:00.3 0c04: 1077:8031 (rev 02)
    82:00.4 0280: 1077:8032 (rev 02)
    82:00.5 0280: 1077:8032 (rev 02)

that is, each port gets three different PCI functions (one for NIC,
one for FCoE and one for iSCSI).

I used to be able to assign 82:00.2 to one VM and 82:00.3 to a
different VM by binding those devices to pci_stub and using "-device
pci-assign,host=82:00.2" and "-device pci-assign,host=82:00.3" on my
respective QEMU command lines.  (That let me have an initiator and
target in separate VMs with one adapter in one dev system)

However, all of those PCI devices have the same iommu_group, so now if
I bind the devices to vfio-pci and do "s/pci-assign/vfio-pci/", the
second QEMU to start fails with something like

    qemu-system-x86_64: -device vfio-pci,host=82:00.3: vfio: error
opening /dev/vfio/41: Device or resource busy
    qemu-system-x86_64: -device vfio-pci,host=82:00.3: vfio: failed to
get group 41
    qemu-system-x86_64: -device vfio-pci,host=82:00.3: Device
initialization failed.
    qemu-system-x86_64: -device vfio-pci,host=82:00.3: Device
'vfio-pci' could not be initialized

Is there a way to split multi-function devices (with the same
iommu_group) between VMs with vfio?

Thanks!
  Roland
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux