Module Name:    src
Committed By:   maxv
Date:           Sun Sep 25 12:53:24 UTC 2016

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

Log Message:
Revert my previous change. It is too severe: a fault might be happening in
the kernel page if the map is pageable - implying it is not pmap_kernel. I
thought it wouldn't be the case.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.279 -r1.280 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/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.85 src/sys/arch/amd64/amd64/trap.c:1.86
--- src/sys/arch/amd64/amd64/trap.c:1.85	Fri Sep 16 11:48:10 2016
+++ src/sys/arch/amd64/amd64/trap.c	Sun Sep 25 12:53:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.85 2016/09/16 11:48:10 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.86 2016/09/25 12:53:24 maxv 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.85 2016/09/16 11:48:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.86 2016/09/25 12:53:24 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -310,10 +310,6 @@ trap(struct trapframe *frame)
 copyefault:
 			error = EFAULT;
 copyfault:
-			KASSERT(onfault == kcopy_fault ||
-			    rcr2() < VM_MAXUSER_ADDRESS);
-			KASSERT(onfault != kcopy_fault ||
-			    rcr2() >= VM_MAXUSER_ADDRESS);
 			frame->tf_rip = (uintptr_t)onfault;
 			frame->tf_rax = error;
 			return;

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.279 src/sys/arch/i386/i386/trap.c:1.280
--- src/sys/arch/i386/i386/trap.c:1.279	Fri Sep 16 11:48:10 2016
+++ src/sys/arch/i386/i386/trap.c	Sun Sep 25 12:53:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.279 2016/09/16 11:48:10 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.280 2016/09/25 12:53:24 maxv 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.279 2016/09/16 11:48:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.280 2016/09/25 12:53:24 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -354,10 +354,6 @@ trap(struct trapframe *frame)
 copyefault:
 			error = EFAULT;
 copyfault:
-			KASSERT(onfault == kcopy_fault ||
-			    rcr2() < VM_MAXUSER_ADDRESS);
-			KASSERT(onfault != kcopy_fault ||
-			    rcr2() >= VM_MAXUSER_ADDRESS);
 			frame->tf_eip = (uintptr_t)onfault;
 			frame->tf_eax = error;
 			return;

Reply via email to