Re: [PATCH v2 2/3] iommufd/tsm: add vdevice TSM bind/unbind ioctl

Jason Gunthorpe
2026-03-13T18:48:17Z

On Mon, Mar 09, 2026 at 04:47:03PM +0530, Aneesh Kumar K.V (Arm) wrote:
> @@ -1174,6 +1175,23 @@ enum iommu_veventq_flag {
> IOMMU_VEVENTQ_FLAG_LOST_EVENTS = (1U << 0),
> };
>
> +/**
> + * struct iommu_vdevice_tsm_op - ioctl(IOMMU_VDEVICE_TSM_OP)
> + * @size: sizeof(struct iommu_vdevice_tsm_op)
> + * @op: Either TSM_BIND or TSM_UNBIND
> + * @flags: Must be 0
> + * @vdevice_id: Object handle for the vDevice. Returned from IOMMU_VDEVICE_ALLOC
> + */
> +struct iommu_vdevice_tsm_op {
> + __u32 size;
> + __u32 op;
> + __u32 flags;
> + __u32 vdevice_id;
> +};
> +#define IOMMU_VDEVICE_TSM_OP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VDEVICE_TSM_OP)
> +#define IOMMU_VDEVICE_TSM_BIND 0x1
> +#define IOMMU_VDEVICE_TSM_UNBIND 0x2

use enum for an op, put it before the struct, add kdocs for the enum
members.

Jason