aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/xen/mm.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2014-11-21 06:07:39 -0500
committerDavid Vrabel <david.vrabel@citrix.com>2014-12-04 07:41:54 -0500
commita4dba130891271084344c12537731542ec77cb85 (patch)
treed7ff4310aadcb0e8d6fc46abb5452727fd56bd17 /arch/arm/xen/mm.c
parent5121872afe0e6470bc6b41637b258fa6e314be4f (diff)
xen/arm/arm64: introduce xen_arch_need_swiotlb
Introduce an arch specific function to find out whether a particular dma mapping operation needs to bounce on the swiotlb buffer. On ARM and ARM64, if the page involved is a foreign page and the device is not coherent, we need to bounce because at unmap time we cannot execute any required cache maintenance operations (we don't know how to find the pfn from the mfn). No change of behaviour for x86. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/arm/xen/mm.c')
-rw-r--r--arch/arm/xen/mm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index ab700e1e5922..28ebf3ecee4e 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -100,6 +100,13 @@ void __xen_dma_sync_single_for_device(struct device *hwdev,
100 __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir); 100 __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir);
101} 101}
102 102
103bool xen_arch_need_swiotlb(struct device *dev,
104 unsigned long pfn,
105 unsigned long mfn)
106{
107 return ((pfn != mfn) && !is_device_dma_coherent(dev));
108}
109
103int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, 110int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
104 unsigned int address_bits, 111 unsigned int address_bits,
105 dma_addr_t *dma_handle) 112 dma_addr_t *dma_handle)