From beaec7f140cb4d674f26f1bdb850a4abe4a32b7c Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 16 May 2021 17:41:30 +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. ok patrick@, drahn@ --- sys/arch/arm64/arm64/pmap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c index 50dfaf77e67..4fad269976c 100644 --- a/sys/arch/arm64/arm64/pmap.c +++ b/sys/arch/arm64/arm64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.77 2021/05/16 15:10:19 deraadt Exp $ */ +/* $OpenBSD: pmap.c,v 1.78 2021/05/16 17:41:30 kettenis Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn * @@ -1859,13 +1859,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