iommu/virtio: Return size mapped for a detached domain
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Mon, 15 May 2023 11:39:50 +0000 (12:39 +0100)
committerJoerg Roedel <jroedel@suse.de>
Tue, 23 May 2023 06:19:03 +0000 (08:19 +0200)
commit7061b6af34686e7e2364b7240cfb061293218f2d
tree958784ddef6d23d8081cfc7d4f9152cfd0011af0
parent809d0810e3520da669d231303608cdf5fe5c1a70
iommu/virtio: Return size mapped for a detached domain

When map() is called on a detached domain, the domain does not exist in
the device so we do not send a MAP request, but we do update the
internal mapping tree, to be replayed on the next attach. Since this
constitutes a successful iommu_map() call, return *mapped in this case
too.

Fixes: 7e62edd7a33a ("iommu/virtio: Add map/unmap_pages() callbacks implementation")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20230515113946.1017624-3-jean-philippe@linaro.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/virtio-iommu.c