Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
e55f58e
wqiommu/arm-smmu-v3: Add a type for the STE
jgunthorpe Dec 5, 2023
e8244ab
iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg
shavitmichael Sep 15, 2023
3751e71
iommu/arm-smmu-v3: Replace s1_cfg with cdtab_cfg
shavitmichael Sep 15, 2023
a3244c7
iommu/arm-smmu-v3: Encapsulate ctx_desc_cfg init in alloc_cd_tables
shavitmichael Sep 15, 2023
9c3af3a
iommu/arm-smmu-v3: move stall_enabled to the cd table
shavitmichael Sep 15, 2023
46d0e63
iommu/arm-smmu-v3: Refactor write_ctx_desc
shavitmichael Sep 15, 2023
a4a69c3
iommu/arm-smmu-v3: Move CD table to arm_smmu_master
shavitmichael Sep 15, 2023
8e50838
iommu/arm-smmu-v3: Cleanup arm_smmu_domain_finalise
shavitmichael Sep 15, 2023
0c1de2d
iommu/arm-smmu-v3: Update comment about STE liveness
shavitmichael Sep 15, 2023
3e0f425
iommu/arm-smmu-v3: Rename cdcfg to cd_table
shavitmichael Sep 15, 2023
ed4a457
iommu/arm-smmu-v3: Master cannot be NULL in arm_smmu_write_strtab_ent()
jgunthorpe Dec 5, 2023
772ab80
iommu: Add iommu_ops->identity_domain
jgunthorpe Sep 13, 2023
4999ec9
iommu: Add IOMMU_DOMAIN_PLATFORM
jgunthorpe Sep 13, 2023
d278f9a
iommu: Add new iommu op to create domains owned by userspace
yiliu1765 Sep 28, 2023
f860737
iommufd: Use the domain_alloc_user() op for domain allocation
yiliu1765 Sep 28, 2023
22c14d7
iommufd: Flow user flags for domain allocation to domain_alloc_user()
yiliu1765 Sep 28, 2023
436a94e
iommufd: Support allocating nested parent domain
yiliu1765 Sep 28, 2023
9d2b86c
iommufd/selftest: Add domain_alloc_user() support in iommu mock
yiliu1765 Sep 28, 2023
6d48e21
iommu/vt-d: Add domain_alloc_user op
yiliu1765 Sep 28, 2023
ce439d0
iommu/vt-d: Enhance capability check for nested parent domain allocation
yiliu1765 Oct 24, 2023
67ffdfe
iommufd: Correct IOMMU_HWPT_ALLOC_NEST_PARENT description
nicolinc Oct 17, 2023
545a9b2
vfio/iova_bitmap: Export more API symbols
jpemartins Oct 24, 2023
d1fdc5c
vfio: Move iova_bitmap into iommufd
jpemartins Oct 24, 2023
72d2ea2
iommufd/iova_bitmap: Move symbols to IOMMUFD namespace
jpemartins Oct 24, 2023
629340a
iommu: Add iommu_domain ops for dirty tracking
jpemartins Oct 24, 2023
4297538
iommufd: Add a flag to enforce dirty tracking on attach
jpemartins Oct 24, 2023
70a911e
iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING
jpemartins Oct 24, 2023
3cbadb2
iommufd: Add IOMMU_HWPT_GET_DIRTY_BITMAP
jpemartins Oct 24, 2023
af749fe
iommufd: Add capabilities to IOMMU_GET_HW_INFO
jpemartins Oct 24, 2023
01f7aac
iommufd: Add a flag to skip clearing of IOPTE dirty
jpemartins Oct 24, 2023
52076e9
iommu/vt-d: Access/Dirty bit support for SS domains
jpemartins Oct 24, 2023
2f751fa
iommufd/selftest: Expand mock_domain with dev_flags
jpemartins Oct 24, 2023
92b158b
iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING
jpemartins Oct 24, 2023
c62dfd2
iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING
jpemartins Oct 24, 2023
cdf5d5d
iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP
jpemartins Oct 24, 2023
5129ad3
iommufd/selftest: Test out_capabilities in IOMMU_GET_HW_INFO
jpemartins Oct 24, 2023
4cd18ff
iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag
jpemartins Oct 24, 2023
24bce8a
iommufd/selftest: Fix page-size check in iommufd_test_dirty()
jpemartins Oct 30, 2023
dedc7fc
iommu/vt-d: Set variable intel_dirty_ops to static
KunWuChan Nov 22, 2023
426e4c8
iommufd/selftest: Fix _test_mock_dirty_bitmaps()
rmurphy-arm Nov 16, 2023
6aa6816
iommufd/selftest: Make dirty_ops static
Aug 19, 2024
e1e5f34
iommufd/iova_bitmap: Handle recording beyond the mapped pages
jpemartins Feb 2, 2024
e812fd2
iommufd/selftest: Add mock IO hugepages tests
jpemartins Feb 2, 2024
2f98f97
iommufd/selftest: Refactor mock_domain_read_and_clear_dirty()
jpemartins Feb 2, 2024
5241efc
iommufd/selftest: Test u64 unaligned bitmaps
jpemartins Feb 2, 2024
e848195
iommufd/selftest: Refactor dirty bitmap tests
jpemartins Feb 2, 2024
41b0768
iommufd/selftest: Fix iommufd_dirty_tracking with large hugepage sizes
nicolinc Jun 24, 2025
5900d4b
iommufd: Only enforce cache coherency in iommufd_hw_pagetable_alloc
nicolinc Oct 24, 2023
711c7ca
iommu: Add IOMMU_DOMAIN_NESTED
LuBaolu Oct 26, 2023
bc2d30f
iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING
jgunthorpe Oct 26, 2023
06e00f3
iommufd/device: Wrap IOMMUFD_OBJ_HWPT_PAGING-only configurations
jgunthorpe Oct 26, 2023
009f7ce
iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable
nicolinc Oct 26, 2023
093ebdc
iommufd: Share iommufd_hwpt_alloc with IOMMUFD_OBJ_HWPT_NESTED
nicolinc Oct 26, 2023
d6dd1fc
iommu: Pass in parent domain with user_data to domain_alloc_user op
yiliu1765 Oct 26, 2023
7562ede
iommufd: Add a nested HW pagetable object
nicolinc Oct 26, 2023
a0e6ab8
iommu: Add iommu_copy_struct_from_user helper
nicolinc Oct 26, 2023
95fee8b
iommufd/selftest: Add nested domain allocation for mock domain
nicolinc Oct 26, 2023
ea0347c
iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs
nicolinc Oct 26, 2023
86e96d3
iommufd: Organize the mock domain alloc functions closer to Joerg's tree
jgunthorpe Oct 30, 2023
6b90a8a
powerpc/iommu: Setup a default domain and remove set_platform_dma_ops
jgunthorpe Sep 13, 2023
c5c64fa
iommu: Add IOMMU_DOMAIN_PLATFORM for S390
jgunthorpe Sep 13, 2023
db92f15
iommu/fsl_pamu: Implement a PLATFORM domain
jgunthorpe Sep 13, 2023
bcee4f4
iommu/tegra-gart: Remove tegra-gart
jgunthorpe Sep 13, 2023
70885da
iommu/mtk_iommu_v1: Implement an IDENTITY domain
jgunthorpe Sep 13, 2023
b3c7228
iommu: Reorganize iommu_get_default_domain_type() to respect def_doma…
jgunthorpe Sep 13, 2023
4fc517c
iommu: Allow an IDENTITY domain as the default_domain in ARM32
jgunthorpe Sep 13, 2023
b49da43
iommu/exynos: Implement an IDENTITY domain
jgunthorpe Sep 13, 2023
ee43699
iommu/tegra-smmu: Implement an IDENTITY domain
jgunthorpe Sep 13, 2023
ba23bb0
iommu/tegra-smmu: Support DMA domains in tegra
jgunthorpe Sep 13, 2023
4107d93
iommu/omap: Implement an IDENTITY domain
jgunthorpe Sep 13, 2023
7a41db1
iommu/msm: Implement an IDENTITY domain
jgunthorpe Sep 13, 2023
8571d70
iommu/qcom_iommu: Add an IOMMU_IDENTITIY_DOMAIN
jgunthorpe Sep 13, 2023
7886178
iommu/ipmmu: Add an IOMMU_IDENTITIY_DOMAIN
jgunthorpe Sep 13, 2023
90168b2
iommu/mtk_iommu: Add an IOMMU_IDENTITIY_DOMAIN
jgunthorpe Sep 13, 2023
1ddc1e0
iommu/sun50i: Add an IOMMU_IDENTITIY_DOMAIN
jgunthorpe Sep 13, 2023
66784ef
iommu: Require a default_domain for all iommu drivers
jgunthorpe Sep 13, 2023
7522b6d
iommu: Add __iommu_group_domain_alloc()
jgunthorpe Sep 13, 2023
ca8cf91
iommu: Add ops->domain_alloc_paging()
jgunthorpe Sep 13, 2023
d4f5690
iommu/arm-smmu-v3: Do not ATC invalidate the entire domain
jgunthorpe Mar 27, 2024
a03aee5
iommu: Convert simple drivers with DOMAIN_DMA to domain_alloc_paging()
jgunthorpe Sep 13, 2023
ba2566a
iommu: Convert remaining simple drivers to domain_alloc_paging()
jgunthorpe Sep 13, 2023
3615c79
powerpc/iommu: Do not do platform domain attach atctions after probe
jgunthorpe Oct 5, 2023
6f7c851
drm/tegra: Do not assume that a NULL domain means no DMA IOMMU
jgunthorpe Jan 30, 2024
025c810
iommu: Do not use IOMMU_DOMAIN_DMA if CONFIG_IOMMU_DMA is not enabled
jgunthorpe Oct 3, 2023
3a4e901
iommu: Allow ops->default_domain to work when !CONFIG_IOMMU_DMA
jgunthorpe Jan 30, 2024
87465fa
iommu/amd: Enhance def_domain_type to handle untrusted device
hegdevasant Apr 23, 2024
8f761b4
iommu/arm-smmu-v3: Make STE programming independent of the callers
jgunthorpe Feb 26, 2024
c0f840f
iommu/arm-smmu-v3: Consolidate the STE generation for abort/bypass
jgunthorpe Feb 26, 2024
715947b
iommu/arm-smmu-v3: Move the STE generation for S1 and S2 domains into…
jgunthorpe Feb 26, 2024
bcec42c
iommu/arm-smmu-v3: Build the whole STE in arm_smmu_make_s2_domain_ste()
jgunthorpe Feb 26, 2024
d10a20b
iommu/arm-smmu-v3: Hold arm_smmu_asid_lock during all of attach_dev
jgunthorpe Feb 26, 2024
03ec58a
iommu/arm-smmu-v3: Compute the STE only once for each master
jgunthorpe Feb 26, 2024
9df6f8d
iommu/arm-smmu-v3: Do not change the STE twice during arm_smmu_attach…
jgunthorpe Feb 26, 2024
10e9b8f
iommu/arm-smmu-v3: Put writing the context descriptor in the right order
jgunthorpe Feb 26, 2024
1e7491f
iommu/arm-smmu-v3: Pass smmu_domain to arm_enable/disable_ats()
jgunthorpe Feb 26, 2024
0b04a1a
iommu/arm-smmu-v3: Remove arm_smmu_master->domain
jgunthorpe Feb 26, 2024
ec6498c
iommu/arm-smmu-v3: Check that the RID domain is S1 in SVA
jgunthorpe Feb 26, 2024
4472d15
iommu/arm-smmu-v3: Add a global static IDENTITY domain
jgunthorpe Feb 26, 2024
113bab4
iommu/arm-smmu-v3: Add a global static BLOCKED domain
jgunthorpe Feb 26, 2024
1d35088
iommu/arm-smmu-v3: Use the identity/blocked domain during release
jgunthorpe Feb 26, 2024
b105ead
iommu/arm-smmu-v3: Pass arm_smmu_domain and arm_smmu_device to finalize
jgunthorpe Feb 26, 2024
cc592ac
iommu/arm-smmu-v3: Convert to domain_alloc_paging()
jgunthorpe Feb 26, 2024
b2b86ea
iommu/arm-smmu-v3-sva: Remove unused iommu_sva handle
shavitmichael Sep 5, 2023
a5eedce
iommu/arm-smmu-v3-sva: Remove bond refcount
shavitmichael Sep 5, 2023
c5c0b93
iommu: Move IOMMU_DOMAIN_BLOCKED global statics to ops->blocked_domain
jgunthorpe Sep 27, 2023
6ade8bc
iommu/arm-smmu-v3: Add cpu_to_le64() around STRTAB_STE_0_V
jgunthorpe Mar 4, 2024
7e1861c
iommu/vt-d: Update the definition of the blocking domain
jgunthorpe Sep 27, 2023
c472110
iommu/vt-d: Use ops->blocked_domain
jgunthorpe Sep 27, 2023
bcbc693
iommufd: Convert to alloc_domain_paging()
jgunthorpe Sep 27, 2023
625cdd1
iommu/dart: Use static global identity domains
jgunthorpe Sep 27, 2023
dd681e7
iommu/dart: Move the blocked domain support to a global static
jgunthorpe Sep 27, 2023
27b8e67
iommu/dart: Convert to domain_alloc_paging()
jgunthorpe Sep 27, 2023
c513cf4
iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging()
jgunthorpe Sep 27, 2023
fd05d60
iommu/dart: Remove the force_bypass variable
jgunthorpe Sep 27, 2023
bf7239d
iommu: Flow ERR_PTR out from __iommu_domain_alloc()
jgunthorpe Nov 1, 2023
2411c28
iommufd: Add iommufd_ctx to iommufd_put_object()
jgunthorpe Nov 12, 2023
ec503f8
iommufd: Do not UAF during iommufd_put_object()
jgunthorpe Nov 12, 2023
3e615d7
iommu/arm-smmu-v3: Add a type for the CD entry
jgunthorpe Mar 27, 2024
f56c18d
iommu: Add mm_get_enqcmd_pasid() helper function
TinaZhangZW Oct 27, 2023
56e3063
mm: Add structure to keep sva information
TinaZhangZW Oct 27, 2023
affd121
iommu: Change kconfig around IOMMU_SVA
jgunthorpe Oct 27, 2023
4fb7521
iommu/vt-d: Remove mm->pasid in intel_sva_bind_mm()
TinaZhangZW Oct 27, 2023
ab228a6
iommu: Support mm PASID 1:n with sva domains
TinaZhangZW Oct 27, 2023
549f012
mm: Deprecate pasid field
TinaZhangZW Oct 27, 2023
8bd2c61
iommu: Introduce iommu_group_mutex_assert()
hegdevasant Feb 5, 2024
f49f13e
iommu/arm-smmu-v3: Do not use GFP_KERNEL under as spinlock
jgunthorpe Feb 22, 2024
f778f81
iommu: Factor out some helpers
rmurphy-arm Nov 21, 2023
17b7b83
iommu: Decouple iommu_present() from bus ops
rmurphy-arm Nov 21, 2023
9e73f59
iommu: Validate that devices match domains
rmurphy-arm Nov 21, 2023
f50840e
iommu: Decouple iommu_domain_alloc() from bus ops
rmurphy-arm Nov 21, 2023
5704024
iommu/arm-smmu: Don't register fwnode for legacy binding
rmurphy-arm Nov 21, 2023
c1b8856
iommu: Retire bus ops
rmurphy-arm Nov 21, 2023
4d9ad85
iommu: Clean up open-coded ownership checks
rmurphy-arm Nov 21, 2023
d34bb04
iommufd: Register iommufd mock devices with fwspec
guixinliu1995 Sep 25, 2025
ab804df
iommufd/selftest: Check the bus type during probe
jgunthorpe Jan 3, 2024
172225b
iommu/omap: Add minimal fwnode support
rmurphy-arm Oct 28, 2024
fe03d9d
iommufd: Check the domain owner of the parent before creating a nesti…
jgunthorpe Aug 29, 2024
9ee9ac8
iommu: Set owner token to SVA domain
LuBaolu Dec 8, 2023
bbe8658
iommu: Move iommu fault data to linux/iommu.h
LuBaolu Feb 12, 2024
57f9879
iommu/arm-smmu-v3: Remove unrecoverable faults reporting
LuBaolu Feb 12, 2024
073ebc9
iommu: Remove unrecoverable fault data
LuBaolu Feb 12, 2024
bc80b15
iommu: Cleanup iopf data structure definitions
LuBaolu Feb 12, 2024
dba2da5
iommu: Merge iopf_device_param into iommu_fault_param
LuBaolu Feb 12, 2024
7e9914b
iommu: Remove iommu_[un]register_device_fault_handler()
LuBaolu Feb 12, 2024
88ac2fd
iommu: Merge iommu_fault_event and iopf_fault
LuBaolu Feb 12, 2024
f27d1ec
iommu: Prepare for separating SVA and IOPF
LuBaolu Feb 12, 2024
1d00ac2
iommu: Make iommu_queue_iopf() more generic
LuBaolu Feb 12, 2024
5e40500
iommu: Separate SVA and IOPF
LuBaolu Feb 12, 2024
06085b6
iommu: Refine locking for per-device fault data management
LuBaolu Feb 12, 2024
e622607
iommu: Use refcount for fault data access
LuBaolu Feb 12, 2024
4812f24
iommu: Improve iopf_queue_remove_device()
LuBaolu Feb 12, 2024
ab413c5
iommu: Track iopf group instead of last fault
LuBaolu Feb 12, 2024
210e639
iommu: Make iopf_group_response() return void
LuBaolu Feb 12, 2024
f903455
iommu: Make iommu_report_device_fault() return void
LuBaolu Feb 12, 2024
4f2ef92
iommu: Fix potential memory leak in iopf_queue_remove_device()
LuBaolu Jan 17, 2025
dd5240a
iommu/sva: Restore SVA handle sharing
jgunthorpe Feb 22, 2024
b0a0eb2
iommu/arm-smmu-v3: Fix access for STE.SHCFG
misaleh Mar 23, 2024
3b9ab76
iommu: Pass domain to remove_dev_pasid() op
yiliu1765 Mar 28, 2024
40c8a7a
iommu: Add ops->domain_alloc_sva()
jgunthorpe Apr 18, 2024
6fa87a9
iommu: Make iommu_sva_domain_alloc() static
LuBaolu May 28, 2024
285593a
iommu: Introduce domain attachment handle
LuBaolu Jul 2, 2024
bc92077
iommu: Remove sva handle list
LuBaolu Jul 2, 2024
69790d3
iommu: Add attach handle to struct iopf_group
LuBaolu Jul 2, 2024
604cd0e
iommu: Extend domain attach group with handle support
LuBaolu Jul 2, 2024
05cf257
iommufd: Add fault and response message definitions
LuBaolu Jul 2, 2024
77ad3aa
iommufd: Add iommufd fault object
LuBaolu Jul 2, 2024
7f12a15
iommufd: Fault-capable hwpt attach/detach/replace
LuBaolu Jul 2, 2024
61d7abe
iommufd: Associate fault object with iommufd_hw_pgtable
LuBaolu Jul 2, 2024
fd06139
iommufd/selftest: Add IOPF support for mock device
LuBaolu Jul 2, 2024
edb707b
iommufd/selftest: Add coverage for IOPF test
LuBaolu Jul 2, 2024
6dd64f7
iommu: Handle iommu faults for a bad iopf setup
pran005 Aug 16, 2024
452b70a
iommu/arm-smmu-v3: Add an ops indirection to the STE code
jgunthorpe Apr 30, 2024
7a41066
iommu/arm-smmu-v3: Make CD programming use arm_smmu_write_entry()
jgunthorpe Apr 30, 2024
7bd3df5
iommu/arm-smmu-v3: Move the CD generation for S1 domains into a function
jgunthorpe Apr 30, 2024
5f45409
iommu/arm-smmu-v3: Consolidate clearing a CD table entry
jgunthorpe Apr 30, 2024
8e998b0
iommu/arm-smmu-v3: Make arm_smmu_alloc_cd_ptr()
jgunthorpe Apr 30, 2024
8e4f416
iommu/arm-smmu-v3: Allocate the CD table entry in advance
jgunthorpe Apr 30, 2024
91f0a43
iommu/arm-smmu-v3: Move the CD generation for SVA into a function
jgunthorpe Apr 30, 2024
4906485
iommu/arm-smmu-v3: Build the whole CD in arm_smmu_make_s1_cd()
jgunthorpe Apr 30, 2024
1b55708
iommu/arm-smmu-v3: Add unit tests for arm_smmu_write_entry
jgunthorpe Apr 30, 2024
2a717dd
iommu/arm-smmu-v3: Avoid uninitialized asid in case of error
misaleh Jun 4, 2024
fe1120f
iommu/arm-smmu-v3: Convert to domain_alloc_sva()
jgunthorpe Jun 25, 2024
c2e53af
iommu/arm-smmu-v3: Start building a generic PASID layer
jgunthorpe Jun 25, 2024
ded407e
iommu/arm-smmu-v3: Make smmu_domain->devices into an allocated list
jgunthorpe Jun 25, 2024
61b1dd0
iommu/arm-smmu-v3: Make changing domains be hitless for ATS
jgunthorpe Jun 25, 2024
95942d4
iommu/arm-smmu-v3: Add ssid to struct arm_smmu_master_domain
jgunthorpe Jun 25, 2024
d25898e
iommu/arm-smmu-v3: Do not use master->sva_enable to restrict attaches
jgunthorpe Jun 25, 2024
bbc6054
iommu/arm-smmu-v3: Thread SSID through the arm_smmu_attach_*() interface
jgunthorpe Jun 25, 2024
adb54a3
iommu/arm-smmu-v3: Make SVA allocate a normal arm_smmu_domain
jgunthorpe Jun 25, 2024
b601b79
iommu/arm-smmu-v3: Keep track of arm_smmu_master_domain for SVA
jgunthorpe Jun 25, 2024
c2f134b
iommu/arm-smmu-v3: Put the SVA mmu notifier in the smmu_domain
jgunthorpe Jun 25, 2024
ee9adca
iommu/arm-smmu-v3: Allow IDENTITY/BLOCKED to be set while PASID is used
jgunthorpe Jun 25, 2024
6730618
iommu/arm-smmu-v3: Test the STE S1DSS functionality
jgunthorpe Jun 25, 2024
1603c0d
iommu/arm-smmu-v3: Allow a PASID to be set when RID is IDENTITY/BLOCKED
jgunthorpe Jun 25, 2024
e807d26
iommu/arm-smmu-v3: Allow setting a S1 domain to a PASID
jgunthorpe Jun 25, 2024
3eb476d
arm64: configs: Add kernel configuration for 6.6.63 with 64k pages
KobaKoNvidia Aug 28, 2025
e8ae659
iommu: Fix return code in iommu_group_alloc_default_domain()
jgunthorpe Oct 4, 2023
348a37e
iommu: Fix two issues in iommu_copy_struct_from_user()
nicolinc Apr 14, 2025
36186bb
iommu/exynos: Fix suspend/resume with IDENTITY domain
mszyprow Apr 1, 2025
bec6076
iommu/arm-smmu-v3: Make the kunit into a module
jgunthorpe May 7, 2024
6bb8a06
gpu: host1x: Do not assume that a NULL domain means no DMA IOMMU
jgunthorpe Feb 4, 2025
9313563
powerpc: iommu: Bring back table group release_ownership() call
ShivaprasadGBhat Jan 26, 2024
5c5c4ac
iommufd/device: Fix hwpt at err_unresv in iommufd_device_do_replace()
nicolinc Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10992,7 +10992,6 @@ F: drivers/iommu/
F: include/linux/iommu.h
F: include/linux/iova.h
F: include/linux/of_iommu.h
F: include/uapi/linux/iommu.h

IOMMUFD
M: Jason Gunthorpe <[email protected]>
Expand Down
5 changes: 5 additions & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ config ARCH_HAS_DMA_CLEAR_UNCACHED
config ARCH_HAS_CPU_FINALIZE_INIT
bool

# The architecture has a per-task state that includes the mm's PASID
config ARCH_HAS_CPU_PASID
bool
select IOMMU_MM_DATA

# Select if arch init_task must go in the __init_task_data section
config ARCH_TASK_STRUCT_ON_STACK
bool
Expand Down
1 change: 0 additions & 1 deletion arch/arm/configs/multi_v7_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,6 @@ CONFIG_QCOM_IPCC=y
CONFIG_OMAP_IOMMU=y
CONFIG_OMAP_IOMMU_DEBUG=y
CONFIG_ROCKCHIP_IOMMU=y
CONFIG_TEGRA_IOMMU_GART=y
CONFIG_TEGRA_IOMMU_SMMU=y
CONFIG_EXYNOS_IOMMU=y
CONFIG_QCOM_IOMMU=y
Expand Down
1 change: 0 additions & 1 deletion arch/arm/configs/tegra_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ CONFIG_CHROME_PLATFORMS=y
CONFIG_CROS_EC=y
CONFIG_CROS_EC_I2C=m
CONFIG_CROS_EC_SPI=m
CONFIG_TEGRA_IOMMU_GART=y
CONFIG_TEGRA_IOMMU_SMMU=y
CONFIG_ARCH_TEGRA_2x_SOC=y
CONFIG_ARCH_TEGRA_3x_SOC=y
Expand Down
72 changes: 43 additions & 29 deletions arch/powerpc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,34 +1280,64 @@ struct iommu_table_group_ops spapr_tce_table_group_ops = {
/*
* A simple iommu_ops to allow less cruft in generic VFIO code.
*/
static int spapr_tce_blocking_iommu_attach_dev(struct iommu_domain *dom,
struct device *dev)
static int
spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain,
struct device *dev)
{
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
struct iommu_group *grp = iommu_group_get(dev);
struct iommu_table_group *table_group;
int ret = -EINVAL;

if (!grp)
return -ENODEV;
/* At first attach the ownership is already set */
if (!domain)
return 0;

table_group = iommu_group_get_iommudata(grp);
ret = table_group->ops->take_ownership(table_group);
/*
* The domain being set to PLATFORM from earlier
* BLOCKED. The table_group ownership has to be released.
*/
table_group->ops->release_ownership(table_group);
iommu_group_put(grp);

return ret;
return 0;
}

static void spapr_tce_blocking_iommu_set_platform_dma(struct device *dev)
static const struct iommu_domain_ops spapr_tce_platform_domain_ops = {
.attach_dev = spapr_tce_platform_iommu_attach_dev,
};

static struct iommu_domain spapr_tce_platform_domain = {
.type = IOMMU_DOMAIN_PLATFORM,
.ops = &spapr_tce_platform_domain_ops,
};

static int
spapr_tce_blocked_iommu_attach_dev(struct iommu_domain *platform_domain,
struct device *dev)
{
struct iommu_group *grp = iommu_group_get(dev);
struct iommu_table_group *table_group;
int ret = -EINVAL;

/*
* FIXME: SPAPR mixes blocked and platform behaviors, the blocked domain
* also sets the dma_api ops
*/
table_group = iommu_group_get_iommudata(grp);
table_group->ops->release_ownership(table_group);
ret = table_group->ops->take_ownership(table_group);
iommu_group_put(grp);

return ret;
}

static const struct iommu_domain_ops spapr_tce_blocking_domain_ops = {
.attach_dev = spapr_tce_blocking_iommu_attach_dev,
static const struct iommu_domain_ops spapr_tce_blocked_domain_ops = {
.attach_dev = spapr_tce_blocked_iommu_attach_dev,
};

static struct iommu_domain spapr_tce_blocked_domain = {
.type = IOMMU_DOMAIN_BLOCKED,
.ops = &spapr_tce_blocked_domain_ops,
};

static bool spapr_tce_iommu_capable(struct device *dev, enum iommu_cap cap)
Expand All @@ -1322,22 +1352,6 @@ static bool spapr_tce_iommu_capable(struct device *dev, enum iommu_cap cap)
return false;
}

static struct iommu_domain *spapr_tce_iommu_domain_alloc(unsigned int type)
{
struct iommu_domain *dom;

if (type != IOMMU_DOMAIN_BLOCKED)
return NULL;

dom = kzalloc(sizeof(*dom), GFP_KERNEL);
if (!dom)
return NULL;

dom->ops = &spapr_tce_blocking_domain_ops;

return dom;
}

static struct iommu_device *spapr_tce_iommu_probe_device(struct device *dev)
{
struct pci_dev *pdev;
Expand Down Expand Up @@ -1371,12 +1385,12 @@ static struct iommu_group *spapr_tce_iommu_device_group(struct device *dev)
}

static const struct iommu_ops spapr_tce_iommu_ops = {
.default_domain = &spapr_tce_platform_domain,
.blocked_domain = &spapr_tce_blocked_domain,
.capable = spapr_tce_iommu_capable,
.domain_alloc = spapr_tce_iommu_domain_alloc,
.probe_device = spapr_tce_iommu_probe_device,
.release_device = spapr_tce_iommu_release_device,
.device_group = spapr_tce_iommu_device_group,
.set_platform_dma_ops = spapr_tce_blocking_iommu_set_platform_dma,
};

static struct attribute *spapr_tce_iommu_attrs[] = {
Expand Down
1 change: 1 addition & 0 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ config X86
select ARCH_HAS_CACHE_LINE_SIZE
select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
select ARCH_HAS_CPU_FINALIZE_INIT
select ARCH_HAS_CPU_PASID if IOMMU_SVA
select ARCH_HAS_CURRENT_STACK_POINTER
select ARCH_HAS_DEBUG_VIRTUAL
select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ static bool fixup_iopl_exception(struct pt_regs *regs)
*/
static bool try_fixup_enqcmd_gp(void)
{
#ifdef CONFIG_IOMMU_SVA
#ifdef CONFIG_ARCH_HAS_CPU_PASID
u32 pasid;

/*
Expand All @@ -694,7 +694,7 @@ static bool try_fixup_enqcmd_gp(void)
if (!mm_valid_pasid(current->mm))
return false;

pasid = current->mm->pasid;
pasid = mm_get_enqcmd_pasid(current->mm);

/*
* Did this thread already have its PASID activated?
Expand Down
Loading