linux-kernel-test/arch/arm/kernel
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
..
.gitignore
armksyms.c ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
arthur.c
asm-offsets.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
atags.c
atags.h
bios32.c ARM: 6058/1: Add support for PCI domains 2010-04-22 21:38:11 +01:00
calls.S ARM: 6343/1: wire up fanotify and prlimit64 syscalls on ARM 2010-09-01 10:06:08 +01:00
compat.c ARM: deprecate support for old way to pass kernel parameters 2010-07-07 16:38:36 +02:00
compat.h ARM: deprecate support for old way to pass kernel parameters 2010-07-07 16:38:36 +02:00
crash_dump.c ARM: 6120/1: kdump: implement copy_oldmem_page() 2010-07-09 15:00:53 +01:00
crunch-bits.S
crunch.c ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread() 2009-12-18 14:53:41 +00:00
debug.S arm: return both physical and virtual addresses from addruart 2010-10-20 00:27:33 -04:00
dma-isa.c ARM: dma-isa: request cascade channel after registering it 2009-12-24 18:34:08 +00:00
dma.c ARM: dma: add /proc/dma support to arch/arm/kernel/dma.c 2010-04-14 13:13:30 +01:00
early_printk.c ARM: Add an earlyprintk debug console 2009-12-09 10:02:18 +00:00
ecard.c ARM: ecard: irq_data conversion. 2011-01-13 12:26:17 +01:00
ecard.h
elf.c ARM: 5883/1: Revert "disable NX support for OABI-supporting kernels" 2010-01-18 14:12:11 +00:00
entry-armv.S Merge branch 'devel-stable' into devel 2011-01-06 22:33:32 +00:00
entry-common.S Merge branch 'clksrc' into devel 2011-01-05 18:09:03 +00:00
entry-header.S ARM: hw_breakpoint: disable preemption during debug exception handling 2010-12-06 11:55:56 +00:00
etm.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
fiq.c Merge branch 'smp' into misc 2011-01-06 22:32:03 +00:00
ftrace.c ARM: ftrace: graph tracer + dynamic ftrace 2010-11-19 21:43:27 +05:30
head-common.S ARM: Defer lookup of machine_type to setup.c 2011-02-15 16:36:44 +00:00
head-nommu.S ARM: Defer lookup of machine_type to setup.c 2011-02-15 16:36:44 +00:00
head.S ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
hw_breakpoint.c ARM: hw_breakpoint: do not fail initcall if monitor mode is disabled 2010-12-15 12:31:03 +00:00
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
io.c
irq.c ARM: core irq_data conversion. 2011-01-13 12:26:17 +01:00
isa.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
iwmmxt.S ARM: pxa: add iwmmx support for PJ4 2010-12-20 23:07:36 +08:00
kgdb.c kgdb,arm: fix register dump 2010-10-29 13:14:40 -05:00
kprobes-decode.c ARM: 6412/1: kprobes-decode: add support for MOVW instruction 2010-10-04 19:21:37 +01:00
kprobes.c Merge branch 'master' into export-slabh 2010-04-05 11:37:28 +09:00
leds.c ARM: move LED support code out of arch/arm/kernel/time.c 2010-02-15 21:39:12 +00:00
machine_kexec.c ARM: 6522/1: kexec: Add call to non-crashing cores through IPI 2010-12-04 11:02:04 +00:00
Makefile Merge branch 'devel-stable' into devel 2011-01-06 22:33:32 +00:00
module.c ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
perf_event_v6.c ARM: 6521/1: perf: use raw_spinlock_t for pmu_lock 2010-12-04 11:18:08 +00:00
perf_event_v7.c ARM: 6521/1: perf: use raw_spinlock_t for pmu_lock 2010-12-04 11:18:08 +00:00
perf_event_xscale.c ARM: 6521/1: perf: use raw_spinlock_t for pmu_lock 2010-12-04 11:18:08 +00:00
perf_event.c Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-01-06 16:50:35 -08:00
pj4-cp0.c ARM: pxa: add iwmmx support for PJ4 2010-12-20 23:07:36 +08:00
pmu.c ARM: 6064/1: pmu: register IRQs at runtime 2010-05-17 11:53:57 +01:00
process.c ARM: 6619/1: nommu: avoid mapping vectors page when !CONFIG_MMU 2011-01-11 17:32:24 +00:00
ptrace.c ARM: ptrace: fix style issue with hw_breakpoint interface 2010-12-06 11:55:57 +00:00
ptrace.h arm: use generic ptrace_resume code 2010-03-12 15:52:38 -08:00
relocate_kernel.S ARM: 6497/1: kexec: Correct data alignment for CONFIG_THUMB2_KERNEL 2010-11-30 13:44:23 +00:00
return_address.c
sched_clock.c ARM: sched_clock: make minsec argument to clocks_calc_mult_shift() zero 2011-01-11 16:44:02 +00:00
setup.c ARM: P2V: avoid initializers and assembly using PHYS_OFFSET 2011-02-17 23:27:30 +00:00
signal.c ARM: 6051/1: VFP: preserve the HW context when calling signal handlers 2010-04-14 11:11:30 +01:00
signal.h ARM: Fix signal restart issues with NX and OABI compat 2009-10-25 15:39:37 +00:00
smp_scu.c Check whether the SCU was already initialised 2009-11-05 10:10:36 +00:00
smp_tlb.c ARM: SMP: split out software TLB maintainence broadcasting 2010-12-20 15:09:17 +00:00
smp_twd.c ARM: twd: ensure timer reload is reprogrammed on entry to periodic mode 2011-01-25 21:17:58 +00:00
smp.c Merge branch 'pgt' (early part) into devel 2011-01-06 22:33:19 +00:00
stacktrace.c ARM: fix /proc/$PID/stack on SMP 2011-01-15 09:27:04 +00:00
swp_emulate.c ARM: 6396/1: Add SWP/SWPB emulation for ARMv7 processors 2010-11-04 15:45:24 +00:00
sys_arm.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
sys_oabi-compat.c Mark arguments to certain syscalls as being const 2010-08-13 16:53:13 -07:00
tcm.c ARM: P2V: separate PHYS_OFFSET from platform definitions 2011-02-17 23:26:55 +00:00
tcm.h ARM: 5580/2: ARM TCM (Tightly-Coupled Memory) support v3 2009-09-15 22:11:05 +01:00
thumbee.c
time.c ARM: sched_clock: allow init_sched_clock() to be called early 2011-01-11 16:23:04 +00:00
traps.c Merge branch 'pgt' (early part) into devel 2011-01-06 22:33:19 +00:00
unwind.c ARM: 6468/1: backtrace: fix calculation of thread stack base 2010-11-07 16:12:37 +00:00
vmlinux.lds.S ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching 2011-02-17 23:27:32 +00:00
xscale-cp0.c ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread() 2009-12-18 14:53:41 +00:00