Skip to content

Commit 0540b0d

Browse files
chleroympe
authored andcommitted
powerpc/40x: Always fault when _PAGE_ACCESSED is not set
The kernel expects pte_young() to work regardless of CONFIG_SWAP. Make sure a minor fault is taken to set _PAGE_ACCESSED when it is not already set, regardless of the selection of CONFIG_SWAP. Fixes: 2c74e25 ("powerpc/40x: Rework 40x PTE access and TLB miss") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/b02ca2ed2d3676a096219b48c0f69ec982a75bcf.1602342801.git.christophe.leroy@csgroup.eu
1 parent 1152244 commit 0540b0d

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

arch/powerpc/kernel/head_40x.S

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,7 @@ _ENTRY(saved_ksp_limit)
284284

285285
rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */
286286
lwz r11, 0(r11) /* Get Linux PTE */
287-
#ifdef CONFIG_SWAP
288287
li r9, _PAGE_PRESENT | _PAGE_ACCESSED
289-
#else
290-
li r9, _PAGE_PRESENT
291-
#endif
292288
andc. r9, r9, r11 /* Check permission */
293289
bne 5f
294290

@@ -369,11 +365,7 @@ _ENTRY(saved_ksp_limit)
369365

370366
rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */
371367
lwz r11, 0(r11) /* Get Linux PTE */
372-
#ifdef CONFIG_SWAP
373368
li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
374-
#else
375-
li r9, _PAGE_PRESENT | _PAGE_EXEC
376-
#endif
377369
andc. r9, r9, r11 /* Check permission */
378370
bne 5f
379371

0 commit comments

Comments
 (0)