Module Name: src
Committed By: reinoud
Date: Wed Sep 7 09:24:55 UTC 2011
Modified Files:
src/sys/arch/i386/i386: trap.c
Log Message:
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!
To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/sys/arch/i386/i386/trap.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/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.261 src/sys/arch/i386/i386/trap.c:1.262
--- src/sys/arch/i386/i386/trap.c:1.261 Sun Apr 3 22:29:26 2011
+++ src/sys/arch/i386/i386/trap.c Wed Sep 7 09:24:55 2011
@@ -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;