Skip to content

Commit 54d6068

Browse files
LuBaolujgunthorpe
authored andcommitted
iommu: Add IOMMU_DOMAIN_NESTED
Introduce a new domain type for a user I/O page table, which is nested on top of another user space address represented by a PAGING domain. This new domain can be allocated by the domain_alloc_user op, and attached to a device through the existing iommu_attach_device/group() interfaces. The mappings of a nested domain are managed by user space software, so it is not necessary to have map/unmap callbacks. Link: https://lore.kernel.org/r/20231026043938.63898-2-yi.l.liu@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 2ccabf8 commit 54d6068

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/iommu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ struct iommu_domain_geometry {
6767

6868
#define __IOMMU_DOMAIN_SVA (1U << 4) /* Shared process address space */
6969

70+
#define __IOMMU_DOMAIN_NESTED (1U << 6) /* User-managed address space nested
71+
on a stage-2 translation */
72+
7073
#define IOMMU_DOMAIN_ALLOC_FLAGS ~__IOMMU_DOMAIN_DMA_FQ
7174
/*
7275
* This are the possible domain-types
@@ -93,6 +96,7 @@ struct iommu_domain_geometry {
9396
__IOMMU_DOMAIN_DMA_API | \
9497
__IOMMU_DOMAIN_DMA_FQ)
9598
#define IOMMU_DOMAIN_SVA (__IOMMU_DOMAIN_SVA)
99+
#define IOMMU_DOMAIN_NESTED (__IOMMU_DOMAIN_NESTED)
96100

97101
struct iommu_domain {
98102
unsigned type;

0 commit comments

Comments
 (0)