aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-07-30 03:36:26 -0400
committerJoerg Roedel <jroedel@suse.de>2018-08-08 05:06:20 -0400
commitd88e61faad526a5850e9330c846641b91cf971e7 (patch)
tree936bfd3d693f904d1a3de9f9e51034ba0dd6329c /drivers
parent58d1131777a4b7c228267b809bd88f7be66edcfb (diff)
iommu: Remove the ->map_sg indirection
All iommu drivers use the default_iommu_map_sg implementation, and there is no good reason to ever override it. Just expose it as iommu_map_sg directly and remove the indirection, specially in our post-spectre world where indirect calls are horribly expensive. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/amd_iommu.c1
-rw-r--r--drivers/iommu/arm-smmu-v3.c1
-rw-r--r--drivers/iommu/arm-smmu.c1
-rw-r--r--drivers/iommu/exynos-iommu.c1
-rw-r--r--drivers/iommu/intel-iommu.c1
-rw-r--r--drivers/iommu/iommu.c6
-rw-r--r--drivers/iommu/ipmmu-vmsa.c1
-rw-r--r--drivers/iommu/msm_iommu.c1
-rw-r--r--drivers/iommu/mtk_iommu.c1
-rw-r--r--drivers/iommu/mtk_iommu_v1.c1
-rw-r--r--drivers/iommu/omap-iommu.c1
-rw-r--r--drivers/iommu/qcom_iommu.c1
-rw-r--r--drivers/iommu/rockchip-iommu.c1
-rw-r--r--drivers/iommu/tegra-gart.c1
-rw-r--r--drivers/iommu/tegra-smmu.c1
15 files changed, 3 insertions, 17 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 596b95c50051..a23c6a4014a5 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3192,7 +3192,6 @@ const struct iommu_ops amd_iommu_ops = {
3192 .detach_dev = amd_iommu_detach_device, 3192 .detach_dev = amd_iommu_detach_device,
3193 .map = amd_iommu_map, 3193 .map = amd_iommu_map,
3194 .unmap = amd_iommu_unmap, 3194 .unmap = amd_iommu_unmap,
3195 .map_sg = default_iommu_map_sg,
3196 .iova_to_phys = amd_iommu_iova_to_phys, 3195 .iova_to_phys = amd_iommu_iova_to_phys,
3197 .add_device = amd_iommu_add_device, 3196 .add_device = amd_iommu_add_device,
3198 .remove_device = amd_iommu_remove_device, 3197 .remove_device = amd_iommu_remove_device,
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 1d647104bccc..f1dc294f8e08 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1997,7 +1997,6 @@ static struct iommu_ops arm_smmu_ops = {
1997 .attach_dev = arm_smmu_attach_dev, 1997 .attach_dev = arm_smmu_attach_dev,
1998 .map = arm_smmu_map, 1998 .map = arm_smmu_map,
1999 .unmap = arm_smmu_unmap, 1999 .unmap = arm_smmu_unmap,
2000 .map_sg = default_iommu_map_sg,
2001 .flush_iotlb_all = arm_smmu_iotlb_sync, 2000 .flush_iotlb_all = arm_smmu_iotlb_sync,
2002 .iotlb_sync = arm_smmu_iotlb_sync, 2001 .iotlb_sync = arm_smmu_iotlb_sync,
2003 .iova_to_phys = arm_smmu_iova_to_phys, 2002 .iova_to_phys = arm_smmu_iova_to_phys,
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index f7a96bcf94a6..644fd7ec8ac7 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1562,7 +1562,6 @@ static struct iommu_ops arm_smmu_ops = {
1562 .attach_dev = arm_smmu_attach_dev, 1562 .attach_dev = arm_smmu_attach_dev,
1563 .map = arm_smmu_map, 1563 .map = arm_smmu_map,
1564 .unmap = arm_smmu_unmap, 1564 .unmap = arm_smmu_unmap,
1565 .map_sg = default_iommu_map_sg,
1566 .flush_iotlb_all = arm_smmu_iotlb_sync, 1565 .flush_iotlb_all = arm_smmu_iotlb_sync,
1567 .iotlb_sync = arm_smmu_iotlb_sync, 1566 .iotlb_sync = arm_smmu_iotlb_sync,
1568 .iova_to_phys = arm_smmu_iova_to_phys, 1567 .iova_to_phys = arm_smmu_iova_to_phys,
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 85879cfec52f..19e55cf6a9dd 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1332,7 +1332,6 @@ static const struct iommu_ops exynos_iommu_ops = {
1332 .detach_dev = exynos_iommu_detach_device, 1332 .detach_dev = exynos_iommu_detach_device,
1333 .map = exynos_iommu_map, 1333 .map = exynos_iommu_map,
1334 .unmap = exynos_iommu_unmap, 1334 .unmap = exynos_iommu_unmap,
1335 .map_sg = default_iommu_map_sg,
1336 .iova_to_phys = exynos_iommu_iova_to_phys, 1335 .iova_to_phys = exynos_iommu_iova_to_phys,
1337 .device_group = generic_device_group, 1336 .device_group = generic_device_group,
1338 .add_device = exynos_iommu_add_device, 1337 .add_device = exynos_iommu_add_device,
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 14e4b3722428..afb6c872f203 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -5308,7 +5308,6 @@ const struct iommu_ops intel_iommu_ops = {
5308 .detach_dev = intel_iommu_detach_device, 5308 .detach_dev = intel_iommu_detach_device,
5309 .map = intel_iommu_map, 5309 .map = intel_iommu_map,
5310 .unmap = intel_iommu_unmap, 5310 .unmap = intel_iommu_unmap,
5311 .map_sg = default_iommu_map_sg,
5312 .iova_to_phys = intel_iommu_iova_to_phys, 5311 .iova_to_phys = intel_iommu_iova_to_phys,
5313 .add_device = intel_iommu_add_device, 5312 .add_device = intel_iommu_add_device,
5314 .remove_device = intel_iommu_remove_device, 5313 .remove_device = intel_iommu_remove_device,
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index f3698006cb53..8c15c5980299 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1673,8 +1673,8 @@ size_t iommu_unmap_fast(struct iommu_domain *domain,
1673} 1673}
1674EXPORT_SYMBOL_GPL(iommu_unmap_fast); 1674EXPORT_SYMBOL_GPL(iommu_unmap_fast);
1675 1675
1676size_t default_iommu_map_sg(struct iommu_domain *domain, unsigned long iova, 1676size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
1677 struct scatterlist *sg, unsigned int nents, int prot) 1677 struct scatterlist *sg, unsigned int nents, int prot)
1678{ 1678{
1679 struct scatterlist *s; 1679 struct scatterlist *s;
1680 size_t mapped = 0; 1680 size_t mapped = 0;
@@ -1714,7 +1714,7 @@ out_err:
1714 return 0; 1714 return 0;
1715 1715
1716} 1716}
1717EXPORT_SYMBOL_GPL(default_iommu_map_sg); 1717EXPORT_SYMBOL_GPL(iommu_map_sg);
1718 1718
1719int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, 1719int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
1720 phys_addr_t paddr, u64 size, int prot) 1720 phys_addr_t paddr, u64 size, int prot)
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 40ae6e87cb88..c9ce27cfa7e8 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -889,7 +889,6 @@ static const struct iommu_ops ipmmu_ops = {
889 .unmap = ipmmu_unmap, 889 .unmap = ipmmu_unmap,
890 .flush_iotlb_all = ipmmu_iotlb_sync, 890 .flush_iotlb_all = ipmmu_iotlb_sync,
891 .iotlb_sync = ipmmu_iotlb_sync, 891 .iotlb_sync = ipmmu_iotlb_sync,
892 .map_sg = default_iommu_map_sg,
893 .iova_to_phys = ipmmu_iova_to_phys, 892 .iova_to_phys = ipmmu_iova_to_phys,
894 .add_device = ipmmu_add_device, 893 .add_device = ipmmu_add_device,
895 .remove_device = ipmmu_remove_device, 894 .remove_device = ipmmu_remove_device,
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 0d3350463a3f..cdf6ab22ede9 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -708,7 +708,6 @@ static struct iommu_ops msm_iommu_ops = {
708 .detach_dev = msm_iommu_detach_dev, 708 .detach_dev = msm_iommu_detach_dev,
709 .map = msm_iommu_map, 709 .map = msm_iommu_map,
710 .unmap = msm_iommu_unmap, 710 .unmap = msm_iommu_unmap,
711 .map_sg = default_iommu_map_sg,
712 .iova_to_phys = msm_iommu_iova_to_phys, 711 .iova_to_phys = msm_iommu_iova_to_phys,
713 .add_device = msm_iommu_add_device, 712 .add_device = msm_iommu_add_device,
714 .remove_device = msm_iommu_remove_device, 713 .remove_device = msm_iommu_remove_device,
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index f2832a10fcea..f9f69f7111a9 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -495,7 +495,6 @@ static struct iommu_ops mtk_iommu_ops = {
495 .detach_dev = mtk_iommu_detach_device, 495 .detach_dev = mtk_iommu_detach_device,
496 .map = mtk_iommu_map, 496 .map = mtk_iommu_map,
497 .unmap = mtk_iommu_unmap, 497 .unmap = mtk_iommu_unmap,
498 .map_sg = default_iommu_map_sg,
499 .flush_iotlb_all = mtk_iommu_iotlb_sync, 498 .flush_iotlb_all = mtk_iommu_iotlb_sync,
500 .iotlb_sync = mtk_iommu_iotlb_sync, 499 .iotlb_sync = mtk_iommu_iotlb_sync,
501 .iova_to_phys = mtk_iommu_iova_to_phys, 500 .iova_to_phys = mtk_iommu_iova_to_phys,
diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
index a7c2a973784f..676c029494e4 100644
--- a/drivers/iommu/mtk_iommu_v1.c
+++ b/drivers/iommu/mtk_iommu_v1.c
@@ -531,7 +531,6 @@ static struct iommu_ops mtk_iommu_ops = {
531 .detach_dev = mtk_iommu_detach_device, 531 .detach_dev = mtk_iommu_detach_device,
532 .map = mtk_iommu_map, 532 .map = mtk_iommu_map,
533 .unmap = mtk_iommu_unmap, 533 .unmap = mtk_iommu_unmap,
534 .map_sg = default_iommu_map_sg,
535 .iova_to_phys = mtk_iommu_iova_to_phys, 534 .iova_to_phys = mtk_iommu_iova_to_phys,
536 .add_device = mtk_iommu_add_device, 535 .add_device = mtk_iommu_add_device,
537 .remove_device = mtk_iommu_remove_device, 536 .remove_device = mtk_iommu_remove_device,
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index af4a8e7fcd27..86d64ff507fa 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1548,7 +1548,6 @@ static const struct iommu_ops omap_iommu_ops = {
1548 .detach_dev = omap_iommu_detach_dev, 1548 .detach_dev = omap_iommu_detach_dev,
1549 .map = omap_iommu_map, 1549 .map = omap_iommu_map,
1550 .unmap = omap_iommu_unmap, 1550 .unmap = omap_iommu_unmap,
1551 .map_sg = default_iommu_map_sg,
1552 .iova_to_phys = omap_iommu_iova_to_phys, 1551 .iova_to_phys = omap_iommu_iova_to_phys,
1553 .add_device = omap_iommu_add_device, 1552 .add_device = omap_iommu_add_device,
1554 .remove_device = omap_iommu_remove_device, 1553 .remove_device = omap_iommu_remove_device,
diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
index fe88a4880d3a..6e914b3a2b4b 100644
--- a/drivers/iommu/qcom_iommu.c
+++ b/drivers/iommu/qcom_iommu.c
@@ -590,7 +590,6 @@ static const struct iommu_ops qcom_iommu_ops = {
590 .detach_dev = qcom_iommu_detach_dev, 590 .detach_dev = qcom_iommu_detach_dev,
591 .map = qcom_iommu_map, 591 .map = qcom_iommu_map,
592 .unmap = qcom_iommu_unmap, 592 .unmap = qcom_iommu_unmap,
593 .map_sg = default_iommu_map_sg,
594 .flush_iotlb_all = qcom_iommu_iotlb_sync, 593 .flush_iotlb_all = qcom_iommu_iotlb_sync,
595 .iotlb_sync = qcom_iommu_iotlb_sync, 594 .iotlb_sync = qcom_iommu_iotlb_sync,
596 .iova_to_phys = qcom_iommu_iova_to_phys, 595 .iova_to_phys = qcom_iommu_iova_to_phys,
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 054cd2c8e9c8..90625cdd3b66 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1110,7 +1110,6 @@ static const struct iommu_ops rk_iommu_ops = {
1110 .detach_dev = rk_iommu_detach_device, 1110 .detach_dev = rk_iommu_detach_device,
1111 .map = rk_iommu_map, 1111 .map = rk_iommu_map,
1112 .unmap = rk_iommu_unmap, 1112 .unmap = rk_iommu_unmap,
1113 .map_sg = default_iommu_map_sg,
1114 .add_device = rk_iommu_add_device, 1113 .add_device = rk_iommu_add_device,
1115 .remove_device = rk_iommu_remove_device, 1114 .remove_device = rk_iommu_remove_device,
1116 .iova_to_phys = rk_iommu_iova_to_phys, 1115 .iova_to_phys = rk_iommu_iova_to_phys,
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index a004f6da35f2..7b1361d57a17 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -377,7 +377,6 @@ static const struct iommu_ops gart_iommu_ops = {
377 .remove_device = gart_iommu_remove_device, 377 .remove_device = gart_iommu_remove_device,
378 .device_group = generic_device_group, 378 .device_group = generic_device_group,
379 .map = gart_iommu_map, 379 .map = gart_iommu_map,
380 .map_sg = default_iommu_map_sg,
381 .unmap = gart_iommu_unmap, 380 .unmap = gart_iommu_unmap,
382 .iova_to_phys = gart_iommu_iova_to_phys, 381 .iova_to_phys = gart_iommu_iova_to_phys,
383 .pgsize_bitmap = GART_IOMMU_PGSIZES, 382 .pgsize_bitmap = GART_IOMMU_PGSIZES,
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 44d40bc771b5..0d03341317c4 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -876,7 +876,6 @@ static const struct iommu_ops tegra_smmu_ops = {
876 .device_group = tegra_smmu_device_group, 876 .device_group = tegra_smmu_device_group,
877 .map = tegra_smmu_map, 877 .map = tegra_smmu_map,
878 .unmap = tegra_smmu_unmap, 878 .unmap = tegra_smmu_unmap,
879 .map_sg = default_iommu_map_sg,
880 .iova_to_phys = tegra_smmu_iova_to_phys, 879 .iova_to_phys = tegra_smmu_iova_to_phys,
881 .of_xlate = tegra_smmu_of_xlate, 880 .of_xlate = tegra_smmu_of_xlate,
882 .pgsize_bitmap = SZ_4K, 881 .pgsize_bitmap = SZ_4K,