Skip to content

Commit 0906d8b

Browse files
committed
Merge tag 'iommu-updates-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull iommu updates from Joerg Roedel: - ARM-SMMU support for the TLB range invalidation command in SMMUv3.2 - ARM-SMMU introduction of command batching helpers to batch up CD and ATC invalidation - ARM-SMMU support for PCI PASID, along with necessary PCI symbol exports - Introduce a generic (actually rename an existing) IOMMU related pointer in struct device and reduce the IOMMU related pointers - Some fixes for the OMAP IOMMU driver to make it build on 64bit architectures - Various smaller fixes and improvements * tag 'iommu-updates-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (39 commits) iommu: Move fwspec->iommu_priv to struct dev_iommu iommu/virtio: Use accessor functions for iommu private data iommu/qcom: Use accessor functions for iommu private data iommu/mediatek: Use accessor functions for iommu private data iommu/renesas: Use accessor functions for iommu private data iommu/arm-smmu: Use accessor functions for iommu private data iommu/arm-smmu: Refactor master_cfg/fwspec usage iommu/arm-smmu-v3: Use accessor functions for iommu private data iommu: Introduce accessors for iommu private data iommu/arm-smmu: Fix uninitilized variable warning iommu: Move iommu_fwspec to struct dev_iommu iommu: Rename struct iommu_param to dev_iommu iommu/tegra-gart: Remove direct access of dev->iommu_fwspec drm/msm/mdp5: Remove direct access of dev->iommu_fwspec ACPI/IORT: Remove direct access of dev->iommu_fwspec iommu: Define dev_iommu_fwspec_get() for !CONFIG_IOMMU_API iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE iommu/virtio: Fix freeing of incomplete domains iommu/virtio: Fix sparse warning iommu/vt-d: Add build dependency on IOASID ...
2 parents 0339eb9 + ff68eb2 commit 0906d8b

File tree

22 files changed

+386
-187
lines changed

22 files changed

+386
-187
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,7 @@ M: Will Deacon <[email protected]>
14441444
R: Robin Murphy <[email protected]>
14451445
L: [email protected] (moderated for non-subscribers)
14461446
S: Maintained
1447+
F: Documentation/devicetree/bindings/iommu/arm,smmu*
14471448
F: drivers/iommu/arm-smmu*
14481449
F: drivers/iommu/io-pgtable-arm.c
14491450
F: drivers/iommu/io-pgtable-arm-v7s.c

drivers/acpi/arm64/iort.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
10151015
return ops;
10161016

10171017
if (dev_is_pci(dev)) {
1018+
struct iommu_fwspec *fwspec;
10181019
struct pci_bus *bus = to_pci_dev(dev)->bus;
10191020
struct iort_pci_alias_info info = { .dev = dev };
10201021

@@ -1027,8 +1028,9 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
10271028
err = pci_for_each_dma_alias(to_pci_dev(dev),
10281029
iort_pci_iommu_init, &info);
10291030

1030-
if (!err && iort_pci_rc_supports_ats(node))
1031-
dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
1031+
fwspec = dev_iommu_fwspec_get(dev);
1032+
if (fwspec && iort_pci_rc_supports_ats(node))
1033+
fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
10321034
} else {
10331035
int i = 0;
10341036

drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
633633

634634
if (config->platform.iommu) {
635635
iommu_dev = &pdev->dev;
636-
if (!iommu_dev->iommu_fwspec)
636+
if (!dev_iommu_fwspec_get(iommu_dev))
637637
iommu_dev = iommu_dev->parent;
638638

639639
aspace = msm_gem_address_space_create(iommu_dev,

drivers/iommu/Kconfig

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ config INTEL_IOMMU
188188
select NEED_DMA_MAP_STATE
189189
select DMAR_TABLE
190190
select SWIOTLB
191+
select IOASID
191192
help
192193
DMA remapping (DMAR) devices support enables independent address
193194
translations for Direct Memory Access (DMA) from devices.
@@ -273,7 +274,7 @@ config IRQ_REMAP
273274
# OMAP IOMMU support
274275
config OMAP_IOMMU
275276
bool "OMAP IOMMU Support"
276-
depends on ARM && MMU
277+
depends on ARM && MMU || (COMPILE_TEST && (ARM || ARM64 || IA64 || SPARC))
277278
depends on ARCH_OMAP2PLUS || COMPILE_TEST
278279
select IOMMU_API
279280
---help---
@@ -291,7 +292,7 @@ config OMAP_IOMMU_DEBUG
291292

292293
config ROCKCHIP_IOMMU
293294
bool "Rockchip IOMMU Support"
294-
depends on ARM || ARM64
295+
depends on ARM || ARM64 || (COMPILE_TEST && (ARM64 || IA64 || SPARC))
295296
depends on ARCH_ROCKCHIP || COMPILE_TEST
296297
select IOMMU_API
297298
select ARM_DMA_USE_IOMMU
@@ -325,7 +326,7 @@ config TEGRA_IOMMU_SMMU
325326

326327
config EXYNOS_IOMMU
327328
bool "Exynos IOMMU Support"
328-
depends on ARCH_EXYNOS && MMU
329+
depends on ARCH_EXYNOS && MMU || (COMPILE_TEST && (ARM || ARM64 || IA64 || SPARC))
329330
depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
330331
select IOMMU_API
331332
select ARM_DMA_USE_IOMMU
@@ -361,7 +362,7 @@ config IPMMU_VMSA
361362

362363
config SPAPR_TCE_IOMMU
363364
bool "sPAPR TCE IOMMU Support"
364-
depends on PPC_POWERNV || PPC_PSERIES
365+
depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
365366
select IOMMU_API
366367
help
367368
Enables bits of IOMMU API required by VFIO. The iommu_ops
@@ -370,7 +371,7 @@ config SPAPR_TCE_IOMMU
370371
# ARM IOMMU support
371372
config ARM_SMMU
372373
tristate "ARM Ltd. System MMU (SMMU) Support"
373-
depends on (ARM64 || ARM) && MMU
374+
depends on (ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)) && MMU
374375
select IOMMU_API
375376
select IOMMU_IO_PGTABLE_LPAE
376377
select ARM_DMA_USE_IOMMU if ARM
@@ -440,23 +441,23 @@ config S390_IOMMU
440441

441442
config S390_CCW_IOMMU
442443
bool "S390 CCW IOMMU Support"
443-
depends on S390 && CCW
444+
depends on S390 && CCW || COMPILE_TEST
444445
select IOMMU_API
445446
help
446447
Enables bits of IOMMU API required by VFIO. The iommu_ops
447448
is not implemented as it is not necessary for VFIO.
448449

449450
config S390_AP_IOMMU
450451
bool "S390 AP IOMMU Support"
451-
depends on S390 && ZCRYPT
452+
depends on S390 && ZCRYPT || COMPILE_TEST
452453
select IOMMU_API
453454
help
454455
Enables bits of IOMMU API required by VFIO. The iommu_ops
455456
is not implemented as it is not necessary for VFIO.
456457

457458
config MTK_IOMMU
458459
bool "MTK IOMMU Support"
459-
depends on ARM || ARM64
460+
depends on ARM || ARM64 || COMPILE_TEST
460461
depends on ARCH_MEDIATEK || COMPILE_TEST
461462
select ARM_DMA_USE_IOMMU
462463
select IOMMU_API
@@ -506,8 +507,8 @@ config HYPERV_IOMMU
506507
guests to run with x2APIC mode enabled.
507508

508509
config VIRTIO_IOMMU
509-
bool "Virtio IOMMU driver"
510-
depends on VIRTIO=y
510+
tristate "Virtio IOMMU driver"
511+
depends on VIRTIO
511512
depends on ARM64
512513
select IOMMU_API
513514
select INTERVAL_TREE

drivers/iommu/amd_iommu_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348

349349
#define DTE_GCR3_VAL_A(x) (((x) >> 12) & 0x00007ULL)
350350
#define DTE_GCR3_VAL_B(x) (((x) >> 15) & 0x0ffffULL)
351-
#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0xfffffULL)
351+
#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0x1fffffULL)
352352

353353
#define DTE_GCR3_INDEX_A 0
354354
#define DTE_GCR3_INDEX_B 1

0 commit comments

Comments
 (0)