]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.3/swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 3.18.3 / swiotlb-xen-remove-bug_on-in-xen_bus_to_phys.patch
CommitLineData
0507c325
GKH
1From c884227eaae9936f8ecbde6e1387bccdab5f4e90 Mon Sep 17 00:00:00 2001
2From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
3Date: Fri, 21 Nov 2014 11:10:39 +0000
4Subject: swiotlb-xen: remove BUG_ON in xen_bus_to_phys
5
6From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
7
8commit c884227eaae9936f8ecbde6e1387bccdab5f4e90 upstream.
9
10On x86 truncation cannot occur because config XEN depends on X86_64 ||
11(X86_32 && X86_PAE).
12
13On ARM truncation can occur without CONFIG_ARM_LPAE, when the dma
14operation involves foreign grants. However in that case the physical
15address returned by xen_bus_to_phys is actually invalid (there is no mfn
16to pfn tracking for foreign grants on ARM) and it is not used.
17
18Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
19Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
20Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23---
24 drivers/xen/swiotlb-xen.c | 2 --
25 1 file changed, 2 deletions(-)
26
27--- a/drivers/xen/swiotlb-xen.c
28+++ b/drivers/xen/swiotlb-xen.c
29@@ -96,8 +96,6 @@ static inline phys_addr_t xen_bus_to_phy
30 dma_addr_t dma = (dma_addr_t)pfn << PAGE_SHIFT;
31 phys_addr_t paddr = dma;
32
33- BUG_ON(paddr != dma); /* truncation has occurred, should never happen */
34-
35 paddr |= baddr & ~PAGE_MASK;
36
37 return paddr;