Skip to content

Commit 0dde2bf

Browse files
committed
Merge tag 'iommu-updates-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull iommu updates from Joerg Roedel: "Core changes: - Fix race conditions in device probe path - Retire IOMMU bus_ops - Support for passing custom allocators to page table drivers - Clean up Kconfig around IOMMU_SVA - Support for sharing SVA domains with all devices bound to a mm - Firmware data parsing cleanup - Tracing improvements for iommu-dma code - Some smaller fixes and cleanups ARM-SMMU drivers: - Device-tree binding updates: - Add additional compatible strings for Qualcomm SoCs - Document Adreno clocks for Qualcomm's SM8350 SoC - SMMUv2: - Implement support for the ->domain_alloc_paging() callback - Ensure Secure context is restored following suspend of Qualcomm SMMU implementation - SMMUv3: - Disable stalling mode for the "quiet" context descriptor - Minor refactoring and driver cleanups Intel VT-d driver: - Cleanup and refactoring AMD IOMMU driver: - Improve IO TLB invalidation logic - Small cleanups and improvements Rockchip IOMMU driver: - DT binding update to add Rockchip RK3588 Apple DART driver: - Apple M1 USB4/Thunderbolt DART support - Cleanups Virtio IOMMU driver: - Add support for iotlb_sync_map - Enable deferred IO TLB flushes" * tag 'iommu-updates-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (66 commits) iommu: Don't reserve 0-length IOVA region iommu/vt-d: Move inline helpers to header files iommu/vt-d: Remove unused vcmd interfaces iommu/vt-d: Remove unused parameter of intel_pasid_setup_pass_through() iommu/vt-d: Refactor device_to_iommu() to retrieve iommu directly iommu/sva: Fix memory leak in iommu_sva_bind_device() dt-bindings: iommu: rockchip: Add Rockchip RK3588 iommu/dma: Trace bounce buffer usage when mapping buffers iommu/arm-smmu: Convert to domain_alloc_paging() iommu/arm-smmu: Pass arm_smmu_domain to internal functions iommu/arm-smmu: Implement IOMMU_DOMAIN_BLOCKED iommu/arm-smmu: Convert to a global static identity domain iommu/arm-smmu: Reorganize arm_smmu_domain_add_master() iommu/arm-smmu-v3: Remove ARM_SMMU_DOMAIN_NESTED iommu/arm-smmu-v3: Master cannot be NULL in arm_smmu_write_strtab_ent() iommu/arm-smmu-v3: Add a type for the STE iommu/arm-smmu-v3: disable stall for quiet_cd iommu/qcom: restore IOMMU state if needed iommu/arm-smmu-qcom: Add QCM2290 MDSS compatible iommu/arm-smmu-qcom: Add missing GMU entry to match table ...
2 parents e7ded27 + 75f74f8 commit 0dde2bf

63 files changed

Lines changed: 1278 additions & 1042 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/iommu/apple,dart.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ properties:
2424
compatible:
2525
enum:
2626
- apple,t8103-dart
27+
- apple,t8103-usb4-dart
2728
- apple,t8110-dart
2829
- apple,t6000-dart
2930

Documentation/devicetree/bindings/iommu/arm,smmu.yaml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ properties:
5656
- qcom,sm8350-smmu-500
5757
- qcom,sm8450-smmu-500
5858
- qcom,sm8550-smmu-500
59+
- qcom,sm8650-smmu-500
60+
- qcom,x1e80100-smmu-500
5961
- const: qcom,smmu-500
6062
- const: arm,mmu-500
6163

@@ -89,6 +91,8 @@ properties:
8991
- qcom,sm8150-smmu-500
9092
- qcom,sm8250-smmu-500
9193
- qcom,sm8350-smmu-500
94+
- qcom,sm8450-smmu-500
95+
- qcom,sm8550-smmu-500
9296
- const: qcom,adreno-smmu
9397
- const: qcom,smmu-500
9498
- const: arm,mmu-500
@@ -429,6 +433,30 @@ allOf:
429433
- description: interface clock required to access smmu's registers
430434
through the TCU's programming interface.
431435

436+
- if:
437+
properties:
438+
compatible:
439+
items:
440+
- enum:
441+
- qcom,sm8350-smmu-500
442+
- const: qcom,adreno-smmu
443+
- const: qcom,smmu-500
444+
- const: arm,mmu-500
445+
then:
446+
properties:
447+
clock-names:
448+
items:
449+
- const: bus
450+
- const: iface
451+
- const: ahb
452+
- const: hlos1_vote_gpu_smmu
453+
- const: cx_gmu
454+
- const: hub_cx_int
455+
- const: hub_aon
456+
clocks:
457+
minItems: 7
458+
maxItems: 7
459+
432460
- if:
433461
properties:
434462
compatible:
@@ -453,6 +481,50 @@ allOf:
453481
- description: Voter clock required for HLOS SMMU access
454482
- description: Interface clock required for register access
455483

484+
- if:
485+
properties:
486+
compatible:
487+
const: qcom,sm8450-smmu-500
488+
then:
489+
properties:
490+
clock-names:
491+
items:
492+
- const: gmu
493+
- const: hub
494+
- const: hlos
495+
- const: bus
496+
- const: iface
497+
- const: ahb
498+
499+
clocks:
500+
items:
501+
- description: GMU clock
502+
- description: GPU HUB clock
503+
- description: HLOS vote clock
504+
- description: GPU memory bus clock
505+
- description: GPU SNoC bus clock
506+
- description: GPU AHB clock
507+
508+
- if:
509+
properties:
510+
compatible:
511+
const: qcom,sm8550-smmu-500
512+
then:
513+
properties:
514+
clock-names:
515+
items:
516+
- const: hlos
517+
- const: bus
518+
- const: iface
519+
- const: ahb
520+
521+
clocks:
522+
items:
523+
- description: HLOS vote clock
524+
- description: GPU memory bus clock
525+
- description: GPU SNoC bus clock
526+
- description: GPU AHB clock
527+
456528
# Disallow clocks for all other platforms with specific compatibles
457529
- if:
458530
properties:
@@ -472,9 +544,8 @@ allOf:
472544
- qcom,sdx65-smmu-500
473545
- qcom,sm6350-smmu-500
474546
- qcom,sm6375-smmu-500
475-
- qcom,sm8350-smmu-500
476-
- qcom,sm8450-smmu-500
477-
- qcom,sm8550-smmu-500
547+
- qcom,sm8650-smmu-500
548+
- qcom,x1e80100-smmu-500
478549
then:
479550
properties:
480551
clock-names: false

Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ description: |+
1919
2020
properties:
2121
compatible:
22-
enum:
23-
- rockchip,iommu
24-
- rockchip,rk3568-iommu
22+
oneOf:
23+
- enum:
24+
- rockchip,iommu
25+
- rockchip,rk3568-iommu
26+
- items:
27+
- enum:
28+
- rockchip,rk3588-iommu
29+
- const: rockchip,rk3568-iommu
2530

2631
reg:
2732
items:

arch/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ config ARCH_HAS_DMA_CLEAR_UNCACHED
301301
config ARCH_HAS_CPU_FINALIZE_INIT
302302
bool
303303

304+
# The architecture has a per-task state that includes the mm's PASID
305+
config ARCH_HAS_CPU_PASID
306+
bool
307+
select IOMMU_MM_DATA
308+
304309
config HAVE_ARCH_THREAD_STRUCT_WHITELIST
305310
bool
306311
help

arch/arc/mm/dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
9191
* Plug in direct dma map ops.
9292
*/
9393
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
94-
const struct iommu_ops *iommu, bool coherent)
94+
bool coherent)
9595
{
9696
/*
9797
* IOC hardware snoops all DMA traffic keeping the caches consistent

arch/arm/mm/dma-mapping-nommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
3434
}
3535

3636
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
37-
const struct iommu_ops *iommu, bool coherent)
37+
bool coherent)
3838
{
3939
if (IS_ENABLED(CONFIG_CPU_V7M)) {
4040
/*

arch/arm/mm/dma-mapping.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ void arm_iommu_detach_device(struct device *dev)
17101710
EXPORT_SYMBOL_GPL(arm_iommu_detach_device);
17111711

17121712
static void arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size,
1713-
const struct iommu_ops *iommu, bool coherent)
1713+
bool coherent)
17141714
{
17151715
struct dma_iommu_mapping *mapping;
17161716

@@ -1745,7 +1745,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev)
17451745
#else
17461746

17471747
static void arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size,
1748-
const struct iommu_ops *iommu, bool coherent)
1748+
bool coherent)
17491749
{
17501750
}
17511751

@@ -1754,7 +1754,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { }
17541754
#endif /* CONFIG_ARM_DMA_USE_IOMMU */
17551755

17561756
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
1757-
const struct iommu_ops *iommu, bool coherent)
1757+
bool coherent)
17581758
{
17591759
/*
17601760
* Due to legacy code that sets the ->dma_coherent flag from a bus
@@ -1773,8 +1773,8 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
17731773
if (dev->dma_ops)
17741774
return;
17751775

1776-
if (iommu)
1777-
arm_setup_iommu_dma_ops(dev, dma_base, size, iommu, coherent);
1776+
if (device_iommu_mapped(dev))
1777+
arm_setup_iommu_dma_ops(dev, dma_base, size, coherent);
17781778

17791779
xen_setup_dma_ops(dev);
17801780
dev->archdata.dma_ops_setup = true;

arch/arm64/mm/dma-mapping.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void arch_teardown_dma_ops(struct device *dev)
4747
#endif
4848

4949
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
50-
const struct iommu_ops *iommu, bool coherent)
50+
bool coherent)
5151
{
5252
int cls = cache_line_size_of_cpu();
5353

@@ -58,7 +58,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
5858
ARCH_DMA_MINALIGN, cls);
5959

6060
dev->dma_coherent = coherent;
61-
if (iommu)
61+
if (device_iommu_mapped(dev))
6262
iommu_setup_dma_ops(dev, dma_base, dma_base + size - 1);
6363

6464
xen_setup_dma_ops(dev);

arch/mips/mm/dma-noncoherent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
138138

139139
#ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS
140140
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
141-
const struct iommu_ops *iommu, bool coherent)
141+
bool coherent)
142142
{
143143
dev->dma_coherent = coherent;
144144
}

arch/riscv/mm/dma-noncoherent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void arch_dma_prep_coherent(struct page *page, size_t size)
129129
}
130130

131131
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
132-
const struct iommu_ops *iommu, bool coherent)
132+
bool coherent)
133133
{
134134
WARN_TAINT(!coherent && riscv_cbom_block_size > ARCH_DMA_MINALIGN,
135135
TAINT_CPU_OUT_OF_SPEC,

0 commit comments

Comments
 (0)