aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_fsl_booke.S
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-18 15:00:34 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-26 23:12:51 -0400
commitea3cc330ac0cd521ff07c7cd432a1848c19a7e92 (patch)
tree82f3e84e28ebf5ae33d05ec0142c22b30a21c60a /arch/powerpc/kernel/head_fsl_booke.S
parentf480fe3916de2e2cbb6e384cb685f0f1d8272188 (diff)
powerpc/mm: Cleanup handling of execute permission
This is an attempt at cleaning up a bit the way we handle execute permission on powerpc. _PAGE_HWEXEC is gone, _PAGE_EXEC is now only defined by CPUs that can do something with it, and the myriad of #ifdef's in the I$/D$ coherency code is reduced to 2 cases that hopefully should cover everything. The logic on BookE is a little bit different than what it was though not by much. Since now, _PAGE_EXEC will be set by the generic code for executable pages, we need to filter out if they are unclean and recover it. However, I don't expect the code to be more bloated than it already was in that area due to that change. I could boast that this brings proper enforcing of per-page execute permissions to all BookE and 40x but in fact, we've had that now for some time as a side effect of my previous rework in that area (and I didn't even know it :-) We would only enable execute permission if the page was cache clean and we would only cache clean it if we took and exec fault. Since we now enforce that the later only work if VM_EXEC is part of the VMA flags, we de-fact already enforce per-page execute permissions... Unless I missed something Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/head_fsl_booke.S')
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index eca80482ae7..2c5af525647 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -643,7 +643,7 @@ interrupt_base:
643 643
6444: 6444:
645 /* Make up the required permissions */ 645 /* Make up the required permissions */
646 li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_HWEXEC 646 li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
647 647
648 FIND_PTE 648 FIND_PTE
649 andc. r13,r13,r11 /* Check permission */ 649 andc. r13,r13,r11 /* Check permission */
@@ -742,7 +742,7 @@ finish_tlb_load:
742#endif 742#endif
743 mtspr SPRN_MAS2, r12 743 mtspr SPRN_MAS2, r12
744 744
745 li r10, (_PAGE_HWEXEC | _PAGE_PRESENT) 745 li r10, (_PAGE_EXEC | _PAGE_PRESENT)
746 rlwimi r10, r11, 31, 29, 29 /* extract _PAGE_DIRTY into SW */ 746 rlwimi r10, r11, 31, 29, 29 /* extract _PAGE_DIRTY into SW */
747 and r12, r11, r10 747 and r12, r11, r10
748 andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */ 748 andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */