On Mon, 29 Sep 2025 14:36:18 +0100 Shameer Kolothum <[email protected]> wrote:
> From: Nicolin Chen <[email protected]> > > Add a helper to allocate an iommufd device's virtual device (in the user > space) per a viommu instance. > > While at it, introduce a struct IOMMUFDVdev for later use by vendor > IOMMU implementations. > > Signed-off-by: Nicolin Chen <[email protected]> > Reviewed-by: Eric Auger <[email protected]> > Signed-off-by: Shameer Kolothum <[email protected]> > Signed-off-by: Shameer Kolothum <[email protected]> A theme emerging. See below. Reviewed-by: Jonathan Cameron <[email protected]> > diff --git a/include/system/iommufd.h b/include/system/iommufd.h > index dfe1dc2850..e852193f35 100644 > --- a/include/system/iommufd.h > +++ b/include/system/iommufd.h > @@ -48,6 +48,14 @@ typedef struct IOMMUFDViommu { > uint32_t viommu_id; /* virtual IOMMU ID of allocated object */ > } IOMMUFDViommu; > > +/* > + * Virtual device object for a physical device bind to a vIOMMU. > + */ > +typedef struct IOMMUFDVdev { > + uint32_t vdev_id; /* Virtual device ID */ > + uint32_t dev_id; /* Physical device ID */ Spacing and capitalization is a bit is consistent... Previous patch had lowercase v in similar comments. > +} IOMMUFDVdev; > + > bool iommufd_backend_connect(IOMMUFDBackend *be, Error **errp); > void iommufd_backend_disconnect(IOMMUFDBackend *be); > > @@ -73,6 +81,10 @@ bool iommufd_backend_alloc_viommu(IOMMUFDBackend *be, > uint32_t dev_id, > uint32_t viommu_type, uint32_t hwpt_id, > uint32_t *out_hwpt, Error **errp); > > +bool iommufd_backend_alloc_vdev(IOMMUFDBackend *be, uint32_t dev_id, > + uint32_t viommu_id, uint64_t virt_id, > + uint32_t *out_vdev_id, Error **errp); > + > bool iommufd_backend_set_dirty_tracking(IOMMUFDBackend *be, uint32_t hwpt_id, > bool start, Error **errp); > bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id,
