Skip to content

Commit 18c7a34

Browse files
LuBaolujoergroedel
authored andcommitted
PCI: pci_stub: Set driver_managed_dma
The current VFIO implementation allows pci-stub driver to be bound to a PCI device with other devices in the same IOMMU group being assigned to userspace. The pci-stub driver has no dependencies on DMA or the IOVA mapping of the device, but it does prevent the user from having direct access to the device, which is useful in some circumstances. The pci_dma_configure() marks the iommu_group as containing only devices with kernel drivers that manage DMA. For compatibility with the VFIO usage, avoid this default behavior for the pci_stub. This allows the pci_stub still able to be used by the admin to block driver binding after applying the DMA ownership to VFIO. Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 512881e commit 18c7a34

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pci/pci-stub.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static struct pci_driver stub_driver = {
3636
.name = "pci-stub",
3737
.id_table = NULL, /* only dynamic id's */
3838
.probe = pci_stub_probe,
39+
.driver_managed_dma = true,
3940
};
4041

4142
static int __init pci_stub_init(void)

0 commit comments

Comments
 (0)