Module Name:    src
Committed By:   reinoud
Date:           Sat Feb  4 22:45:42 UTC 2012

Modified Files:
        src/sys/arch/amd64/amd64: trap.c

Log Message:
Fix address of SIGILL instruction on amd64 as previously fixed on i386. It
used to return the effective address of the faulted memory access but on
SIGILL its obviously wrong since there is no MMU fault.

Instead return the instruction counter register.
OK by releng


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/amd64/amd64/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/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.68 src/sys/arch/amd64/amd64/trap.c:1.69
--- src/sys/arch/amd64/amd64/trap.c:1.68	Sun Nov  6 15:53:04 2011
+++ src/sys/arch/amd64/amd64/trap.c	Sat Feb  4 22:45:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.68 2011/11/06 15:53:04 cherry Exp $	*/
+/*	$NetBSD: trap.c,v 1.69 2012/02/04 22:45:40 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.68 2011/11/06 15:53:04 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.69 2012/02/04 22:45:40 reinoud Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -404,7 +404,7 @@ copyfault:
 		KSI_INIT_TRAP(&ksi);
 		ksi.ksi_signo = SIGILL;
 		ksi.ksi_trap = type & ~T_USER;
-		ksi.ksi_addr = (void *)rcr2();
+		ksi.ksi_addr = (void *) frame->tf_rip;
 		switch (type) {
 		case T_PRIVINFLT|T_USER:
 			ksi.ksi_code = ILL_PRVOPC;

Reply via email to