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 Surprisingly enough, the kernel expects the...



details:   https://anonhg.NetBSD.org/src/rev/6129218fea34
branches:  trunk
changeset: 816353:6129218fea34
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Jul 01 12:18:34 2016 +0000

description:
Surprisingly enough, the kernel expects the CPU to support large pages
when creating the direct map on amd64. Therefore, the amd64 CPUs that do
not support large pages basically don't work on NetBSD.

It looks like it has always been this way; add a KASSERT to panic
properly in case we come across one of these CPUs.

diffstat:

 sys/arch/x86/x86/pmap.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 1ecb0b37dde7 -r 6129218fea34 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Fri Jul 01 12:16:35 2016 +0000
+++ b/sys/arch/x86/x86/pmap.c   Fri Jul 01 12:18:34 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.204 2016/07/01 12:12:06 maxv Exp $  */
+/*     $NetBSD: pmap.c,v 1.205 2016/07/01 12:18:34 maxv Exp $  */
 
 /*-
  * Copyright (c) 2008, 2010, 2016 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.204 2016/07/01 12:12:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.205 2016/07/01 12:18:34 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1537,6 +1537,9 @@
                        memset((void *)tmpva, 0, PAGE_SIZE);
                }
 
+               KASSERT(pmap_largepages != 0);
+
+               /* Large pages are supported. Just create L2. */
                for (i = 0; i < NPDPG * n_dm_pdp; i++) {
                        pdp = (paddr_t)&(((pd_entry_t *)dm_pd)[i]);
                        *pte = (pdp & PG_FRAME) | pteflags;



Home | Main Index | Thread Index | Old Index