summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYi Liu <yi.l.liu@intel.com>2023-09-28 00:15:26 -0700
committerJason Gunthorpe <jgg@nvidia.com>2023-10-10 13:31:24 -0300
commit4ff542163397073f86eda484318d61980ff1031d (patch)
tree669d646d8406901948e805715ecf8f5041d2d9af /include
parent89d63875d80ea127280c60dd4cd101af1d9b6557 (diff)
downloadlinux-stable-4ff542163397073f86eda484318d61980ff1031d.tar.gz
linux-stable-4ff542163397073f86eda484318d61980ff1031d.tar.bz2
linux-stable-4ff542163397073f86eda484318d61980ff1031d.zip
iommufd: Support allocating nested parent domain
Extend IOMMU_HWPT_ALLOC to allocate domains to be used as parent (stage-2) in nested translation. Add IOMMU_HWPT_ALLOC_NEST_PARENT to the uAPI. Link: https://lore.kernel.org/r/20230928071528.26258-5-yi.l.liu@intel.com Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/iommufd.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h
index b4ba0c0cbab6..4a7c5c8fdbb4 100644
--- a/include/uapi/linux/iommufd.h
+++ b/include/uapi/linux/iommufd.h
@@ -348,9 +348,19 @@ struct iommu_vfio_ioas {
#define IOMMU_VFIO_IOAS _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VFIO_IOAS)
/**
+ * enum iommufd_hwpt_alloc_flags - Flags for HWPT allocation
+ * @IOMMU_HWPT_ALLOC_NEST_PARENT: If set, allocate a domain which can serve
+ * as the parent domain in the nesting
+ * configuration.
+ */
+enum iommufd_hwpt_alloc_flags {
+ IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0,
+};
+
+/**
* struct iommu_hwpt_alloc - ioctl(IOMMU_HWPT_ALLOC)
* @size: sizeof(struct iommu_hwpt_alloc)
- * @flags: Must be 0
+ * @flags: Combination of enum iommufd_hwpt_alloc_flags
* @dev_id: The device to allocate this HWPT for
* @pt_id: The IOAS to connect this HWPT to
* @out_hwpt_id: The ID of the new HWPT