]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommufd/viommu: Add iommufd_viommu_get_vdev_id helper
authorNicolin Chen <nicolinc@nvidia.com>
Tue, 11 Mar 2025 19:44:24 +0000 (12:44 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 18 Mar 2025 17:17:47 +0000 (14:17 -0300)
commitea94b211c5483080b749c142090f4c4de4926e51
tree4e65f9ca4e1e1f5a37c77eb38b8e7f11f9bfff8b
parente36ba5ab808ef6237c3148d469c8238674230e2b
iommufd/viommu: Add iommufd_viommu_get_vdev_id helper

This is a reverse search v.s. iommufd_viommu_find_dev, as drivers may want
to convert a struct device pointer (physical) to its virtual device ID for
an event injection to the user space VM.

Again, this avoids exposing more core structures to the drivers, than the
iommufd_viommu alone.

Link: https://patch.msgid.link/r/18b8e8bc1b8104d43b205d21602c036fd0804e56.1741719725.git.nicolinc@nvidia.com
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/driver.c
include/linux/iommufd.h