Commit 8a052e0b authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King

[ARM] 3293/1: don't invalidate the whole I-cache with xscale_coherent_user_range

Patch from Nicolas Pitre

The mini I-cache issue is valid only for kernel space since debuggers
would not fly if they used user space addresses for their stubs.
Signed-off-by: default avatarNicolas Pitre <nico@cam.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 62500d1f
...@@ -241,7 +241,15 @@ ENTRY(xscale_flush_user_cache_range) ...@@ -241,7 +241,15 @@ ENTRY(xscale_flush_user_cache_range)
* it also trashes the mini I-cache used by JTAG debuggers. * it also trashes the mini I-cache used by JTAG debuggers.
*/ */
ENTRY(xscale_coherent_kern_range) ENTRY(xscale_coherent_kern_range)
/* FALLTHROUGH */ bic r0, r0, #CACHELINESIZE - 1
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHELINESIZE
cmp r0, r1
blo 1b
mov r0, #0
mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB
mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
mov pc, lr
/* /*
* coherent_user_range(start, end) * coherent_user_range(start, end)
...@@ -252,18 +260,16 @@ ENTRY(xscale_coherent_kern_range) ...@@ -252,18 +260,16 @@ ENTRY(xscale_coherent_kern_range)
* *
* - start - virtual start address * - start - virtual start address
* - end - virtual end address * - end - virtual end address
*
* Note: single I-cache line invalidation isn't used here since
* it also trashes the mini I-cache used by JTAG debuggers.
*/ */
ENTRY(xscale_coherent_user_range) ENTRY(xscale_coherent_user_range)
bic r0, r0, #CACHELINESIZE - 1 bic r0, r0, #CACHELINESIZE - 1
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
mcr p15, 0, r0, c7, c5, 1 @ Invalidate I cache entry
add r0, r0, #CACHELINESIZE add r0, r0, #CACHELINESIZE
cmp r0, r1 cmp r0, r1
blo 1b blo 1b
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB mcr p15, 0, r0, c7, c5, 6 @ Invalidate BTB
mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer
mov pc, lr mov pc, lr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment