iommufd: File descriptor, context, kconfig and makefiles
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 29 Nov 2022 20:29:29 +0000 (16:29 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 1 Dec 2022 00:16:49 +0000 (20:16 -0400)
commit2ff4bed7fee72ba1abfcff5f11ae8f8e570353f2
treee932c21eef44174131e88a1f8cc5ffc5175589fb
parent658234de0d2ed3a1b86d793f4772e38a2e039b35
iommufd: File descriptor, context, kconfig and makefiles

This is the basic infrastructure of a new miscdevice to hold the iommufd
IOCTL API.

It provides:
 - A miscdevice to create file descriptors to run the IOCTL interface over

 - A table based ioctl dispatch and centralized extendable pre-validation
   step

 - An xarray mapping userspace ID's to kernel objects. The design has
   multiple inter-related objects held within in a single IOMMUFD fd

 - A simple usage count to build a graph of object relations and protect
   against hostile userspace racing ioctls

The only IOCTL provided in this patch is the generic 'destroy any object
by handle' operation.

Link: https://lore.kernel.org/r/6-v6-a196d26f289e+11787-iommufd_jgg@nvidia.com
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Yi Liu <yi.l.liu@intel.com>
Tested-by: Lixiao Yang <lixiao.yang@intel.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Documentation/userspace-api/ioctl/ioctl-number.rst
MAINTAINERS
drivers/iommu/Kconfig
drivers/iommu/Makefile
drivers/iommu/iommufd/Kconfig [new file with mode: 0644]
drivers/iommu/iommufd/Makefile [new file with mode: 0644]
drivers/iommu/iommufd/iommufd_private.h [new file with mode: 0644]
drivers/iommu/iommufd/main.c [new file with mode: 0644]
include/linux/iommufd.h [new file with mode: 0644]
include/uapi/linux/iommufd.h [new file with mode: 0644]