Re: [PATCH RFC v2 0/3] Add set_dev_data and unset_dev_data support

Jason Gunthorpe
2023-04-21T17:59:59Z

On Fri, Apr 21, 2023 at 10:37:22AM -0700, Nicolin Chen wrote:

> How about the following piece? Needs a test with QEMU though..
>
> static const size_t iommufd_device_data_size[] = {
> [IOMMU_HW_INFO_TYPE_NONE] = 0,
> [IOMMU_HW_INFO_TYPE_INTEL_VTD] = 0,
> [IOMMU_HW_INFO_TYPE_ARM_SMMUV3] =
> sizeof(struct iommu_device_data_arm_smmuv3),
> };

If we need more than one of these things we'll need a better
solution..

> rc = ops->set_dev_data_user(idev->dev, data);

Where will the iommu driver store the vsid to sid xarray from these
arguments?

Jason