Module Name: src
Committed By: jym
Date: Mon Aug 16 19:39:06 UTC 2010
Modified Files:
src/sys/arch/i386/i386: machdep.c
src/sys/arch/x86/include: cpu.h
Log Message:
Add machdep.pae sysctl(7) for i386. Thanks to Paul and Joerg for their
reviews.
In kernel, it matches the 'i386_use_pae' variable (0: kernel does not use
PAE, 1: kernel uses PAE). Will be used by i386 kvm(3) to know the functions
that should get called for VA => PA translations.
To generate a diff of this commit:
cvs rdiff -u -r1.692 -r1.693 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/include/cpu.h
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/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.692 src/sys/arch/i386/i386/machdep.c:1.693
--- src/sys/arch/i386/i386/machdep.c:1.692 Sat Aug 7 20:07:26 2010
+++ src/sys/arch/i386/i386/machdep.c Mon Aug 16 19:39:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.692 2010/08/07 20:07:26 jruoho Exp $ */
+/* $NetBSD: machdep.c,v 1.693 2010/08/16 19:39:06 jym Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.692 2010/08/07 20:07:26 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.693 2010/08/16 19:39:06 jym Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -250,6 +250,7 @@
int i386_fpu_fdivbug;
int i386_use_fxsave;
+int i386_use_pae = 0;
int i386_has_sse;
int i386_has_sse2;
@@ -690,6 +691,11 @@
CTLTYPE_QUAD, "tsc_freq", NULL,
NULL, 0, &tsc_freq, 0,
CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "pae", "Whether the kernel uses PAE",
+ NULL, 0, &i386_use_pae, 0,
+ CTL_MACHDEP, CTL_CREATE, CTL_EOL);
}
void *
@@ -1302,6 +1308,10 @@
cpu_init_msrs(&cpu_info_primary, true);
+#ifdef PAE
+ i386_use_pae = 1;
+#endif
+
#ifdef XEN
pcb->pcb_cr3 = PDPpaddr;
__PRINTK(("pcb_cr3 0x%lx cr3 0x%lx\n",
Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.24 src/sys/arch/x86/include/cpu.h:1.25
--- src/sys/arch/x86/include/cpu.h:1.24 Wed Aug 4 10:02:11 2010
+++ src/sys/arch/x86/include/cpu.h Mon Aug 16 19:39:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.24 2010/08/04 10:02:11 jruoho Exp $ */
+/* $NetBSD: cpu.h,v 1.25 2010/08/16 19:39:06 jym Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -341,6 +341,7 @@
extern char cpu_brand_string[];
extern int i386_use_fxsave;
+extern int i386_use_pae;
extern int i386_has_sse;
extern int i386_has_sse2;