iommu: Add ops->domain_alloc_nested()
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 14 Nov 2024 19:55:30 +0000 (15:55 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 22 Nov 2024 18:43:45 +0000 (14:43 -0400)
commit64214c2b95364d26cdff045d8bbefd37380edbe1
tree15141f250e8dea847afd15e2d096ff96a7b15dfb
parent2d762281950877eb450ac98bc77a6d340f6b5249
iommu: Add ops->domain_alloc_nested()

It turns out all the drivers that are using this immediately call into
another function, so just make that function directly into the op. This
makes paging=NULL for domain_alloc_user and we can remove the argument in
the next patch.

The function mirrors the similar op in the viommu that allocates a nested
domain on top of the viommu's nesting parent. This version supports cases
where a viommu is not being used.

Link: https://patch.msgid.link/r/1-v1-c252ebdeb57b+329-iommu_paging_flags_jgg@nvidia.com
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/iommu.h
drivers/iommu/intel/nested.c
drivers/iommu/iommufd/hw_pagetable.c
drivers/iommu/iommufd/selftest.c
include/linux/iommu.h