Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 Xen/i386PAE is special, in that top-level e...
details: https://anonhg.NetBSD.org/src/rev/c489b14ac4d5
branches: trunk
changeset: 354697:c489b14ac4d5
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sun Jun 25 22:16:46 2017 +0000
description:
Xen/i386PAE is special, in that top-level entries are not in per-pmap
tables but per-CPU pages. pmap_alloc_level() takes care of making new
entries actives when the kernel pmap is updated, so always use pmap_kernel()
is this case too.
diffstat:
sys/arch/x86/x86/pmap.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (49 lines):
diff -r ca8fa8c3a267 -r c489b14ac4d5 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c Sun Jun 25 20:22:32 2017 +0000
+++ b/sys/arch/x86/x86/pmap.c Sun Jun 25 22:16:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.253 2017/06/25 12:42:40 bouyer Exp $ */
+/* $NetBSD: pmap.c,v 1.254 2017/06/25 22:16:46 bouyer Exp $ */
/*
* Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.253 2017/06/25 12:42:40 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.254 2017/06/25 22:16:46 bouyer Exp $");
#include "opt_user_ldt.h"
#include "opt_lockdebug.h"
@@ -4430,8 +4430,8 @@
needed_kptp[i] = target_nptp - nkptp[i];
}
-#if defined(XEN) && defined(__x86_64__)
- /* only pmap_kernel() has kernel entries */
+#if defined(XEN) && (defined(__x86_64__) || defined(PAE))
+ /* only pmap_kernel(), or the per-cpu map, has kernel entries */
cpm = kpm;
#else
/* Get the current pmap */
@@ -4453,6 +4453,11 @@
/* nothing, kernel entries are never entered in user pmap */
#else /* __x86_64__ */
int pdkidx;
+#ifndef PAE
+ /*
+ * for PAE this is not needed, because pmap_alloc_level()
+ * already did update the per-CPU tables
+ */
if (cpm != kpm) {
for (pdkidx = PDIR_SLOT_KERN + old;
pdkidx < PDIR_SLOT_KERN + nkptp[PTP_LEVELS - 1];
@@ -4462,6 +4467,7 @@
}
pmap_pte_flush();
}
+#endif /* !PAE */
mutex_enter(&pmaps_lock);
LIST_FOREACH(pm, &pmaps, pm_list) {
Home |
Main Index |
Thread Index |
Old Index