swiotlb-xen: use xen_alloc/free_coherent_pages
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 10 Oct 2013 13:41:10 +0000 (13:41 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 10 Oct 2013 13:41:10 +0000 (13:41 +0000)
commit1b65c4e5a9af1a1c61e792e2d0ed481e0c1f21a9
tree15c7b03e6efede8905f3729de488341c9a9da81b
parentd6fe76c58c358498b91d21f0ca8054f6aa6e672d
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>
arch/arm/xen/mm.c
arch/x86/xen/mmu.c
drivers/xen/swiotlb-xen.c
include/xen/xen-ops.h