]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 10 Jul 2020 22:34:17 +0000 (15:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Aug 2020 09:42:12 +0000 (11:42 +0200)
commit8ddac55226ce7cf0e015895709efde5e170ee5aa
tree98d45ae53724f3d04f6b35d8524d615ba1f441a7
parent81b4dc15857f2cf57f5a585bd6b8f963e77704b8
swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses

[ Upstream commit 8b1e868f66076490189a36d984fcce286cdd6295 ]

xen_alloc_coherent_pages might return pages for which virt_to_phys and
virt_to_page don't work, e.g. ioremap'ed pages.

So in xen_swiotlb_free_coherent we can't assume that virt_to_page works.
Instead add a is_vmalloc_addr check and use vmalloc_to_page on vmalloc
virt addresses.

This patch fixes the following crash at boot on RPi4 (the underlying
issue is not RPi4 specific):
https://marc.info/?l=xen-devel&m=158862573216800

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Roman Shaposhnik <roman@zededa.com>
Link: https://lore.kernel.org/r/20200710223427.6897-1-sstabellini@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/swiotlb-xen.c