Module Name: src
Committed By: ryo
Date: Mon Jan 31 08:43:05 UTC 2022
Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
Log Message:
Skip unnecessary PTE operations and TLB invalidation.
To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/aarch64/aarch64/pmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.125 src/sys/arch/aarch64/aarch64/pmap.c:1.126
--- src/sys/arch/aarch64/aarch64/pmap.c:1.125 Sun Jan 16 10:50:02 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c Mon Jan 31 08:43:05 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.125 2022/01/16 10:50:02 rillig Exp $ */
+/* $NetBSD: pmap.c,v 1.126 2022/01/31 08:43:05 ryo Exp $ */
/*
* Copyright (c) 2017 Ryo Shimizu <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.125 2022/01/16 10:50:02 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.126 2022/01/31 08:43:05 ryo Exp $");
#include "opt_arm_debug.h"
#include "opt_ddb.h"
@@ -2515,6 +2515,8 @@ pmap_clear_modify(struct vm_page *pg)
tryagain:
if (!l3pte_valid(pte))
continue;
+ if ((pte & LX_BLKPAG_AP) == LX_BLKPAG_AP_RO)
+ continue;
/* clear write permission */
pte &= ~LX_BLKPAG_AP;
@@ -2576,6 +2578,8 @@ pmap_clear_reference(struct vm_page *pg)
tryagain:
if (!l3pte_valid(pte))
continue;
+ if ((pte & LX_BLKPAG_AF) == 0)
+ continue;
/* clear access permission */
pte &= ~LX_BLKPAG_AF;