diff options
author | Nicolin Chen <nicolinc@nvidia.com> | 2023-03-27 02:33:47 -0700 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-03-31 13:43:31 -0300 |
commit | 54b47585db6658a5eb898d4d45be18d1e581c1bf (patch) | |
tree | dec5549ad4008a01b047afa1aa1ad562374ca7f9 /drivers/fpga/fpga-bridge.c | |
parent | 325de950297b4295890715b041a143d152ea4971 (diff) | |
download | linux-54b47585db6658a5eb898d4d45be18d1e581c1bf.tar.gz linux-54b47585db6658a5eb898d4d45be18d1e581c1bf.tar.bz2 linux-54b47585db6658a5eb898d4d45be18d1e581c1bf.zip |
iommufd: Create access in vfio_iommufd_emulated_bind()
There are needs to created iommufd_access prior to have an IOAS and set
IOAS later. Like the vfio device cdev needs to have an iommufd object
to represent the bond (iommufd_access) and IOAS replacement.
Moves the iommufd_access_create() call into vfio_iommufd_emulated_bind(),
making it symmetric with the __vfio_iommufd_access_destroy() call in the
vfio_iommufd_emulated_unbind(). This means an access is created/destroyed
by the bind()/unbind(), and the vfio_iommufd_emulated_attach_ioas() only
updates the access->ioas pointer.
Since vfio_iommufd_emulated_bind() does not provide ioas_id, drop it from
the argument list of iommufd_access_create(). Instead, add a new access
API iommufd_access_attach() to set the access->ioas pointer. Also, set
vdev->iommufd_attached accordingly, similar to the physical pathway.
Link: https://lore.kernel.org/r/20230327093351.44505-3-yi.l.liu@intel.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Terrence Xu <terrence.xu@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions