arm64/iommu: handle non-remapped addresses in ->mmap and ->get_sgtable
authorChristoph Hellwig <hch@lst.de>
Tue, 30 Apr 2019 10:51:50 +0000 (06:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:47:11 +0000 (06:47 -0700)
commitcf3780155df66a2df28a0f894d524ea765385f08
tree1c28a38a6870035cc6713c89670cbd34a771a2f3
parent662ffdc1be1693e1859d9f07f8b901c0feb4daaf
arm64/iommu: handle non-remapped addresses in ->mmap and ->get_sgtable

commit a98d9ae937d256ed679a935fc82d9deaa710d98e upstream.

DMA allocations that can't sleep may return non-remapped addresses, but
we do not properly handle them in the mmap and get_sgtable methods.
Resolve non-vmalloc addresses using virt_to_page to handle this corner
case.

Cc: <stable@vger.kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/mm/dma-mapping.c