Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Mirror what is done for amd64 boot and AC...



details:   https://anonhg.NetBSD.org/src/rev/f49f0a2593dd
branches:  trunk
changeset: 778907:f49f0a2593dd
user:      jym <jym%NetBSD.org@localhost>
date:      Thu Apr 19 18:07:05 2012 +0000

description:
Mirror what is done for amd64 boot and ACPI wakeup code by setting
CR0_WP (write protection bit) early on boot. Although it is set later via
cpu_init(), this can help tracking down invalid writes to pages mapped
as read only from ring 0.

No regression observed when booting under anita (QEMU) or a P4 host.

Depending on your hardware or setup, you may trigger code paths I have
overlooked. So if your machine does not start properly, or you get
page faults early during boot, please report them to me.

diffstat:

 sys/arch/i386/i386/locore.S |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 4f0586737559 -r f49f0a2593dd sys/arch/i386/i386/locore.S
--- a/sys/arch/i386/i386/locore.S       Thu Apr 19 18:00:34 2012 +0000
+++ b/sys/arch/i386/i386/locore.S       Thu Apr 19 18:07:05 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.98 2012/04/19 18:00:35 jym Exp $  */
+/*     $NetBSD: locore.S,v 1.99 2012/04/19 18:07:05 jym Exp $  */
 
 /*
  * Copyright-o-rama!
@@ -129,7 +129,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.98 2012/04/19 18:00:35 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.99 2012/04/19 18:07:05 jym Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_ddb.h"
@@ -682,7 +682,7 @@
         */
        movl    %cr0,%eax               # get control word
                                        # enable paging & NPX emulation
-       orl     $(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_EM|CR0_MP|CR0_AM),%eax
+       orl     $(CR0_PE|CR0_PG|CR0_NE|CR0_TS|CR0_EM|CR0_MP|CR0_WP|CR0_AM),%eax
        movl    %eax,%cr0               # and page NOW!
 
        pushl   $begin                  # jump to high mem



Home | Main Index | Thread Index | Old Index