s390/pci: use lock-free I/O translation updates
authorNiklas Schnelle <schnelle@linux.ibm.com>
Wed, 9 Nov 2022 14:29:03 +0000 (15:29 +0100)
committerJoerg Roedel <jroedel@suse.de>
Sat, 19 Nov 2022 09:28:18 +0000 (10:28 +0100)
commit21c1f9021f0e7d28c3edfcc70e1ca1926ea3774e
tree6322eb5fdba1271c77978cb03e7accb21d3e7f64
parent08955af0600303455f57fe2f2a26f24f9b496b49
s390/pci: use lock-free I/O translation updates

I/O translation tables on s390 use 8 byte page table entries and tables
which are allocated lazily but only freed when the entire I/O
translation table is torn down. Also each IOVA can at any time only
translate to one physical address Furthermore I/O table accesses by the
IOMMU hardware are cache coherent. With a bit of care we can thus use
atomic updates to manipulate the translation table without having to use
a global lock at all. This is done analogous to the existing I/O
translation table handling code used on Intel and AMD x86 systems.

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