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 Fix the illegal instruction return addres...



details:   https://anonhg.NetBSD.org/src/rev/c0733791c341
branches:  trunk
changeset: 769366:c0733791c341
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Sep 07 09:24:55 2011 +0000

description:
Fix the illegal instruction return address. It was using the value of the
cpu's %cr2 register but thats not valid:

CR2 Contains a value called Page Fault Linear Address (PFLA). When a page
fault occurs, the address the program attempted to access is stored in the CR2
register.

And this is thus NOT the illegal instruction address!

diffstat:

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

diffs (27 lines):

diff -r 5d58562f0a57 -r c0733791c341 sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Wed Sep 07 08:54:41 2011 +0000
+++ b/sys/arch/i386/i386/trap.c Wed Sep 07 09:24:55 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.261 2011/04/03 22:29:26 dyoung Exp $        */
+/*     $NetBSD: trap.c,v 1.262 2011/09/07 09:24:55 reinoud Exp $       */
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.261 2011/04/03 22:29:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.262 2011/09/07 09:24:55 reinoud Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -542,7 +542,7 @@
        case T_FPOPFLT|T_USER:          /* coprocessor operand fault */
                KSI_INIT_TRAP(&ksi);
                ksi.ksi_signo = SIGILL;
-               ksi.ksi_addr = (void *)rcr2();
+               ksi.ksi_addr = (void *) frame->tf_eip;
                switch (type) {
                case T_PRIVINFLT|T_USER:
                        ksi.ksi_code = ILL_PRVOPC;



Home | Main Index | Thread Index | Old Index