linux/arch/arm
Stefano Stabellini 340720be32 xen/arm: reimplement xen_dma_unmap_page & friends
xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
xen_dma_sync_single_for_device are currently implemented by calling into
the corresponding generic ARM implementation of these functions. In
order to do this, firstly the dma_addr_t handle, that on Xen is a
machine address, needs to be translated into a physical address.  The
operation is expensive and inaccurate, given that a single machine
address can correspond to multiple physical addresses in one domain,
because the same page can be granted multiple times by the frontend.

To avoid this problem, we introduce a Xen specific implementation of
xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
xen_dma_sync_single_for_device, that can operate on machine addresses
directly.

The new implementation relies on the fact that the hypervisor creates a
second p2m mapping of any grant pages at physical address == machine
address of the page for dom0. Therefore we can access memory at physical
address == dma_addr_r handle and perform the cache flushing there. Some
cache maintenance operations require a virtual address. Instead of using
ioremap_cache, that is not safe in interrupt context, we allocate a
per-cpu PAGE_KERNEL scratch page and we manually update the pte for it.

arm64 doesn't need cache maintenance operations on unmap for now.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Denis Schneider <v1ne2go@gmail.com>
2014-09-11 18:11:53 +00:00
..
boot ARM: dts: exynos5420: remove disp_pd 2014-08-09 08:25:50 -07:00
common ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
configs ARM: SoC defconfig updates for 3.17 2014-08-08 11:35:11 -07:00
crypto Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-08-05 10:05:29 -07:00
firmware
include xen/arm: reimplement xen_dma_unmap_page & friends 2014-09-11 18:11:53 +00:00
kernel Nicolas Pitre added generic tracepoints for tracing IPIs and updated the 2014-08-09 17:33:44 -07:00
kvm Here are the PPC and ARM changes for KVM, which I separated because 2014-08-07 11:35:30 -07:00
lib ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-at91 This is the bulk of GPIO changes for the v3.17 development 2014-08-08 18:00:35 -07:00
mach-axxia
mach-bcm ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-berlin
mach-clps711x ARM: SoC cleanups for 3.17 2014-08-08 11:00:26 -07:00
mach-cns3xxx
mach-davinci
mach-dove
mach-ebsa110 ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-efm32
mach-ep93xx ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-exynos ARM: EXYNOS: Fix suspend/resume sequences 2014-08-09 08:24:36 -07:00
mach-footbridge ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-gemini
mach-highbank
mach-hisi ARM: hisi: remove smp from machine descriptor 2014-07-30 22:32:21 -07:00
mach-imx ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-integrator ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-iop13xx ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone
mach-ks8695 ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-lpc32xx
mach-mediatek
mach-mmp
mach-moxart
mach-msm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-08-06 21:03:53 -07:00
mach-mv78xx0
mach-mvebu ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1 ARM: SoC cleanups for 3.17 2014-08-08 11:00:26 -07:00
mach-omap2 Few fixes for the v3.17 merge window: 2014-08-09 08:23:27 -07:00
mach-orion5x
mach-picoxcell
mach-prima2
mach-pxa Merge branch 'akpm' (second patchbomb from Andrew Morton) 2014-08-08 15:57:47 -07:00
mach-qcom
mach-realview ARM: SoC cleanups for 3.17 2014-08-08 11:00:26 -07:00
mach-rockchip ARM: SoC device-tree changes for 3.17 2014-08-08 11:16:58 -07:00
mach-rpc ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-s3c24xx Merge branch 'akpm' (second patchbomb from Andrew Morton) 2014-08-08 15:57:47 -07:00
mach-s3c64xx
mach-s5pv210 ARM: SoC cleanups for 3.17 2014-08-08 11:00:26 -07:00
mach-sa1100 ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> 2014-07-29 23:08:52 +01:00
mach-shmobile ARM: SoC device-tree changes for 3.17 2014-08-08 11:16:58 -07:00
mach-socfpga
mach-spear ARM: SoC driver changes for 3.17 2014-08-08 11:34:32 -07:00
mach-sti
mach-sunxi ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-tegra This is the bulk of GPIO changes for the v3.17 development 2014-08-08 18:00:35 -07:00
mach-u300
mach-ux500
mach-versatile ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
mach-vexpress ARM: SoC cleanups for 3.17 2014-08-08 11:00:26 -07:00
mach-vt8500
mach-w90x900 arch/arm/mach-w90x900/cpu.c: replace obsolete strict_strto 2014-08-08 15:57:28 -07:00
mach-zynq
mm ARM: 8114/1: LPAE: load upper bits of early TTBR0/TTBR1 2014-08-09 08:42:12 +01:00
net net: filter: split 'struct sk_filter' into socket and bpf parts 2014-08-02 15:03:58 -07:00
nwfpe
oprofile Merge branch 'devel-stable' into for-next 2014-08-05 10:27:25 +01:00
plat-iop
plat-omap ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
plat-orion
plat-pxa
plat-samsung Merge branch 'cleanup/gpio-header-removal' into next/soc 2014-07-26 18:00:40 +02:00
plat-versatile
tools
vfp
xen xen/arm: reimplement xen_dma_unmap_page & friends 2014-09-11 18:11:53 +00:00
Kconfig Merge branch 'akpm' (second patchbomb from Andrew Morton) 2014-08-08 15:57:47 -07:00
Kconfig-nommu
Kconfig.debug ARM: SoC device-tree changes for 3.17 2014-08-08 11:16:58 -07:00
Makefile ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00