[PATCH RFC v1 0/3] Add set_rid_user and unset_rid_user support

From: Nicolin Chen
Date: Thu Apr 06 2023 - 02:26:52 EST


This is a pair of new uAPI/ops for user space to set a user space virtual
Request ID for a passthrough PCI device, down to the IOMMU driver. This's
primarily used by SMMUv3 driver for now, to link the vSID and the pSID of
a device behind the SMMU. The link (lookup table) will be used to verify
an ATC_INV command from the user space for that device, and then replace
the virtual SID with the corresponding physical SID.

This is a RFC series, since I am not confident at all about the uAPI/ops
namings. Hopefully we can finalize this small series soon and include it
in the next version of SMMUv3 nesting series.

This series is available on Github:
https://github.com/nicolinc/iommufd/commits/set_rid_user-rfc-v1

Thanks!
Nicolin

Nicolin Chen (3):
iommu: Add set/unset_rid_user ops
iommufd: Add IOMMUFD_CMD_DEVICE_SET_RID and
IOMMUFD_CMD_DEVICE_UNSET_RID
iommu/arm-smmu-v3: Implement set_rid_user and unset_rid_user

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 45 +++++++++++++++++++++
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 2 +
drivers/iommu/iommufd/device.c | 39 ++++++++++++++++++
drivers/iommu/iommufd/iommufd_private.h | 2 +
drivers/iommu/iommufd/main.c | 4 ++
include/linux/iommu.h | 4 ++
include/uapi/linux/iommufd.h | 31 ++++++++++++++
7 files changed, 127 insertions(+)

--
2.40.0