Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/arm32 A fix and an optimisation to pmap_l1tt_free
details: https://anonhg.NetBSD.org/src/rev/d2811f5d6627
branches: trunk
changeset: 744142:d2811f5d6627
user: skrll <skrll%NetBSD.org@localhost>
date: Sat Jan 25 16:19:29 2020 +0000
description:
A fix and an optimisation to pmap_l1tt_free
- in the !__HAVE_MM_MD_DIRECT_MAPPED_PHYS case pass UVM_KMF_WIRED so that
the mappings are removed and the KVA is released. Fixes the KASSERT
seen in the automated test runs.
- in the __HAVE_MM_MD_DIRECT_MAPPED_PHYS case we can work out pa much
easier than caling pmap_extract.
diffstat:
sys/arch/arm/arm32/pmap.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diffs (37 lines):
diff -r d1b3f684f6f8 -r d2811f5d6627 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Sat Jan 25 15:59:11 2020 +0000
+++ b/sys/arch/arm/arm32/pmap.c Sat Jan 25 16:19:29 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.381 2020/01/19 10:59:56 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.382 2020/01/25 16:19:29 skrll Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
#include <arm/db_machdep.h>
#endif
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.381 2020/01/19 10:59:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.382 2020/01/25 16:19:29 skrll Exp $");
//#define PMAP_DEBUG
#ifdef PMAP_DEBUG
@@ -6627,12 +6627,13 @@
vaddr_t va = (vaddr_t)v;
#if !defined( __HAVE_MM_MD_DIRECT_MAPPED_PHYS)
- uvm_km_free(kernel_map, va, L1TT_SIZE, 0);
+ uvm_km_free(kernel_map, va, L1TT_SIZE, UVM_KMF_WIRED);
#else
- paddr_t pa;
-
- bool ok = pmap_extract(pmap_kernel(), va, &pa);
- KASSERT(ok);
+#if defined(KERNEL_BASE_VOFFSET)
+ paddr_t pa = va - KERNEL_BASE_VOFFSET;
+#else
+ paddr_t pa = va - KERNEL_BASE + physical_start;
+#endif
const paddr_t epa = pa + L1TT_SIZE;
for (; pa < epa; pa += PAGE_SIZE) {
Home |
Main Index |
Thread Index |
Old Index