Loading drivers/iommu/iommu.c +6 −2 Original line number Diff line number Diff line Loading @@ -731,13 +731,17 @@ static int get_pci_alias_or_group(struct pci_dev *pdev, u16 alias, void *opaque) * Use standard PCI bus topology, isolation features, and DMA alias quirks * to find or create an IOMMU group for a device. */ static struct iommu_group *iommu_group_get_for_pci_dev(struct pci_dev *pdev) struct iommu_group *pci_device_group(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct group_for_pci_data data; struct pci_bus *bus; struct iommu_group *group = NULL; u64 devfns[4] = { 0 }; if (WARN_ON(!dev_is_pci(dev))) return ERR_PTR(-EINVAL); /* * Find the upstream DMA alias for the device. A device must not * be aliased due to topology in order to have its own IOMMU group. Loading Loading @@ -827,7 +831,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) if (ops && ops->device_group) group = ops->device_group(dev); else if (dev_is_pci(dev)) group = iommu_group_get_for_pci_dev(to_pci_dev(dev)); group = pci_device_group(dev); if (IS_ERR(group)) return group; Loading include/linux/iommu.h +3 −0 Original line number Diff line number Diff line Loading @@ -317,6 +317,9 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain, return domain->ops->map_sg(domain, iova, sg, nents, prot); } /* PCI device grouping function */ extern struct iommu_group *pci_device_group(struct device *dev); #else /* CONFIG_IOMMU_API */ struct iommu_ops {}; Loading Loading
drivers/iommu/iommu.c +6 −2 Original line number Diff line number Diff line Loading @@ -731,13 +731,17 @@ static int get_pci_alias_or_group(struct pci_dev *pdev, u16 alias, void *opaque) * Use standard PCI bus topology, isolation features, and DMA alias quirks * to find or create an IOMMU group for a device. */ static struct iommu_group *iommu_group_get_for_pci_dev(struct pci_dev *pdev) struct iommu_group *pci_device_group(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct group_for_pci_data data; struct pci_bus *bus; struct iommu_group *group = NULL; u64 devfns[4] = { 0 }; if (WARN_ON(!dev_is_pci(dev))) return ERR_PTR(-EINVAL); /* * Find the upstream DMA alias for the device. A device must not * be aliased due to topology in order to have its own IOMMU group. Loading Loading @@ -827,7 +831,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) if (ops && ops->device_group) group = ops->device_group(dev); else if (dev_is_pci(dev)) group = iommu_group_get_for_pci_dev(to_pci_dev(dev)); group = pci_device_group(dev); if (IS_ERR(group)) return group; Loading
include/linux/iommu.h +3 −0 Original line number Diff line number Diff line Loading @@ -317,6 +317,9 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain, return domain->ops->map_sg(domain, iova, sg, nents, prot); } /* PCI device grouping function */ extern struct iommu_group *pci_device_group(struct device *dev); #else /* CONFIG_IOMMU_API */ struct iommu_ops {}; Loading