Module Name:    src
Committed By:   maxv
Date:           Fri Jul  1 12:18:35 UTC 2016

Modified Files:
        src/sys/arch/x86/x86: pmap.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 src/sys/arch/x86/x86/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.204 src/sys/arch/x86/x86/pmap.c:1.205
--- src/sys/arch/x86/x86/pmap.c:1.204	Fri Jul  1 12:12:06 2016
+++ src/sys/arch/x86/x86/pmap.c	Fri Jul  1 12:18:34 2016
@@ -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 @@ pmap_init_directmap(struct pmap *kpm)
 			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;

Reply via email to