lkml.org 
[lkml]   [2022]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 09/14] PCI: portdrv: Suppress kernel DMA ownership auto-claiming
    Date
    If a switch lacks ACS P2P Request Redirect, a device below the switch can
    bypass the IOMMU and DMA directly to other devices below the switch, so
    all the downstream devices must be in the same IOMMU group as the switch
    itself. The existing vfio framework allows the portdrv driver to be bound
    to the bridge while its downstream devices are assigned to user space.
    The pci_dma_configure() marks the iommu_group as containing only devices
    with kernel drivers that manage DMA. Avoid this default behavior for the
    portdrv driver in order for compatibility with the current vfio policy.

    Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
    Suggested-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
    ---
    drivers/pci/pcie/portdrv_pci.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
    index 35eca6277a96..2116f821c005 100644
    --- a/drivers/pci/pcie/portdrv_pci.c
    +++ b/drivers/pci/pcie/portdrv_pci.c
    @@ -202,6 +202,8 @@ static struct pci_driver pcie_portdriver = {

    .err_handler = &pcie_portdrv_err_handler,

    + .no_kernel_api_dma = true,
    +
    .driver.pm = PCIE_PORTDRV_PM_OPS,
    };

    --
    2.25.1
    \
     
     \ /
      Last update: 2022-01-04 02:59    [W:4.201 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site