linux/arch/arm
Russell King dc21af99fa ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching
This idea came from Nicolas, Eric Miao produced an initial version,
which was then rewritten into this.

Patch the physical to virtual translations at runtime.  As we modify
the code, this makes it incompatible with XIP kernels, but allows us
to achieve this with minimal loss of performance.

As many translations are of the form:

	physical = virtual + (PHYS_OFFSET - PAGE_OFFSET)
	virtual = physical - (PHYS_OFFSET - PAGE_OFFSET)

we generate an 'add' instruction for __virt_to_phys(), and a 'sub'
instruction for __phys_to_virt().  We calculate at run time (PHYS_OFFSET
- PAGE_OFFSET) by comparing the address prior to MMU initialization with
where it should be once the MMU has been initialized, and place this
constant into the above add/sub instructions.

Once we have (PHYS_OFFSET - PAGE_OFFSET), we can calculate the real
PHYS_OFFSET as PAGE_OFFSET is a build-time constant, and save this for
the C-mode PHYS_OFFSET variable definition to use.

At present, we are unable to support Realview with Sparsemem enabled
as this uses a complex mapping function, and MSM as this requires a
constant which will not fit in our math instruction.

Add a module version magic string for this feature to prevent
incompatible modules being loaded.

Tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-17 23:27:32 +00:00
..
boot Merge branches 'ftrace', 'gic', 'io', 'kexec', 'mod', 'sa11x0', 'sh' and 'versatile' into devel 2011-01-05 18:08:10 +00:00
common Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-01-15 12:33:40 -08:00
configs kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
include/asm ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
kernel ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
lib ARM: udelay: prevent math rounding resulting in short udelays 2011-01-10 23:55:59 +00:00
mach-aaec2000 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-at91 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-bcmring ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-clps711x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-cns3xxx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-davinci ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-dove ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ebsa110 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ep93xx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-footbridge ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-gemini ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-h720x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-imx Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-01-15 12:33:40 -08:00
mach-integrator ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-iop13xx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-iop32x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-iop33x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ixp4xx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ixp23xx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ixp2000 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-kirkwood ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ks8695 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-l7200/include/mach arm: return both physical and virtual addresses from addruart 2010-10-20 00:27:33 -04:00
mach-lh7a40x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-loki ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-lpc32xx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-mmp ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-msm ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
mach-mv78xx0 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-mx3 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-mx5 Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stable 2011-01-14 12:12:42 +00:00
mach-mxc91231 Merge branch 'devel-stable' into devel 2011-01-06 22:33:32 +00:00
mach-mxs ARM mxs: clkdev related compile fixes 2011-01-14 10:19:27 +01:00
mach-netx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-nomadik ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ns9xxx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-nuc93x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-omap1 ARM: 6651/1: omap: Fix DEBUG_LL code for p2v changes 2011-02-17 23:27:31 +00:00
mach-omap2 ARM: 6651/1: omap: Fix DEBUG_LL code for p2v changes 2011-02-17 23:27:31 +00:00
mach-orion5x ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-pnx4008 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-pxa ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
mach-realview ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
mach-rpc ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s3c24a0/include/mach ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s3c64xx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s3c2400 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s3c2410 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s3c2412 Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable 2011-01-15 13:24:02 +00:00
mach-s3c2416 Merge branch 'next-s3c24xx' into for-next 2011-01-06 18:44:09 +09:00
mach-s3c2440 Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-01-15 12:33:40 -08:00
mach-s3c2443 Merge branch 'next-s3c24xx' into for-next 2011-01-06 18:44:09 +09:00
mach-s5p64x0 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s5p6442 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s5pc100 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-s5pv210 ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
mach-s5pv310 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-sa1100 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-shark ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-shmobile ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-spear3xx tree-wide: fix comment/printk typos 2010-11-01 15:38:34 -04:00
mach-spear6xx tree-wide: fix comment/printk typos 2010-11-01 15:38:34 -04:00
mach-stmp37xx ARM: stmp37xx: irq_data conversion. 2011-01-13 17:19:02 +01:00
mach-stmp378x ARM: stmp378x: irq_data conversion. 2011-01-13 17:19:01 +01:00
mach-tcc8k ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
mach-tegra ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-u300 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-ux500 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-versatile ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mach-vexpress ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
mach-w90x900 ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
mm ARM: initrd: disable initrd if passed address overlaps reserved region 2011-01-31 10:53:41 +00:00
nwfpe Update broken web addresses in arch directory. 2010-10-18 11:03:21 +02:00
oprofile oprofile: Abstract the perf-events backend 2010-10-11 17:46:16 +02:00
plat-iop Merge branch 'clksrc' into devel 2011-01-05 18:09:03 +00:00
plat-mxc ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
plat-nomadik Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2011-01-17 10:54:41 -08:00
plat-omap ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
plat-orion ARM: plat-orion: irq_data conversion. 2011-01-13 17:19:12 +01:00
plat-pxa ARM: PXA SoCs: irq_data conversion. 2011-01-13 17:18:56 +01:00
plat-s3c24xx Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-01-15 12:33:40 -08:00
plat-s5p ARM: S5P: Add Support System MMU 2011-01-13 13:35:31 +09:00
plat-samsung Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-01-15 12:33:40 -08:00
plat-spear ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
plat-stmp3xxx ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
plat-tcc ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
plat-versatile Merge branch 'clksrc' into devel 2011-01-05 18:09:03 +00:00
tools ARM: Update mach-types 2010-12-12 23:31:02 +00:00
vfp Merge branch 'misc' into devel 2011-01-06 22:32:52 +00:00
Kconfig ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
Kconfig-nommu
Kconfig.debug Merge branch 'misc' into devel 2011-01-06 22:32:52 +00:00
Makefile Merge branch 'sgu/mxs-core-v8' of git://git.pengutronix.de/git/ukl/linux-2.6 into imx-for-2.6.38-new 2011-01-03 10:15:11 +01:00