swiotlb: remove the tbl_dma_addr argument to swiotlb_tbl_map_single
authorChristoph Hellwig <hch@lst.de>
Fri, 23 Oct 2020 06:33:09 +0000 (08:33 +0200)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 2 Nov 2020 15:10:39 +0000 (10:10 -0500)
commitfc0021aa340af65a0a37d77be39e22aa886a6132
treebd61ef7411ff4461f8b540a7542d4f5b1e388094
parente9696d259d0fb5d239e8c28ca41089838ea76d13
swiotlb: remove the tbl_dma_addr argument to swiotlb_tbl_map_single

The tbl_dma_addr argument is used to check the DMA boundary for the
allocations, and thus needs to be a dma_addr_t.  swiotlb-xen instead
passed a physical address, which could lead to incorrect results for
strange offsets.  Fix this by removing the parameter entirely and hard
code the DMA address for io_tlb_start instead.

Fixes: 91ffe4ad534a ("swiotlb-xen: introduce phys_to_dma/dma_to_phys translations")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/iommu/intel/iommu.c
drivers/xen/swiotlb-xen.c
include/linux/swiotlb.h
kernel/dma/swiotlb.c