]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/virtio: Move to domain_alloc_paging()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Apr 2025 16:35:49 +0000 (13:35 -0300)
committerJoerg Roedel <jroedel@suse.de>
Mon, 28 Apr 2025 11:14:58 +0000 (13:14 +0200)
commit07107e74444bedb943ee91ec6072c3baf62f4ae7
tree496ce2a1b6d63c759c09971073014292dc30eb5e
parent0d609a1450fab636c825c66344ab0ecfc1d3a98c
iommu/virtio: Move to domain_alloc_paging()

virtio has the complication that it sometimes wants to return a paging
domain for IDENTITY which makes this conversion a little different than
other drivers.

Add a viommu_domain_alloc_paging() that combines viommu_domain_alloc() and
viommu_domain_finalise() to always return a fully initialized and
finalized paging domain.

Use viommu_domain_alloc_identity() to implement the special non-bypass
IDENTITY flow by calling viommu_domain_alloc_paging() then
viommu_domain_map_identity().

Remove support for deferred finalize and the vdomain->mutex.

Remove core support for domain_alloc() IDENTITY as virtio was the last
driver using it.

Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/3-v4-ff5fb6b03bd1+288-iommu_virtio_domains_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c
drivers/iommu/virtio-iommu.c