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 Remove the single-step check, it is wro...



details:   https://anonhg.NetBSD.org/src/rev/847537d170cd
branches:  trunk
changeset: 459042:847537d170cd
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Aug 21 17:06:36 2019 +0000

description:
Remove the single-step check, it is wrong. There is no way we could
single-step on these entry points. If there were, we would be running
with the wrong GS.base, and we would have died long before.

diffstat:

 sys/arch/amd64/amd64/trap.c |  14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diffs (49 lines):

diff -r c54c5893cc93 -r 847537d170cd sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Wed Aug 21 16:35:10 2019 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Wed Aug 21 17:06:36 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.121 2019/07/13 17:03:01 mlelstv Exp $       */
+/*     $NetBSD: trap.c,v 1.122 2019/08/21 17:06:36 maxv Exp $  */
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.121 2019/07/13 17:03:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.122 2019/08/21 17:06:36 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -151,8 +151,6 @@
 };
 int    trap_types = __arraycount(trap_type);
 
-#define        IDTVEC(name)    __CONCAT(X, name)
-
 #ifdef TRAP_SIGDEBUG
 static void sigdebug(const struct trapframe *, const ksiginfo_t *, int);
 #define SIGDEBUG(a, b, c) sigdebug(a, b, c)
@@ -265,8 +263,6 @@
        struct proc *p;
        struct pcb *pcb;
        extern char kcopy_fault[];
-       extern char IDTVEC(osyscall)[];
-       extern char IDTVEC(syscall32)[];
        ksiginfo_t ksi;
        void *onfault;
        int type, error;
@@ -657,12 +653,6 @@
                if (x86_dbregs_user_trap())
                        break;
 
-               /* Check whether they single-stepped into a lcall. */
-               if (frame->tf_rip == (uint64_t)IDTVEC(osyscall) ||
-                   frame->tf_rip == (uint64_t)IDTVEC(syscall32)) {
-                       frame->tf_rflags &= ~PSL_T;
-                       return;
-               }
                goto we_re_toast;
 
        case T_BPTFLT|T_USER:           /* bpt instruction fault */



Home | Main Index | Thread Index | Old Index