RE: [PATCH v1 3/3] iommu/arm-smmu-v3-iommufd: Require exactly one Stream ID for a vDEVICE

From: Tian, Kevin

Date: Fri Jul 03 2026 - 02:41:23 EST


> From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> Sent: Tuesday, June 30, 2026 5:16 AM
> }
>
> +static int arm_vsmmu_vdevice_init(struct iommufd_vdevice *vdev)
> +{
> + struct device *dev = iommufd_vdevice_to_device(vdev);
> + struct arm_smmu_master *master = dev_iommu_priv_get(dev);
> +
> + /*
> + * arm_vsmmu_vsid_to_sid() maps a vSID to master->streams[0]
> alone, so
> + * more streams would leave the rest stale and none reads out of
> bounds.
> + */
> + if (master->num_streams != 1)
> + return -EINVAL;
> + return 0;
> +}

- EOPNOTSUPP, given the comment seems to indicate it as a current
limitation hence may be removed in future? otherwise with -EINVAL
this may be documented somewhere to get attention from userspace.

arm_vsmmu_vsid_to_sid()

/* At this moment, iommufd only supports PCI device that has one SID */
if (sid)
*sid = master->streams[0].id;

otherwise,

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>