Skip to content

Commit 1152244

Browse files
chleroympe
authored andcommitted
powerpc/603: 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: 84de6ab ("powerpc/603: don't handle PAGE_ACCESSED in TLB miss handlers.") 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/a44367744de54e2315b2f1a8cbbd7f88488072e0.1602342806.git.christophe.leroy@csgroup.eu
1 parent 1344a23 commit 1152244

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

arch/powerpc/kernel/head_book3s_32.S

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,7 @@ InstructionTLBMiss:
457457
cmplw 0,r1,r3
458458
#endif
459459
mfspr r2, SPRN_SPRG_PGDIR
460-
#ifdef CONFIG_SWAP
461460
li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
462-
#else
463-
li r1,_PAGE_PRESENT | _PAGE_EXEC
464-
#endif
465461
#if defined(CONFIG_MODULES) || defined(CONFIG_DEBUG_PAGEALLOC)
466462
bgt- 112f
467463
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
@@ -523,11 +519,7 @@ DataLoadTLBMiss:
523519
lis r1, TASK_SIZE@h /* check if kernel address */
524520
cmplw 0,r1,r3
525521
mfspr r2, SPRN_SPRG_PGDIR
526-
#ifdef CONFIG_SWAP
527522
li r1, _PAGE_PRESENT | _PAGE_ACCESSED
528-
#else
529-
li r1, _PAGE_PRESENT
530-
#endif
531523
bgt- 112f
532524
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
533525
addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */
@@ -603,11 +595,7 @@ DataStoreTLBMiss:
603595
lis r1, TASK_SIZE@h /* check if kernel address */
604596
cmplw 0,r1,r3
605597
mfspr r2, SPRN_SPRG_PGDIR
606-
#ifdef CONFIG_SWAP
607598
li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED
608-
#else
609-
li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT
610-
#endif
611599
bgt- 112f
612600
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
613601
addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */

0 commit comments

Comments
 (0)