Module Name: src
Committed By: rmind
Date: Wed Aug 29 22:43:35 UTC 2012
Modified Files:
src/sys/arch/i386/i386: i386func.S
Log Message:
tlbflushg/i386: test for the PGE feature flag first, before checking the %cr4.
Add a comment explaining why need to check both and in such order.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/i386/i386func.S
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/i386func.S
diff -u src/sys/arch/i386/i386/i386func.S:1.16 src/sys/arch/i386/i386/i386func.S:1.17
--- src/sys/arch/i386/i386/i386func.S:1.16 Sun Jun 12 03:35:42 2011
+++ src/sys/arch/i386/i386/i386func.S Wed Aug 29 22:43:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: i386func.S,v 1.16 2011/06/12 03:35:42 rmind Exp $ */
+/* $NetBSD: i386func.S,v 1.17 2012/08/29 22:43:35 rmind Exp $ */
/*-
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: i386func.S,v 1.16 2011/06/12 03:35:42 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386func.S,v 1.17 2012/08/29 22:43:35 rmind Exp $");
#include <machine/specialreg.h>
#include <machine/segments.h>
@@ -99,9 +99,13 @@ END(lcr3)
*
* (the alternatives not quoted above are not an option here.)
*
- * If PGE is not in use, we reload CR3.
+ * If PGE is not in use, we reload CR3. Check for the PGE feature
+ * first since i486 does not have CR4. Note: the feature flag may
+ * be present while the actual PGE functionality not yet enabled.
*/
ENTRY(tlbflushg)
+ testl $CPUID_PGE, _C_LABEL(cpu_feature)
+ jz 1f
movl %cr4, %eax
testl $CR4_PGE, %eax
jz 1f