From ff9b32b90760849db29e606a8acc9cdc3fe698ec Mon Sep 17 00:00:00 2001 From: jca Date: Sun, 24 Sep 2023 18:49:29 +0000 Subject: [PATCH] Drop PTE check in pmap_fault_fixup(). Since pmap_enter() doesn't add PTE's for pages that haven't been accessed yet, the check would skip the fixup on such pages and force us to go through uvm_fault() just for the sake of MOD/REF bit emulation. Since we already check the PTE descriptor, dropping the check should be safe. Doing so gives us a nice 10% performance gain when building a kernel. Original commit for arch/arm64/arm64/pmap.c: date: 2021/05/16 17:41:30; author: kettenis; state: Exp; lines: +1 -8; commitid: yBzyZzIKRLyAkuDY; ok drahn@ kettenis@ --- sys/arch/riscv64/riscv64/pmap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/arch/riscv64/riscv64/pmap.c b/sys/arch/riscv64/riscv64/pmap.c index 50ee1ee67cc..3d5d7e2c3a6 100644 --- a/sys/arch/riscv64/riscv64/pmap.c +++ b/sys/arch/riscv64/riscv64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.34 2023/09/18 17:01:41 jca Exp $ */ +/* $OpenBSD: pmap.c,v 1.35 2023/09/24 18:49:29 jca Exp $ */ /* * Copyright (c) 2019-2020 Brian Bamsch @@ -1679,13 +1679,6 @@ pmap_fault_fixup(pmap_t pm, vaddr_t va, vm_prot_t ftype) if (pg == NULL) goto done; - /* - * Check based on fault type for mod/ref emulation. - * if L3 entry is zero, it is not a possible fixup - */ - if (*pl3 == 0) - goto done; - /* * Check the fault types to find out if we were doing * any mod/ref emulation and fixup the PTE if we were. -- 2.20.1