Skip to content

Commit

Permalink
swiotlb-xen: remove BUG_ON in xen_bus_to_phys
Browse files Browse the repository at this point in the history
On x86 truncation cannot occur because config XEN depends on X86_64 ||
(X86_32 && X86_PAE).

On ARM truncation can occur without CONFIG_ARM_LPAE, when the dma
operation involves foreign grants. However in that case the physical
address returned by xen_bus_to_phys is actually invalid (there is no mfn
to pfn tracking for foreign grants on ARM) and it is not used.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: stable@vger.kernel.org
  • Loading branch information
Stefano Stabellini authored and David Vrabel committed Dec 4, 2014
1 parent d6883e6 commit c884227
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/xen/swiotlb-xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ static inline phys_addr_t xen_bus_to_phys(dma_addr_t baddr)
dma_addr_t dma = (dma_addr_t)pfn << PAGE_SHIFT;
phys_addr_t paddr = dma;

BUG_ON(paddr != dma); /* truncation has occurred, should never happen */

paddr |= baddr & ~PAGE_MASK;

return paddr;
Expand Down

0 comments on commit c884227

Please sign in to comment.