Module Name:    src
Committed By:   maxv
Date:           Wed Aug 21 17:06:36 UTC 2019

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

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 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.121 src/sys/arch/amd64/amd64/trap.c:1.122
--- src/sys/arch/amd64/amd64/trap.c:1.121	Sat Jul 13 17:03:01 2019
+++ src/sys/arch/amd64/amd64/trap.c	Wed Aug 21 17:06:36 2019
@@ -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 @@ const char * const trap_type[] = {
 };
 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 @@ trap(struct trapframe *frame)
 	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 @@ faultcommon:
 		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 */

Reply via email to