Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64/amd64 Fix address of SIGILL instruction on am...



details:   https://anonhg.NetBSD.org/src/rev/3daeed08ca5a
branches:  trunk
changeset: 773526:3daeed08ca5a
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Sat Feb 04 22:45:40 2012 +0000

description:
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

diffstat:

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

diffs (27 lines):

diff -r c5e040a3cc1c -r 3daeed08ca5a sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Sat Feb 04 22:27:25 2012 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Sat Feb 04 22:45:40 2012 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index