diff options
author | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2009-08-19 00:27:53 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-26 23:12:52 -0400 |
commit | 14d757520a08d09745c3b18bb34addd9bef56e2d (patch) | |
tree | b75c1f6d29cb0439bef6fdf8bf2332987e573083 /arch | |
parent | ea3cc330ac0cd521ff07c7cd432a1848c19a7e92 (diff) |
powerpc: Fix __flush_icache_range on 44x
The ptrace POKETEXT interface allows a process to modify the text pages of
a child process being ptraced, usually to insert breakpoints via trap
instructions. The kernel eventually calls copy_to_user_page, which in turn
calls __flush_icache_range to invalidate the icache lines for the child
process.
However, this function does not work on 44x due to the icache being virtually
indexed. This was noticed by a breakpoint being triggered after it had been
cleared by ltrace on a 440EPx board. The convenient solution is to do a
flash invalidate of the icache in the __flush_icache_range function.
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 15f28e0de78d..da9c0c4c10f3 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -342,10 +342,17 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | |||
342 | addi r3,r3,L1_CACHE_BYTES | 342 | addi r3,r3,L1_CACHE_BYTES |
343 | bdnz 1b | 343 | bdnz 1b |
344 | sync /* wait for dcbst's to get to ram */ | 344 | sync /* wait for dcbst's to get to ram */ |
345 | #ifndef CONFIG_44x | ||
345 | mtctr r4 | 346 | mtctr r4 |
346 | 2: icbi 0,r6 | 347 | 2: icbi 0,r6 |
347 | addi r6,r6,L1_CACHE_BYTES | 348 | addi r6,r6,L1_CACHE_BYTES |
348 | bdnz 2b | 349 | bdnz 2b |
350 | #else | ||
351 | /* Flash invalidate on 44x because we are passed kmapped addresses and | ||
352 | this doesn't work for userspace pages due to the virtually tagged | ||
353 | icache. Sigh. */ | ||
354 | iccci 0, r0 | ||
355 | #endif | ||
349 | sync /* additional sync needed on g4 */ | 356 | sync /* additional sync needed on g4 */ |
350 | isync | 357 | isync |
351 | blr | 358 | blr |