Skip to content

Commit f8b58c6

Browse files
chleroympe
authored andcommitted
powerpc/603: let's handle PAGE_DIRTY directly
PAGE_DIRTY corresponds to the C bit. If writing on a page for which the C bit is not set, a DataStoreTLBMiss is generated. No need to check it in DataLoadTLBMiss. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 54a05a3 commit f8b58c6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎arch/powerpc/kernel/head_32.S‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,10 @@ DataLoadTLBMiss:
595595
stw r0,0(r2) /* update PTE (accessed bit) */
596596
/* Convert linux-style PTE to low word of PPC-style PTE */
597597
rlwinm r1,r0,32-10,31,31 /* _PAGE_RW -> PP lsb */
598-
rlwinm r2,r0,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
599-
and r1,r1,r2 /* writable if _RW and _DIRTY */
600598
rlwimi r0,r0,32-1,30,30 /* _PAGE_USER -> PP msb */
601599
rlwimi r0,r0,32-1,31,31 /* _PAGE_USER -> PP lsb */
602600
ori r1,r1,0xe04 /* clear out reserved bits */
603-
andc r1,r0,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
601+
andc r1,r0,r1 /* PP = user? rw? 2: 3: 0 */
604602
BEGIN_FTR_SECTION
605603
rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
606604
END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
@@ -669,7 +667,7 @@ DataStoreTLBMiss:
669667
lwz r0,0(r2) /* get linux-style pte */
670668
andc. r1,r1,r0 /* check access & ~permission */
671669
bne- DataAddressInvalid /* return if access not permitted */
672-
ori r0,r0,_PAGE_ACCESSED|_PAGE_DIRTY
670+
ori r0,r0,_PAGE_ACCESSED
673671
/*
674672
* NOTE! We are assuming this is not an SMP system, otherwise
675673
* we would need to update the pte atomically with lwarx/stwcx.

0 commit comments

Comments
 (0)