Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86_64/x86_64 Fix another off-by-one, this time in ...
details: https://anonhg.NetBSD.org/src/rev/5f247685579e
branches: trunk
changeset: 543430:5f247685579e
user: fvdl <fvdl%NetBSD.org@localhost>
date: Tue Feb 25 00:48:00 2003 +0000
description:
Fix another off-by-one, this time in the current KVA limited as maintained
by pmap_growkernel.
diffstat:
sys/arch/x86_64/x86_64/pmap.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (51 lines):
diff -r db3205e03c5a -r 5f247685579e sys/arch/x86_64/x86_64/pmap.c
--- a/sys/arch/x86_64/x86_64/pmap.c Tue Feb 25 00:47:11 2003 +0000
+++ b/sys/arch/x86_64/x86_64/pmap.c Tue Feb 25 00:48:00 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.14 2003/02/23 02:44:44 fvdl Exp $ */
+/* $NetBSD: pmap.c,v 1.15 2003/02/25 00:48:00 fvdl Exp $ */
/*
*
@@ -3334,6 +3334,8 @@
* the pmaps on the system.
*/
+static vaddr_t pmap_maxkvaddr = VM_MIN_KERNEL_ADDRESS;
+
vaddr_t
pmap_growkernel(maxkvaddr)
vaddr_t maxkvaddr;
@@ -3341,12 +3343,11 @@
struct pmap *kpm = pmap_kernel(), *pm;
int s, i;
unsigned newpdes;
- vaddr_t curmax;
long needed_kptp[PTP_LEVELS], target_nptp, old;
- curmax = VM_MIN_KERNEL_ADDRESS + nkptp[1] * NBPD_L2;
- if (maxkvaddr <= curmax)
- return curmax;
+ if (maxkvaddr <= pmap_maxkvaddr)
+ return pmap_maxkvaddr;
+
maxkvaddr = round_pdr(maxkvaddr);
old = nkptp[PTP_LEVELS - 1];
/*
@@ -3367,7 +3368,7 @@
s = splhigh(); /* to be safe */
simple_lock(&kpm->pm_lock);
- pmap_alloc_level(normal_pdes, curmax, PTP_LEVELS,
+ pmap_alloc_level(normal_pdes, pmap_maxkvaddr, PTP_LEVELS,
needed_kptp);
/*
@@ -3389,6 +3390,7 @@
simple_unlock(&pmaps_lock);
}
+ pmap_maxkvaddr = maxkvaddr;
simple_unlock(&kpm->pm_lock);
splx(s);
Home |
Main Index |
Thread Index |
Old Index