iommu/virtio: Add ops->flush_iotlb_all and enable deferred flush
authorNiklas Schnelle <schnelle@linux.ibm.com>
Mon, 20 Nov 2023 14:51:57 +0000 (15:51 +0100)
committerJoerg Roedel <jroedel@suse.de>
Mon, 27 Nov 2023 10:00:43 +0000 (11:00 +0100)
commit6f01a732608f294a853f0d1cc963772bac12f1e9
tree1be78cd40390cbb223015178e6e997fd7cf3118b
parent00271ca5cbcd36d01f3c58a05378304ba9dd6a2a
iommu/virtio: Add ops->flush_iotlb_all and enable deferred flush

Add ops->flush_iotlb_all operation to enable virtio-iommu for the
dma-iommu deferred flush scheme. This results in a significant increase
in performance in exchange for a window in which devices can still
access previously IOMMU mapped memory when running with
CONFIG_IOMMU_DEFAULT_DMA_LAZY. The previous strict behavior can be
achieved with iommu.strict=1 on the kernel command line or
CONFIG_IOMMU_DEFAULT_DMA_STRICT.

Link: https://lore.kernel.org/lkml/20230802123612.GA6142@myrica/
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Link: https://lore.kernel.org/r/20231120-viommu-sync-map-v3-2-50a57ecf78b5@linux.ibm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/virtio-iommu.c