Skip to content

Commit 067e95f

Browse files
committed
Merge branch 'core' into x86/vt-d
2 parents f266c11 + 5b61343 commit 067e95f

36 files changed

Lines changed: 385 additions & 1734 deletions

drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev)
133133
* or equal to the system's PAGE_SIZE, with a preference if
134134
* both are equal.
135135
*/
136-
pgsize_bitmap = tdev->iommu.domain->ops->pgsize_bitmap;
136+
pgsize_bitmap = tdev->iommu.domain->pgsize_bitmap;
137137
if (pgsize_bitmap & PAGE_SIZE) {
138138
tdev->iommu.pgshift = PAGE_SHIFT;
139139
} else {

drivers/iommu/amd/amd_iommu.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ void amd_iommu_domain_clr_pt_root(struct protection_domain *domain)
116116

117117

118118
extern bool translation_pre_enabled(struct amd_iommu *iommu);
119-
extern bool amd_iommu_is_attach_deferred(struct iommu_domain *domain,
120-
struct device *dev);
119+
extern bool amd_iommu_is_attach_deferred(struct device *dev);
121120
extern int __init add_special_device(u8 type, u8 id, u16 *devid,
122121
bool cmd_line);
123122

drivers/iommu/amd/iommu.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,8 +2215,7 @@ static void amd_iommu_get_resv_regions(struct device *dev,
22152215
list_add_tail(&region->list, head);
22162216
}
22172217

2218-
bool amd_iommu_is_attach_deferred(struct iommu_domain *domain,
2219-
struct device *dev)
2218+
bool amd_iommu_is_attach_deferred(struct device *dev)
22202219
{
22212220
struct iommu_dev_data *dev_data = dev_iommu_priv_get(dev);
22222221

@@ -2269,13 +2268,6 @@ static int amd_iommu_def_domain_type(struct device *dev)
22692268
const struct iommu_ops amd_iommu_ops = {
22702269
.capable = amd_iommu_capable,
22712270
.domain_alloc = amd_iommu_domain_alloc,
2272-
.domain_free = amd_iommu_domain_free,
2273-
.attach_dev = amd_iommu_attach_device,
2274-
.detach_dev = amd_iommu_detach_device,
2275-
.map = amd_iommu_map,
2276-
.iotlb_sync_map = amd_iommu_iotlb_sync_map,
2277-
.unmap = amd_iommu_unmap,
2278-
.iova_to_phys = amd_iommu_iova_to_phys,
22792271
.probe_device = amd_iommu_probe_device,
22802272
.release_device = amd_iommu_release_device,
22812273
.probe_finalize = amd_iommu_probe_finalize,
@@ -2284,9 +2276,18 @@ const struct iommu_ops amd_iommu_ops = {
22842276
.put_resv_regions = generic_iommu_put_resv_regions,
22852277
.is_attach_deferred = amd_iommu_is_attach_deferred,
22862278
.pgsize_bitmap = AMD_IOMMU_PGSIZES,
2287-
.flush_iotlb_all = amd_iommu_flush_iotlb_all,
2288-
.iotlb_sync = amd_iommu_iotlb_sync,
22892279
.def_domain_type = amd_iommu_def_domain_type,
2280+
.default_domain_ops = &(const struct iommu_domain_ops) {
2281+
.attach_dev = amd_iommu_attach_device,
2282+
.detach_dev = amd_iommu_detach_device,
2283+
.map = amd_iommu_map,
2284+
.unmap = amd_iommu_unmap,
2285+
.iotlb_sync_map = amd_iommu_iotlb_sync_map,
2286+
.iova_to_phys = amd_iommu_iova_to_phys,
2287+
.flush_iotlb_all = amd_iommu_flush_iotlb_all,
2288+
.iotlb_sync = amd_iommu_iotlb_sync,
2289+
.free = amd_iommu_domain_free,
2290+
}
22902291
};
22912292

22922293
/*****************************************************************************

drivers/iommu/amd/iommu_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data)
537537
ret = NOTIFY_DONE;
538538

539539
/* In kdump kernel pci dev is not initialized yet -> send INVALID */
540-
if (amd_iommu_is_attach_deferred(NULL, &pdev->dev)) {
540+
if (amd_iommu_is_attach_deferred(&pdev->dev)) {
541541
amd_iommu_complete_ppr(pdev, iommu_fault->pasid,
542542
PPR_INVALID, tag);
543543
goto out;

drivers/iommu/apple-dart.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -765,15 +765,6 @@ static void apple_dart_get_resv_regions(struct device *dev,
765765

766766
static const struct iommu_ops apple_dart_iommu_ops = {
767767
.domain_alloc = apple_dart_domain_alloc,
768-
.domain_free = apple_dart_domain_free,
769-
.attach_dev = apple_dart_attach_dev,
770-
.detach_dev = apple_dart_detach_dev,
771-
.map_pages = apple_dart_map_pages,
772-
.unmap_pages = apple_dart_unmap_pages,
773-
.flush_iotlb_all = apple_dart_flush_iotlb_all,
774-
.iotlb_sync = apple_dart_iotlb_sync,
775-
.iotlb_sync_map = apple_dart_iotlb_sync_map,
776-
.iova_to_phys = apple_dart_iova_to_phys,
777768
.probe_device = apple_dart_probe_device,
778769
.release_device = apple_dart_release_device,
779770
.device_group = apple_dart_device_group,
@@ -782,6 +773,17 @@ static const struct iommu_ops apple_dart_iommu_ops = {
782773
.get_resv_regions = apple_dart_get_resv_regions,
783774
.put_resv_regions = generic_iommu_put_resv_regions,
784775
.pgsize_bitmap = -1UL, /* Restricted during dart probe */
776+
.default_domain_ops = &(const struct iommu_domain_ops) {
777+
.attach_dev = apple_dart_attach_dev,
778+
.detach_dev = apple_dart_detach_dev,
779+
.map_pages = apple_dart_map_pages,
780+
.unmap_pages = apple_dart_unmap_pages,
781+
.flush_iotlb_all = apple_dart_flush_iotlb_all,
782+
.iotlb_sync = apple_dart_iotlb_sync,
783+
.iotlb_sync_map = apple_dart_iotlb_sync_map,
784+
.iova_to_phys = apple_dart_iova_to_phys,
785+
.free = apple_dart_domain_free,
786+
}
785787
};
786788

787789
static irqreturn_t apple_dart_irq(int irq, void *dev)

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,17 +2841,9 @@ static int arm_smmu_dev_disable_feature(struct device *dev,
28412841
static struct iommu_ops arm_smmu_ops = {
28422842
.capable = arm_smmu_capable,
28432843
.domain_alloc = arm_smmu_domain_alloc,
2844-
.domain_free = arm_smmu_domain_free,
2845-
.attach_dev = arm_smmu_attach_dev,
2846-
.map_pages = arm_smmu_map_pages,
2847-
.unmap_pages = arm_smmu_unmap_pages,
2848-
.flush_iotlb_all = arm_smmu_flush_iotlb_all,
2849-
.iotlb_sync = arm_smmu_iotlb_sync,
2850-
.iova_to_phys = arm_smmu_iova_to_phys,
28512844
.probe_device = arm_smmu_probe_device,
28522845
.release_device = arm_smmu_release_device,
28532846
.device_group = arm_smmu_device_group,
2854-
.enable_nesting = arm_smmu_enable_nesting,
28552847
.of_xlate = arm_smmu_of_xlate,
28562848
.get_resv_regions = arm_smmu_get_resv_regions,
28572849
.put_resv_regions = generic_iommu_put_resv_regions,
@@ -2865,6 +2857,16 @@ static struct iommu_ops arm_smmu_ops = {
28652857
.page_response = arm_smmu_page_response,
28662858
.pgsize_bitmap = -1UL, /* Restricted during device attach */
28672859
.owner = THIS_MODULE,
2860+
.default_domain_ops = &(const struct iommu_domain_ops) {
2861+
.attach_dev = arm_smmu_attach_dev,
2862+
.map_pages = arm_smmu_map_pages,
2863+
.unmap_pages = arm_smmu_unmap_pages,
2864+
.flush_iotlb_all = arm_smmu_flush_iotlb_all,
2865+
.iotlb_sync = arm_smmu_iotlb_sync,
2866+
.iova_to_phys = arm_smmu_iova_to_phys,
2867+
.enable_nesting = arm_smmu_enable_nesting,
2868+
.free = arm_smmu_domain_free,
2869+
}
28682870
};
28692871

28702872
/* Probing and initialisation functions */

drivers/iommu/arm/arm-smmu/arm-smmu.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,25 +1583,27 @@ static int arm_smmu_def_domain_type(struct device *dev)
15831583
static struct iommu_ops arm_smmu_ops = {
15841584
.capable = arm_smmu_capable,
15851585
.domain_alloc = arm_smmu_domain_alloc,
1586-
.domain_free = arm_smmu_domain_free,
1587-
.attach_dev = arm_smmu_attach_dev,
1588-
.map_pages = arm_smmu_map_pages,
1589-
.unmap_pages = arm_smmu_unmap_pages,
1590-
.flush_iotlb_all = arm_smmu_flush_iotlb_all,
1591-
.iotlb_sync = arm_smmu_iotlb_sync,
1592-
.iova_to_phys = arm_smmu_iova_to_phys,
15931586
.probe_device = arm_smmu_probe_device,
15941587
.release_device = arm_smmu_release_device,
15951588
.probe_finalize = arm_smmu_probe_finalize,
15961589
.device_group = arm_smmu_device_group,
1597-
.enable_nesting = arm_smmu_enable_nesting,
1598-
.set_pgtable_quirks = arm_smmu_set_pgtable_quirks,
15991590
.of_xlate = arm_smmu_of_xlate,
16001591
.get_resv_regions = arm_smmu_get_resv_regions,
16011592
.put_resv_regions = generic_iommu_put_resv_regions,
16021593
.def_domain_type = arm_smmu_def_domain_type,
16031594
.pgsize_bitmap = -1UL, /* Restricted during device attach */
16041595
.owner = THIS_MODULE,
1596+
.default_domain_ops = &(const struct iommu_domain_ops) {
1597+
.attach_dev = arm_smmu_attach_dev,
1598+
.map_pages = arm_smmu_map_pages,
1599+
.unmap_pages = arm_smmu_unmap_pages,
1600+
.flush_iotlb_all = arm_smmu_flush_iotlb_all,
1601+
.iotlb_sync = arm_smmu_iotlb_sync,
1602+
.iova_to_phys = arm_smmu_iova_to_phys,
1603+
.enable_nesting = arm_smmu_enable_nesting,
1604+
.set_pgtable_quirks = arm_smmu_set_pgtable_quirks,
1605+
.free = arm_smmu_domain_free,
1606+
}
16051607
};
16061608

16071609
static void arm_smmu_device_reset(struct arm_smmu_device *smmu)

drivers/iommu/arm/arm-smmu/qcom_iommu.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,19 +590,21 @@ static int qcom_iommu_of_xlate(struct device *dev, struct of_phandle_args *args)
590590
static const struct iommu_ops qcom_iommu_ops = {
591591
.capable = qcom_iommu_capable,
592592
.domain_alloc = qcom_iommu_domain_alloc,
593-
.domain_free = qcom_iommu_domain_free,
594-
.attach_dev = qcom_iommu_attach_dev,
595-
.detach_dev = qcom_iommu_detach_dev,
596-
.map = qcom_iommu_map,
597-
.unmap = qcom_iommu_unmap,
598-
.flush_iotlb_all = qcom_iommu_flush_iotlb_all,
599-
.iotlb_sync = qcom_iommu_iotlb_sync,
600-
.iova_to_phys = qcom_iommu_iova_to_phys,
601593
.probe_device = qcom_iommu_probe_device,
602594
.release_device = qcom_iommu_release_device,
603595
.device_group = generic_device_group,
604596
.of_xlate = qcom_iommu_of_xlate,
605597
.pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M,
598+
.default_domain_ops = &(const struct iommu_domain_ops) {
599+
.attach_dev = qcom_iommu_attach_dev,
600+
.detach_dev = qcom_iommu_detach_dev,
601+
.map = qcom_iommu_map,
602+
.unmap = qcom_iommu_unmap,
603+
.flush_iotlb_all = qcom_iommu_flush_iotlb_all,
604+
.iotlb_sync = qcom_iommu_iotlb_sync,
605+
.iova_to_phys = qcom_iommu_iova_to_phys,
606+
.free = qcom_iommu_domain_free,
607+
}
606608
};
607609

608610
static int qcom_iommu_sec_ptbl_init(struct device *dev)

drivers/iommu/dma-iommu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
525525
struct iommu_dma_cookie *cookie = domain->iova_cookie;
526526
unsigned long order, base_pfn;
527527
struct iova_domain *iovad;
528+
int ret;
528529

529530
if (!cookie || cookie->type != IOMMU_DMA_IOVA_COOKIE)
530531
return -EINVAL;
@@ -559,6 +560,9 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
559560
}
560561

561562
init_iova_domain(iovad, 1UL << order, base_pfn);
563+
ret = iova_domain_init_rcaches(iovad);
564+
if (ret)
565+
return ret;
562566

563567
/* If the FQ fails we can simply fall back to strict mode */
564568
if (domain->type == IOMMU_DOMAIN_DMA_FQ && iommu_dma_init_fq(domain))

drivers/iommu/exynos-iommu.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,17 +1309,19 @@ static int exynos_iommu_of_xlate(struct device *dev,
13091309

13101310
static const struct iommu_ops exynos_iommu_ops = {
13111311
.domain_alloc = exynos_iommu_domain_alloc,
1312-
.domain_free = exynos_iommu_domain_free,
1313-
.attach_dev = exynos_iommu_attach_device,
1314-
.detach_dev = exynos_iommu_detach_device,
1315-
.map = exynos_iommu_map,
1316-
.unmap = exynos_iommu_unmap,
1317-
.iova_to_phys = exynos_iommu_iova_to_phys,
13181312
.device_group = generic_device_group,
13191313
.probe_device = exynos_iommu_probe_device,
13201314
.release_device = exynos_iommu_release_device,
13211315
.pgsize_bitmap = SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE,
13221316
.of_xlate = exynos_iommu_of_xlate,
1317+
.default_domain_ops = &(const struct iommu_domain_ops) {
1318+
.attach_dev = exynos_iommu_attach_device,
1319+
.detach_dev = exynos_iommu_detach_device,
1320+
.map = exynos_iommu_map,
1321+
.unmap = exynos_iommu_unmap,
1322+
.iova_to_phys = exynos_iommu_iova_to_phys,
1323+
.free = exynos_iommu_domain_free,
1324+
}
13231325
};
13241326

13251327
static int __init exynos_iommu_init(void)

0 commit comments

Comments
 (0)