aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/xen/mm.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-10-10 09:41:10 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-10-10 09:41:10 -0400
commit1b65c4e5a9af1a1c61e792e2d0ed481e0c1f21a9 (patch)
tree15c7b03e6efede8905f3729de488341c9a9da81b /arch/arm/xen/mm.c
parentd6fe76c58c358498b91d21f0ca8054f6aa6e672d (diff)
swiotlb-xen: use xen_alloc/free_coherent_pages
Use xen_alloc_coherent_pages and xen_free_coherent_pages to allocate or free coherent pages. We need to be careful handling the pointer returned by xen_alloc_coherent_pages, because on ARM the pointer is not equal to phys_to_virt(*dma_handle). In fact virt_to_phys only works for kernel direct mapped RAM memory. In ARM case the pointer could be an ioremap address, therefore passing it to virt_to_phys would give you another physical address that doesn't correspond to it. Make xen_create_contiguous_region take a phys_addr_t as start parameter to avoid the virt_to_phys calls which would be incorrect. Changes in v6: - remove extra spaces. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/arm/xen/mm.c')
-rw-r--r--arch/arm/xen/mm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index 0d69b874d249..b0e77de99148 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -16,7 +16,7 @@
16#include <asm/xen/hypercall.h> 16#include <asm/xen/hypercall.h>
17#include <asm/xen/interface.h> 17#include <asm/xen/interface.h>
18 18
19int xen_create_contiguous_region(unsigned long vstart, unsigned int order, 19int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
20 unsigned int address_bits, 20 unsigned int address_bits,
21 dma_addr_t *dma_handle) 21 dma_addr_t *dma_handle)
22{ 22{
@@ -24,12 +24,12 @@ int xen_create_contiguous_region(unsigned long vstart, unsigned int order,
24 return -EINVAL; 24 return -EINVAL;
25 25
26 /* we assume that dom0 is mapped 1:1 for now */ 26 /* we assume that dom0 is mapped 1:1 for now */
27 *dma_handle = virt_to_phys(pstart); 27 *dma_handle = pstart;
28 return 0; 28 return 0;
29} 29}
30EXPORT_SYMBOL_GPL(xen_create_contiguous_region); 30EXPORT_SYMBOL_GPL(xen_create_contiguous_region);
31 31
32void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order) 32void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
33{ 33{
34 return; 34 return;
35} 35}