[POWERPC] 4xx: Deal with 44x virtually tagged icache
commitb98ac05d5e460301fbea24cceed0f2a601c82e22
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 31 Oct 2007 05:42:19 +0000 (31 16:42 +1100)
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>
Thu, 1 Nov 2007 12:15:30 +0000 (1 07:15 -0500)
tree2e556ad28a007d13339300fbbd4942d0ec9f023c
parente701d269aa28996f3502780951fe1b12d5d66b49
[POWERPC] 4xx: Deal with 44x virtually tagged icache

The 44x family has an interesting "feature" which is a virtually
tagged instruction cache (yuck !). So far, we haven't dealt with
it properly, which means we've been mostly lucky or people didn't
report the problems, unless people have been running custom patches
in their distro...

This is an attempt at fixing it properly. I chose to do it by
setting a global flag whenever we change a PTE that was previously
marked executable, and flush the entire instruction cache upon
return to user space when that happens.

This is a bit heavy handed, but it's hard to do more fine grained
flushes as the icbi instruction, on those processor, for some very
strange reasons (since the cache is virtually mapped) still requires
a valid TLB entry for reading in the target address space, which
isn't something I want to deal with.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/misc_32.S
arch/powerpc/mm/44x_mmu.c
arch/ppc/kernel/entry.S
arch/ppc/kernel/misc.S
arch/ppc/mm/44x_mmu.c
include/asm-powerpc/pgtable-ppc32.h