]> git.baikalelectronics.ru Git - kernel.git/commit
s390/pci: use physical addresses in DMA tables
authorNiklas Schnelle <schnelle@linux.ibm.com>
Thu, 25 Nov 2021 15:46:00 +0000 (16:46 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 6 Dec 2021 13:42:26 +0000 (14:42 +0100)
commit45afa3dd27298c49ebaab48a2444767b1aee1204
treeb8b530d2e892d9e7c83c48357c66129259b831f7
parent314fc78513252e04cc4b250616cad0b55576029e
s390/pci: use physical addresses in DMA tables

The entries in the DMA translation tables for our IOMMU must specify
physical addresses of either the next level table or the final page
to be mapped for DMA. Currently however the code simply passes the
virtual addresses of both. On the other hand we still need to walk the
tables via their virtual addresses so we need to do a phys_to_virt()
when setting the entries and a virt_to_phys() when getting them.
Similarly when passing the I/O translation anchor to the hardware we
must also specify its physical address.

As the DMA and IOMMU APIs we are implementing already use the correct
phys_addr_t type for the address to be mapped let's also thread this
through instead of treating it as just an unsigned long.

Note: this currently doesn't fix a real bug, since virtual addresses
are indentical to physical ones.

Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/pci_dma.h
arch/s390/pci/pci.c
arch/s390/pci/pci_dma.c
drivers/iommu/s390-iommu.c