9
0
Fork 0
barebox/arch
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
..
arm ARM v7: fix mmu-off operation 2013-05-17 10:23:42 +02:00
blackfin blackfin: initialize malloc pool before start_barebox() 2013-03-14 08:41:27 +01:00
mips Remove unused config.h 2013-04-09 08:42:52 +02:00
nios2 nios: initialize malloc pool before start_barebox() 2013-03-14 08:41:20 +01:00
openrisc openrisc: initialize malloc pool before start_barebox() 2013-03-14 08:41:23 +01:00
ppc Merge branch 'for-next/oftree' 2013-04-04 14:20:32 +02:00
sandbox Remove unused config.h 2013-04-09 08:42:52 +02:00
x86 Remove unused config.h 2013-04-09 08:42:52 +02:00
architecture.dox MIPS: add documentation 2011-08-05 18:20:17 +02:00