aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/head_fsl_booke.S
diff options
context:
space:
mode:
authorGravatar Christophe Leroy <christophe.leroy@csgroup.eu> 2021-10-19 09:29:15 +0200
committerGravatar Michael Ellerman <mpe@ellerman.id.au> 2021-12-09 22:41:17 +1100
commitdc3a0e5b83a8806d7da1f343a7d2e0be386d16d2 (patch)
tree55cec8721b9cdf1b5e47b2eaeca1f170d3b6d6d0 /arch/powerpc/kernel/head_fsl_booke.S
parentpowerpc/44x: Activate KUEP at all time (diff)
downloadlinux-dc3a0e5b83a8806d7da1f343a7d2e0be386d16d2.tar.gz
linux-dc3a0e5b83a8806d7da1f343a7d2e0be386d16d2.tar.bz2
linux-dc3a0e5b83a8806d7da1f343a7d2e0be386d16d2.zip
powerpc/book3e: Activate KUEP at all time
On book3e, - When using 64 bits PTE: User pages don't have the SX bit defined so KUEP is always active. - When using 32 bits PTE: Implement KUEP by clearing SX bit during TLB miss for user pages. The impact is minimal and worth neither boot time nor build time selection. Activate it at all time. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/e376b114283fb94504e2aa2de846780063252cde.1634627931.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/head_fsl_booke.S')
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 0a9a0f301474..4622b50a5208 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -777,6 +777,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */
slwi r10, r12, 1
or r10, r10, r12
+ rlwinm r10, r10, 0, ~_PAGE_EXEC /* Clear SX on user pages */
iseleq r12, r12, r10
rlwimi r13, r12, 0, 20, 31 /* Get RPN from PTE, merge w/ perms */
mtspr SPRN_MAS3, r13