iommu/s390: Add I/O TLB ops
authorNiklas Schnelle <schnelle@linux.ibm.com>
Wed, 9 Nov 2022 14:29:00 +0000 (15:29 +0100)
committerJoerg Roedel <jroedel@suse.de>
Sat, 19 Nov 2022 09:28:16 +0000 (10:28 +0100)
commitc228f5a043370ef02867e4f0aab1bdc8422500e6
tree4902cff596476770d60bcbcf134fafbfdef13520
parent59bbf596791b89c7f88fdcac29dfc39c1221d25d
iommu/s390: Add I/O TLB ops

Currently s390-iommu does an I/O TLB flush (RPCIT) for every update of
the I/O translation table explicitly. For one this is wasteful since
RPCIT can be skipped after a mapping operation if zdev->tlb_refresh is
unset. Moreover we can do a single RPCIT for a range of pages including
whne doing lazy unmapping.

Thankfully both of these optimizations can be achieved by implementing
the IOMMU operations common code provides for the different types of I/O
tlb flushes:

 * flush_iotlb_all: Flushes the I/O TLB for the entire IOVA space
 * iotlb_sync:  Flushes the I/O TLB for a range of pages that can be
   gathered up, for example to implement lazy unmapping.
 * iotlb_sync_map: Flushes the I/O TLB after a mapping operation

Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Link: https://lore.kernel.org/r/20221109142903.4080275-3-schnelle@linux.ibm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/s390-iommu.c