[PATCH v2 10/19] iommufd/viommu: Add vdev_id helpers for IOMMU drivers

Jason Gunthorpe jgg at nvidia.com
Mon Oct 7 08:38:37 PDT 2024


On Fri, Oct 04, 2024 at 10:19:43PM -0700, Nicolin Chen wrote:
> I tried exposing the struct iommufd_viommu to drivers, and was
> able to drop a couple of helpers, except these two:
> 
> struct device *vdev_to_dev(struct iommufd_vdevice *vdev)
> {
> 	return vdev ? vdev->idev->dev : NULL;
> } // Without it, we need to expose struct iommufd_device.
> 
> struct iommu_domain *
> iommufd_viommu_to_parent_domain(struct iommufd_viommu *viommu)
> {
> 	if (!viommu || !viommu->hwpt)
> 		return NULL;
> 	return viommu->hwpt->common.domain;
> } // Without it, we need to expose struct iommufd_hwpt_page.

It seems OK, there isn't really locking entanglements or performance
path on this stuff?

Jason



More information about the linux-arm-kernel mailing list