summaryrefslogtreecommitdiff
path: root/drivers/pci/pci-stub.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2022-04-18 03:49:54 +0300
committerJoerg Roedel <jroedel@suse.de>2022-04-28 16:32:20 +0300
commit18c7a349d072a222ff80598373035820c194747b (patch)
tree6523164527673abae8dedfcf2766c9d0549377a0 /drivers/pci/pci-stub.c
parent512881eacfa72c2136b27b9934b7b27504a9efc2 (diff)
downloadlinux-18c7a349d072a222ff80598373035820c194747b.tar.xz
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 <baolu.lu@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/20220418005000.897664-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/pci/pci-stub.c')
-rw-r--r--drivers/pci/pci-stub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index e408099fea52..d1f4c1ce7bd1 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -36,6 +36,7 @@ static struct pci_driver stub_driver = {
.name = "pci-stub",
.id_table = NULL, /* only dynamic id's */
.probe = pci_stub_probe,
+ .driver_managed_dma = true,
};
static int __init pci_stub_init(void)