swiotlb: merge swiotlb-xen initialization into swiotlb
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Mar 2022 06:58:45 +0000 (07:58 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 18 Apr 2022 05:21:13 +0000 (07:21 +0200)
commit3f70356edf5611c28a68d8d5a9c2b442c9eb81e6
tree37c2b84bffa935c4c46eacf6a554aba36982fc1f
parent7374153d294eb51de5a81ac38ff1c4fef8927bec
swiotlb: merge swiotlb-xen initialization into swiotlb

Reuse the generic swiotlb initialization for xen-swiotlb.  For ARM/ARM64
this works trivially, while for x86 xen_swiotlb_fixup needs to be passed
as the remap argument to swiotlb_init_remap/swiotlb_init_late.

Note that the lower bound of the swiotlb size is changed to the smaller
IO_TLB_MIN_SLABS based value with this patch, but that is fine as the
2MB value used in Xen before was just an optimization and is not the
hard lower bound.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
arch/arm/xen/mm.c
arch/x86/include/asm/xen/page.h
arch/x86/kernel/pci-dma.c
drivers/xen/swiotlb-xen.c
include/xen/arm/page.h
include/xen/swiotlb-xen.h