Skip to content

Commit e400774

Browse files
author
CKI KWF Bot
committed
Merge: IOMMU and DMA Mapping API subsystem update to v6.17
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1526 # Merge Request Required Information JIRA: https://issues.redhat.com/browse/RHEL-116573 JIRA: https://issues.redhat.com/browse/RHEL-123791 JIRA: https://issues.redhat.com/browse/RHEL-125486 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git CVE: CVE-2025-38594 CVE: CVE-2025-38676 CVE: CVE-2025-38688 CVE: CVE-2025-39739 CVE: CVE-2025-39961 CVE: CVE-2025-39966 CVE: CVE-2025-40058 Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1384 Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1507 Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1577 ## Summary of Changes Updates IOMMU and DMA Mapping API subsystems through the v6.17 merge window. The development branch currently has 178 commits that correspond to the IOMMU and DMA Mapping API subsystems update. ### Conflicts Legend: **ds** is used for _downstream_ and **us** is used for _upstream_ commits. - A merge conflict in drivers/iommu/io-pgtable-arm.c function arm_lpae_do_selftests() due to fa26198 ("iommu/io-pgtable-arm: dynamically allocate selftest device struct") and 3318f7b ("iommu/io-pgtable-arm: Add quirk to quiet WARN_ON()") solved upstream in 879b141 ("Merge branches 'fixes', 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'fsl/pamu', 'mediatek', 'renesas/ipmmu', 's390', 'intel/vt-d', 'amd/amd-vi' and 'core' into next") ds: 3c8d38072f9a ("iommu/io-pgtable-arm: Add quirk to quiet WARN_ON()") us: 3318f7b ("iommu/io-pgtable-arm: Add quirk to quiet WARN_ON()") - Modify/delete conflict in drivers/iommu/riscv/iommu.c. The file does not exist in the downstream repository, but it is modified by upstream commit 4316ba4 ("iommu/pages: Remove the order argument to iommu_free_pages()") ds: 43f977521a8c ("iommu/pages: Remove the order argument to iommu_free_pages()") us: 4316ba4 ("iommu/pages: Remove the order argument to iommu_free_pages()") - Modify/delete conflict in drivers/iommu/riscv/iommu.c. The file does not exist in the downstream repository, but it is modified by upstream commit 3e8e986 ("iommu/pages: Remove iommu_free_page()"). drivers/iommu/rockchip-iommu.c was left unchanged (unsupported driver) ds: ba089f180a17 ("iommu/pages: Remove iommu_free_page()") us: 3e8e986 ("iommu/pages: Remove iommu_free_page()") - Modify/delete conflict in drivers/iommu/riscv/iommu.c. Currently the file does not exist in the downstream repository, but it is modified by upstream commit 5087f66 ("iommu/pages: Remove iommu_alloc_page_node()") ds: 95ce8e3c88a9 ("iommu/pages: Remove iommu_alloc_page_node()") us: 5087f66 ("iommu/pages: Remove iommu_alloc_page_node()") - Modify/delete conflict in drivers/accel/amdxdna/aie2_pci.c. The file does not exist in the downstream repository, but it is modified by upstream commit 7c8896d ("iommu: Remove IOMMU_DEV_FEAT_SVA") ds: d6130fea9dbc ("iommu: Remove IOMMU_DEV_FEAT_SVA") us: 7c8896d ("iommu: Remove IOMMU_DEV_FEAT_SVA") - Merge conflict in drivers/iommu/iommu.c due to downstream-only commit 806bdc7 ("iommu/arm-smmu: workaround DMA mode issues"). This specific downstream implementation has been left untouched, and the adjacent code next to it removed as per patch being applied. ds: dd3f1431ec81 ("iommu: Remove iommu_dev_enable/disable_feature()") us: f984fb0 ("iommu: Remove iommu_dev_enable/disable_feature()") - Merge conflict in drivers/iommu/Makefile due to upstream-only 5c0ebbd ("iommu/riscv: Add RISC-V IOMMU platform device driver") conflicting with the patch being applied. ds: ed7a0f942cf2 ("iommu: make inclusion of intel directory conditional") us: ddcc66c ("iommu: make inclusion of intel directory conditional") - Merge conflict in drivers/iommu/Makefile due to upstream-only 5c0ebbd ("iommu/riscv: Add RISC-V IOMMU platform device driver") conflicting with the patch being applied. ds: f27e9572e031 ("iommu: make inclusion of amd directory conditional") us: 85ef671 ("iommu: make inclusion of amd directory conditional") - Merge conflict in drivers/dma/idxd/init.c due to context difference in idxd_remove(). ds: 61ce77af30e9 ("dmaengine: idxd: Remove unnecessary IOMMU_DEV_FEAT_IOPF") us: 853b01b ("dmaengine: idxd: Remove unnecessary IOMMU_DEV_FEAT_IOPF") - Modify/delete conflict in drivers/iommu/riscv/iommu.c. The file does not exist in the downstream repository, but it is modified by upstream commit. - Contextual conflict in drivers/iommu/virtio-iommu.c related to the addition of a 'const' type qualifier to viommu_ops (now removed) in the patch being backported and the fact that 72b6f7c ("iommu/virtio: Make instance lookup robust") had already been backported. ds: 3cd4fb5f6f67 ("iommu: Remove ops.pgsize_bitmap from drivers that don't use it") us: 8901812 ("iommu: Remove ops.pgsize_bitmap from drivers that don't use it") - Files in drivers/iommu/ related to currently unsupported downstream drivers have been reverted to their pre-patch state: exynos-iommu.c, mtk_iommu_v1.c, omap-iommu.c, rockchip-iommu.c, sprd-iommu.c, and sun50i-iommu.c. ds: 3fdead742369 ("iommu: Remove iommu_ops pgsize_bitmap from simple drivers") us: cf39047 ("iommu: Remove iommu_ops pgsize_bitmap from simple drivers") - Merge conflict in include/linux/iommu.h related to the documentation of pgsize_bitmap. Upstream commit 792ea7b ("iommu: Remove ops->pgsize_bitmap") already backported as downstream 5d2a8e116c7a removed the pgsize_bitmap entry while the base used for creating the patch still had pgsize_bitmap documented. ds: 9b96afd47bfc ("iommu: Deprecate viommu_alloc op") us: f842ea2 ("iommu: Deprecate viommu_alloc op") ### Omitted Omitted-fix: d41d75f ("crypto: qat - fix DMA direction for compression on GEN2 devices") Part of QAT subsystem update. The following upstream commits have been omitted - 01c13a1 ("iommu: make inclusion of riscv directory conditional") Currently RISCV is not supported downstream - e436576 ("iommu: make inclusion of arm/arm-smmu-v3 directory conditional") Reverted by upstream commit 9d49da4 Revert "iommu: make inclusion of arm/arm-smmu-v3 directory conditional" - 41cb085 ("treewide, timers: Rename from_timer() to timer_container_of()") Backported in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1425 - 968e300 ("x86/cpuid: Set <asm/cpuid/api.h> as the main CPUID header") - 46a7418 ("iommu/apple-dart: Drop default ARCH_APPLE in Kconfig") Currently not supported downstream - 2c223f7 ("of: reserved_mem: Restructure call site for dma_contiguous_early_fixup()") Fixes 8a6e02d ("of: reserved_mem: Restructure how the reserved memory regions are processed"), currently not available downstream - KVM Updates (see !1640): ``` 1da19c5 ("iommu/amd: KVM: SVM: Delete now-unused cached/previous GA tag fields") c4cdbaf ("iommu/amd: KVM: SVM: Use pi_desc_addr to derive ga_root_ptr") 95d50eb ("iommu/amd: KVM: SVM: Pass NULL @vcpu_info to indicate "not guest mode"") 53527ea ("iommu: KVM: Split "struct vcpu_data" into separate AMD vs. Intel structs") 3be405e ("iommu/amd: Document which IRTE fields amd_iommu_update_ga() can modify") 08d9ccd ("iommu/amd: KVM: SVM: Infer IsRun from validity of pCPU destination") 0b2b541 ("iommu/amd: Factor out helper for manipulating IRTE GA/CPU info") f965255 ("iommu/amd: KVM: SVM: Set pCPU info in IRTE when setting vCPU affinity") 6df262f ("iommu/amd: KVM: SVM: Add IRTE metadata to affined vCPU's list if AVIC is inhibited") a23480f ("iommu/amd: WARN if KVM calls GA IRTE helpers without virtual APIC support") b9e53f9 ("iommu/amd: KVM: SVM: Allow KVM to control need for GA log interrupts") ``` - 212c439 ("iommu/arm: Add BBM Level 2 smmu feature") Depends on support to feature not yet available downstream (see !1662): ``` 3df6979 ("arm64: mm: split linear mapping if BBML2 unsupported on secondary CPUs") a166563 ("arm64: mm: support large block mapping when rodata=full") 83bbd6b ("arm64/mm: Elide tlbi in contpte_convert() under BBML2") 212c439 ("iommu/arm: Add BBM Level 2 smmu feature") 5aa4b62 ("arm64: Add BBM Level 2 cpu feature") ``` - 75952c4 ("iommu/vt-d: Use pci_is_display()") Backported in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1492 - 9ffaf52 ("iommu/s390: Make attach succeed when the device was surprise removed") Backported in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1477 - b3506e9 ("iommu/s390: Fix memory corruption when using identity domain") Backported in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1477 ### RHEL-only CONFIG_X86_POSTED_MSI=y. File moved from redhat/configs/rhel/generic/CONFIG_X86_POSTED_MSI to redhat/configs/common/generic/x86/CONFIG_X86_POSTED_MSI. Owners file update in https://gitlab.com/redhat/centos-stream/src/kernel/documentation/-/merge_requests/985 Signed-off-by: Eder Zulian <ezulian@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Jerry Snitselaar <jsnitsel@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: Donald Dutile <ddutile@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Lucas Zampieri <lzampier@redhat.com> Approved-by: Anusha Srivatsa <asrivats@redhat.com> Approved-by: ernunes <ernunes@redhat.com> Approved-by: Eric Chanudet <echanude@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents fe62237 + e7628fa commit e400774

Some content is hidden

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

89 files changed

+4679
-2104
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
What: /sys/kernel/debug/iommu/amd/iommu<x>/mmio
2+
Date: January 2025
3+
Contact: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
4+
Description:
5+
This file provides read/write access for user input. Users specify the
6+
MMIO register offset for iommu<x>, and the file outputs the corresponding
7+
MMIO register value of iommu<x>
8+
9+
Example::
10+
11+
$ echo "0x18" > /sys/kernel/debug/iommu/amd/iommu00/mmio
12+
$ cat /sys/kernel/debug/iommu/amd/iommu00/mmio
13+
14+
Output::
15+
16+
Offset:0x18 Value:0x000c22000003f48d
17+
18+
What: /sys/kernel/debug/iommu/amd/iommu<x>/capability
19+
Date: January 2025
20+
Contact: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
21+
Description:
22+
This file provides read/write access for user input. Users specify the
23+
capability register offset for iommu<x>, and the file outputs the
24+
corresponding capability register value of iommu<x>.
25+
26+
Example::
27+
28+
$ echo "0x10" > /sys/kernel/debug/iommu/amd/iommu00/capability
29+
$ cat /sys/kernel/debug/iommu/amd/iommu00/capability
30+
31+
Output::
32+
33+
Offset:0x10 Value:0x00203040
34+
35+
What: /sys/kernel/debug/iommu/amd/iommu<x>/cmdbuf
36+
Date: January 2025
37+
Contact: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
38+
Description:
39+
This file is a read-only output file containing iommu<x> command
40+
buffer entries.
41+
42+
Examples::
43+
44+
$ cat /sys/kernel/debug/iommu/amd/iommu<x>/cmdbuf
45+
46+
Output::
47+
48+
CMD Buffer Head Offset:339 Tail Offset:339
49+
0: 00835001 10000001 00003c00 00000000
50+
1: 00000000 30000005 fffff003 7fffffff
51+
2: 00835001 10000001 00003c01 00000000
52+
3: 00000000 30000005 fffff003 7fffffff
53+
4: 00835001 10000001 00003c02 00000000
54+
5: 00000000 30000005 fffff003 7fffffff
55+
6: 00835001 10000001 00003c03 00000000
56+
7: 00000000 30000005 fffff003 7fffffff
57+
8: 00835001 10000001 00003c04 00000000
58+
9: 00000000 30000005 fffff003 7fffffff
59+
10: 00835001 10000001 00003c05 00000000
60+
11: 00000000 30000005 fffff003 7fffffff
61+
[...]
62+
63+
What: /sys/kernel/debug/iommu/amd/devid
64+
Date: January 2025
65+
Contact: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
66+
Description:
67+
This file provides read/write access for user input. Users specify the
68+
device ID, which can be used to dump IOMMU data structures such as the
69+
interrupt remapping table and device table.
70+
71+
Example:
72+
73+
1.
74+
::
75+
76+
$ echo 0000:01:00.0 > /sys/kernel/debug/iommu/amd/devid
77+
$ cat /sys/kernel/debug/iommu/amd/devid
78+
79+
Output::
80+
81+
0000:01:00.0
82+
83+
2.
84+
::
85+
86+
$ echo 01:00.0 > /sys/kernel/debug/iommu/amd/devid
87+
$ cat /sys/kernel/debug/iommu/amd/devid
88+
89+
Output::
90+
91+
0000:01:00.0
92+
93+
What: /sys/kernel/debug/iommu/amd/devtbl
94+
Date: January 2025
95+
Contact: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
96+
Description:
97+
This file is a read-only output file containing the device table entry
98+
for the device ID provided in /sys/kernel/debug/iommu/amd/devid.
99+
100+
Example::
101+
102+
$ cat /sys/kernel/debug/iommu/amd/devtbl
103+
104+
Output::
105+
106+
DeviceId QWORD[3] QWORD[2] QWORD[1] QWORD[0] iommu
107+
0000:01:00.0 0000000000000000 20000001373b8013 0000000000000038 6000000114d7b603 iommu3
108+
109+
What: /sys/kernel/debug/iommu/amd/irqtbl
110+
Date: January 2025
111+
Contact: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
112+
Description:
113+
This file is a read-only output file containing valid IRT table entries
114+
for the device ID provided in /sys/kernel/debug/iommu/amd/devid.
115+
116+
Example::
117+
118+
$ cat /sys/kernel/debug/iommu/amd/irqtbl
119+
120+
Output::
121+
122+
DeviceId 0000:01:00.0
123+
IRT[0000] 0000000000000020 0000000000000241
124+
IRT[0001] 0000000000000020 0000000000000841
125+
IRT[0002] 0000000000000020 0000000000002041
126+
IRT[0003] 0000000000000020 0000000000008041
127+
IRT[0004] 0000000000000020 0000000000020041
128+
IRT[0005] 0000000000000020 0000000000080041
129+
IRT[0006] 0000000000000020 0000000000200041
130+
IRT[0007] 0000000000000020 0000000000800041
131+
[...]

Documentation/userspace-api/iommufd.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Following IOMMUFD objects are exposed to userspace:
4343

4444
- IOMMUFD_OBJ_HWPT_PAGING, representing an actual hardware I/O page table
4545
(i.e. a single struct iommu_domain) managed by the iommu driver. "PAGING"
46-
primarly indicates this type of HWPT should be linked to an IOAS. It also
46+
primarily indicates this type of HWPT should be linked to an IOAS. It also
4747
indicates that it is backed by an iommu_domain with __IOMMU_DOMAIN_PAGING
4848
feature flag. This can be either an UNMANAGED stage-1 domain for a device
4949
running in the user space, or a nesting parent stage-2 domain for mappings
@@ -76,7 +76,7 @@ Following IOMMUFD objects are exposed to userspace:
7676

7777
* Security namespace for guest owned ID, e.g. guest-controlled cache tags
7878
* Non-device-affiliated event reporting, e.g. invalidation queue errors
79-
* Access to a sharable nesting parent pagetable across physical IOMMUs
79+
* Access to a shareable nesting parent pagetable across physical IOMMUs
8080
* Virtualization of various platforms IDs, e.g. RIDs and others
8181
* Delivery of paravirtualized invalidation
8282
* Direct assigned invalidation queues
@@ -124,6 +124,17 @@ Following IOMMUFD objects are exposed to userspace:
124124
used to allocate a vEVENTQ. Each vIOMMU can support multiple types of vEVENTS,
125125
but is confined to one vEVENTQ per vEVENTQ type.
126126

127+
- IOMMUFD_OBJ_HW_QUEUE, representing a hardware accelerated queue, as a subset
128+
of IOMMU's virtualization features, for the IOMMU HW to directly read or write
129+
the virtual queue memory owned by a guest OS. This HW-acceleration feature can
130+
allow VM to work with the IOMMU HW directly without a VM Exit, so as to reduce
131+
overhead from the hypercalls. Along with the HW QUEUE object, iommufd provides
132+
user space an mmap interface for VMM to mmap a physical MMIO region from the
133+
host physical address space to the guest physical address space, allowing the
134+
guest OS to directly control the allocated HW QUEUE. Thus, when allocating a
135+
HW QUEUE, the VMM must request a pair of mmap info (offset/length) and pass in
136+
exactly to an mmap syscall via its offset and length arguments.
137+
127138
All user-visible objects are destroyed via the IOMMU_DESTROY uAPI.
128139

129140
The diagrams below show relationships between user-visible objects and kernel
@@ -270,6 +281,7 @@ User visible objects are backed by following datastructures:
270281
- iommufd_viommu for IOMMUFD_OBJ_VIOMMU.
271282
- iommufd_vdevice for IOMMUFD_OBJ_VDEVICE.
272283
- iommufd_veventq for IOMMUFD_OBJ_VEVENTQ.
284+
- iommufd_hw_queue for IOMMUFD_OBJ_HW_QUEUE.
273285

274286
Several terminologies when looking at these datastructures:
275287

arch/powerpc/kvm/powerpc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
550550

551551
#ifdef CONFIG_PPC_BOOK3S_64
552552
case KVM_CAP_SPAPR_TCE:
553+
fallthrough;
553554
case KVM_CAP_SPAPR_TCE_64:
554-
r = 1;
555-
break;
556555
case KVM_CAP_SPAPR_TCE_VFIO:
557-
r = !!cpu_has_feature(CPU_FTR_HVMODE);
558-
break;
559556
case KVM_CAP_PPC_RTAS:
560557
case KVM_CAP_PPC_FIXUP_HCALL:
561558
case KVM_CAP_PPC_ENABLE_HCALL:

drivers/dma/idxd/init.c

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -705,27 +705,6 @@ static void idxd_disable_system_pasid(struct idxd_device *idxd)
705705
idxd->pasid = IOMMU_PASID_INVALID;
706706
}
707707

708-
static int idxd_enable_sva(struct pci_dev *pdev)
709-
{
710-
int ret;
711-
712-
ret = iommu_dev_enable_feature(&pdev->dev, IOMMU_DEV_FEAT_IOPF);
713-
if (ret)
714-
return ret;
715-
716-
ret = iommu_dev_enable_feature(&pdev->dev, IOMMU_DEV_FEAT_SVA);
717-
if (ret)
718-
iommu_dev_disable_feature(&pdev->dev, IOMMU_DEV_FEAT_IOPF);
719-
720-
return ret;
721-
}
722-
723-
static void idxd_disable_sva(struct pci_dev *pdev)
724-
{
725-
iommu_dev_disable_feature(&pdev->dev, IOMMU_DEV_FEAT_SVA);
726-
iommu_dev_disable_feature(&pdev->dev, IOMMU_DEV_FEAT_IOPF);
727-
}
728-
729708
static int idxd_probe(struct idxd_device *idxd)
730709
{
731710
struct pci_dev *pdev = idxd->pdev;
@@ -740,17 +719,13 @@ static int idxd_probe(struct idxd_device *idxd)
740719
dev_dbg(dev, "IDXD reset complete\n");
741720

742721
if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM) && sva) {
743-
if (idxd_enable_sva(pdev)) {
744-
dev_warn(dev, "Unable to turn on user SVA feature.\n");
745-
} else {
746-
set_bit(IDXD_FLAG_USER_PASID_ENABLED, &idxd->flags);
722+
set_bit(IDXD_FLAG_USER_PASID_ENABLED, &idxd->flags);
747723

748-
rc = idxd_enable_system_pasid(idxd);
749-
if (rc)
750-
dev_warn(dev, "No in-kernel DMA with PASID. %d\n", rc);
751-
else
752-
set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
753-
}
724+
rc = idxd_enable_system_pasid(idxd);
725+
if (rc)
726+
dev_warn(dev, "No in-kernel DMA with PASID. %d\n", rc);
727+
else
728+
set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
754729
} else if (!sva) {
755730
dev_warn(dev, "User forced SVA off via module param.\n");
756731
}
@@ -788,8 +763,6 @@ static int idxd_probe(struct idxd_device *idxd)
788763
err:
789764
if (device_pasid_enabled(idxd))
790765
idxd_disable_system_pasid(idxd);
791-
if (device_user_pasid_enabled(idxd))
792-
idxd_disable_sva(pdev);
793766
return rc;
794767
}
795768

@@ -800,8 +773,6 @@ static void idxd_cleanup(struct idxd_device *idxd)
800773
idxd_cleanup_internals(idxd);
801774
if (device_pasid_enabled(idxd))
802775
idxd_disable_system_pasid(idxd);
803-
if (device_user_pasid_enabled(idxd))
804-
idxd_disable_sva(idxd->pdev);
805776
}
806777

807778
/*

drivers/gpu/host1x/dev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,10 @@ static bool host1x_wants_iommu(struct host1x *host1x)
367367
return true;
368368
}
369369

370+
/*
371+
* Returns ERR_PTR on failure, NULL if the translation is IDENTITY, otherwise a
372+
* valid paging domain.
373+
*/
370374
static struct iommu_domain *host1x_iommu_attach(struct host1x *host)
371375
{
372376
struct iommu_domain *domain = iommu_get_domain_for_dev(host->dev);
@@ -391,6 +395,8 @@ static struct iommu_domain *host1x_iommu_attach(struct host1x *host)
391395
* Similarly, if host1x is already attached to an IOMMU (via the DMA
392396
* API), don't try to attach again.
393397
*/
398+
if (domain && domain->type == IOMMU_DOMAIN_IDENTITY)
399+
domain = NULL;
394400
if (!host1x_wants_iommu(host) || domain)
395401
return domain;
396402

0 commit comments

Comments
 (0)