9
0
Fork 0
barebox/arch/arm
Enrico Scholz 19bc427e44 ARM v7: fix mmu-off operation
Although conclusions in 50d1b2de8e "ARM
v7: Fix register corruption in v7_mmu_cache_off" are correct, the
implemented fix is not complete because the following failure can
happen:

1. d-cache contains the cache line around 'sp'

2. v7_mmu_cache_off() disables cache

3. early v7_mmu_cache_flush() pushes 'lr' on uncached stack

4. v7_mmu_cache_flush() flushes d-cache and can override stack written
   by step 3.

5. v7_mmu_cache_flush() pops 'lr' out of cache and jumps to it which
   might be random data now.

Patch avoids step 3 which is easy because 'lr' is never modified by the
function.  By using the 'r12' scratch register instead of 'r10', the
whole initial 'push' can be avoided.

Patch moves also the 'DMB' operation so that it is executed after data
has been pushed on stack.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-17 10:23:42 +02:00
..
boards ARM: ccmx51: Another fix SDRAM size detection 2013-05-15 09:24:28 +02:00
configs Merge branch 'for-next/tegra' 2013-05-06 09:30:53 +02:00
cpu ARM v7: fix mmu-off operation 2013-05-17 10:23:42 +02:00
dts tegra: add GPIO controller driver 2013-04-14 10:45:52 +02:00
include/asm Merge branch 'for-next/relocate' 2013-04-04 14:20:42 +02:00
lib Merge branch 'for-next/relocate' 2013-04-04 14:20:42 +02:00
mach-at91 ARM: at91 smc: Fix possible uninitialized variable 2013-04-30 09:35:55 +02:00
mach-bcm2835 clk: remove unused __clk_[get|put] 2013-04-03 17:22:11 +02:00
mach-clps711x Merge branch 'for-next/misc' 2013-04-04 14:20:32 +02:00
mach-ep93xx switch boards to lwl-y 2013-02-21 14:42:51 +01:00
mach-highbank highbank: switch to defaultenv-2 2013-04-09 09:02:26 +02:00
mach-imx ARM: i.MX: Allow disabling SDRAM autodetection 2013-05-08 08:24:43 +02:00
mach-mxs MXS: fix SoC detecting 2013-05-08 23:24:50 +02:00
mach-netx ARM: netx: Remove references for missing boards 2013-04-30 08:21:34 +02:00
mach-nomadik clk: remove unused __clk_[get|put] 2013-04-03 17:22:11 +02:00
mach-omap Merge branch 'for-next/omap' 2013-05-06 09:30:41 +02:00
mach-pxa ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT 2013-02-04 15:52:40 +01:00
mach-samsung ARM Samsung boards: switch to barebox_arm_entry 2013-02-04 15:52:39 +01:00
mach-tegra ARM: remove unused clkdev.h 2013-05-12 12:30:19 +02:00
mach-versatile clk: remove unused __clk_[get|put] 2013-04-03 17:22:11 +02:00
mach-vexpress clk: remove unused __clk_[get|put] 2013-04-03 17:22:11 +02:00
mach-zynq ARM: remove unused clkdev.h 2013-05-12 12:30:19 +02:00
pbl ARM: Add relocatable binary support 2013-03-07 12:38:01 +01:00
tools make make -s more silent 2012-10-17 22:17:12 +02:00
Kconfig tegra: add GPIO controller driver 2013-04-14 10:45:52 +02:00
Makefile Merge branch 'for-next/zynq' 2013-04-04 23:23:19 +02:00
mach-arm.dox fix path specs in arch/arm/mach-arm.dox 2010-01-04 11:11:55 +01:00