Module Name:    src
Committed By:   maxv
Date:           Sat Dec  2 12:40:03 UTC 2017

Modified Files:
        src/sys/arch/amd64/amd64: trap.c
        src/sys/arch/amd64/conf: ALL GENERIC

Log Message:
Drop COMPAT_10 on amd64. The support for it comes down to one ifdef in
trap.c - code that is incorrect anyway, there were originally three lcall
LDT slots, and here only one instruction is decoded.

Given that one of these slots was used by BSDi's syscall, also remove the
references to COMPAT_NOMID to make clear we don't support that (it already
is not enabled).

Note: for some reason, COMPAT_10 does not even compile, because there are
"multiple definitions of _KERNEL_OPT_COMPAT_...", and I don't really
understand where this comes from.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.469 -r1.470 src/sys/arch/amd64/conf/GENERIC

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.104 src/sys/arch/amd64/amd64/trap.c:1.105
--- src/sys/arch/amd64/amd64/trap.c:1.104	Sat Oct 21 08:08:26 2017
+++ src/sys/arch/amd64/amd64/trap.c	Sat Dec  2 12:40:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.104 2017/10/21 08:08:26 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.105 2017/12/02 12:40:03 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,14 +64,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.104 2017/10/21 08:08:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2017/12/02 12:40:03 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
 #include "opt_xen.h"
 #include "opt_dtrace.h"
-#include "opt_compat_netbsd.h"
-#include "opt_compat_netbsd32.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -88,11 +86,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.1
 
 #include <uvm/uvm_extern.h>
 
-#ifdef COMPAT_NETBSD32
-#include <sys/exec.h>
-#include <compat/netbsd32/netbsd32_exec.h>
-#endif
-
 #include <machine/cpufunc.h>
 #include <x86/fpu.h>
 #include <machine/psl.h>
@@ -414,28 +407,7 @@ trap(struct trapframe *frame)
 		trap_user_kernelmode(frame, type, l, p);
 		goto we_re_toast;
 
-	case T_PROTFLT|T_USER:		/* protection fault */
-#if defined(COMPAT_NETBSD32) && defined(COMPAT_10)
-	{
-		static const char lcall[7] = { 0x9a, 0, 0, 0, 0, 7, 0 };
-		const size_t sz = sizeof(lcall);
-		char tmp[sz];
-
-		/* Check for the oosyscall lcall instruction. */
-		if (p->p_emul == &emul_netbsd32 &&
-		    frame->tf_rip < VM_MAXUSER_ADDRESS32 - sz &&
-		    copyin((void *)frame->tf_rip, tmp, sz) == 0 &&
-		    memcmp(tmp, lcall, sz) == 0) {
-
-			/* Advance past the lcall. */
-			frame->tf_rip += sz;
-
-			/* Do the syscall. */
-			p->p_md.md_syscall(frame);
-			goto out;
-		}
-	}
-#endif
+	case T_PROTFLT|T_USER:
 	case T_TSSFLT|T_USER:
 	case T_SEGNPFLT|T_USER:
 	case T_STKFLT|T_USER:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.73 src/sys/arch/amd64/conf/ALL:1.74
--- src/sys/arch/amd64/conf/ALL:1.73	Sat Dec  2 09:59:02 2017
+++ src/sys/arch/amd64/conf/ALL	Sat Dec  2 12:40:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.73 2017/12/02 09:59:02 maxv Exp $
+# $NetBSD: ALL,v 1.74 2017/12/02 12:40:03 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.73 $"
+#ident		"ALL-$Revision: 1.74 $"
 
 maxusers	64		# estimated number of users
 
@@ -130,7 +130,6 @@ options 	UVMHIST		# kernhist for uvm sub
 options 	BIOHIST		# kernhist for buff I/O
 
 # Compatibility options
-options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI
 options 	EXEC_AOUT	# required by binaries from before 1.5
 options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 include 	"conf/compat_netbsd09.config"

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.469 src/sys/arch/amd64/conf/GENERIC:1.470
--- src/sys/arch/amd64/conf/GENERIC:1.469	Sat Nov 25 16:32:48 2017
+++ src/sys/arch/amd64/conf/GENERIC	Sat Dec  2 12:40:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.469 2017/11/25 16:32:48 jmcneill Exp $
+# $NetBSD: GENERIC,v 1.470 2017/12/02 12:40:03 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.469 $"
+#ident		"GENERIC-$Revision: 1.470 $"
 
 maxusers	64		# estimated number of users
 
@@ -115,11 +115,13 @@ makeoptions	DEBUG="-g"	# compile full sy
 options 	KDTRACE_HOOKS	# kernel DTrace hooks
 
 # Compatibility options
-# (note that really old compat (< 1.6) is only useful for 32-bit binaries)
 #options 	EXEC_AOUT	# required by binaries from before 1.5
-#options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI
 
+# NetBSD backward compatibility. Support goes from COMPAT_11 up until
+# the latest release. Note that really old compat (< COMPAT_16) is only
+# useful for 32-bit binaries.
 include 	"conf/compat_netbsd15.config"
+
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
 options 	COMPAT_OSSAUDIO

Reply via email to