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:46:01 +0000 (06:46 -0700)
commit53cd8ae3eeb1d90bd5c143c04de5952527a61a3c
tree3c5619a9176c4b8119814b817601e87aaec778ab
parent9c15fff2819405b647be470e2126d409581a551e
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