Skip to contentSkip to conversation

csky: Remove pre-processing pte-dirty&young in entry.S

PATCH New [email protected] 1 participant 1 message Mar 29, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 csky: Remove pre-processing pte-dirty&young in entry.S

From: Guo Ren <[email protected]>

do_page_fault()->
handle_mm_fault()->

    __handle_mm_fault()->
      handle_pte_fault()

The handle_pte_fault() will call pte_mkdirty() and pte_mkyoung() to set up dirty or valid bit in page-table entry. So there is no need to pre-process first-access and first-write in entry.S with assembly code.

---
 arch/csky/abiv1/inc/abi/entry.h |  20 --------
 arch/csky/abiv2/inc/abi/entry.h |  24 ----------
 arch/csky/include/asm/pgtable.h |  10 ++--
 arch/csky/kernel/entry.S        | 101 ++++++++--------------------------------
 4 files changed, 24 insertions(+), 131 deletions(-)
arch/csky/abiv1/inc/abi/entry.h +0 -20
index 7dacce4..9e343f4 100644
@@ -126,30 +126,10 @@
 .endm
 
 /* MMU registers operators. */
-.macro RD_MIR	rx
-	cprcr   \rx, cpcr0
-.endm
-
 .macro RD_MEH	rx
 	cprcr   \rx, cpcr4
 .endm
 
-.macro RD_MCIR	rx
-	cprcr   \rx, cpcr8
-.endm
-
-.macro RD_PGDR  rx
-	cprcr   \rx, cpcr29
-.endm
-
-.macro WR_MEH	rx
-	cpwcr   \rx, cpcr4
-.endm
-
-.macro WR_MCIR	rx
-	cpwcr   \rx, cpcr8
-.endm
-
 .macro SETUP_MMU rx
 	lrw	\rx, PHYS_OFFSET | 0xe
 	cpwcr	\rx, cpcr30
arch/csky/abiv2/inc/abi/entry.h +0 -24
index ea376ed..eb8fecc 100644
@@ -141,34 +141,10 @@
 .endm
 
 /* MMU registers operators. */
-.macro RD_MIR rx
-	mfcr	\rx, cr<0, 15>
-.endm
-
 .macro RD_MEH rx
 	mfcr	\rx, cr<4, 15>
 .endm
 
-.macro RD_MCIR rx
-	mfcr	\rx, cr<8, 15>
-.endm
-
-.macro RD_PGDR rx
-	mfcr	\rx, cr<29, 15>
-.endm
-
-.macro RD_PGDR_K rx
-	mfcr	\rx, cr<28, 15>
-.endm
-
-.macro WR_MEH rx
-	mtcr	\rx, cr<4, 15>
-.endm
-
-.macro WR_MCIR rx
-	mtcr	\rx, cr<8, 15>
-.endm
-
 .macro SETUP_MMU rx
 	lrw	\rx, PHYS_OFFSET | 0xe
 	mtcr	\rx, cr<30, 15>
arch/csky/include/asm/pgtable.h +4 -6
index dcea277..60382aa 100644
@@ -218,17 +218,15 @@ static inline pte_t pte_mkwrite(pte_t pte)
 
 static inline pte_t pte_mkdirty(pte_t pte)
 {
-	pte_val(pte) |= _PAGE_MODIFIED;
-	if (pte_val(pte) & _PAGE_WRITE)
-		pte_val(pte) |= _PAGE_DIRTY;
+	pte_val(pte) |= _PAGE_MODIFIED | _PAGE_DIRTY;
+
 	return pte;
 }
 
 static inline pte_t pte_mkyoung(pte_t pte)
 {
-	pte_val(pte) |= _PAGE_ACCESSED;
-	if (pte_val(pte) & _PAGE_READ)
-		pte_val(pte) |= _PAGE_VALID;
+	pte_val(pte) |= _PAGE_ACCESSED | _PAGE_VALID;
+
 	return pte;
 }
 
arch/csky/kernel/entry.S +20 -81

128 lines not on this page · raw message

Signature · 1 line
2.7.4