Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64 Drop COMPAT_10 on amd64. The support for it c...



details:   https://anonhg.NetBSD.org/src/rev/ef3fba51ca1d
branches:  trunk
changeset: 357905:ef3fba51ca1d
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Dec 02 12:40:03 2017 +0000

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

diffstat:

 sys/arch/amd64/amd64/trap.c |  34 +++-------------------------------
 sys/arch/amd64/conf/ALL     |   5 ++---
 sys/arch/amd64/conf/GENERIC |  10 ++++++----
 3 files changed, 11 insertions(+), 38 deletions(-)

diffs (127 lines):

diff -r 5a3013269db5 -r ef3fba51ca1d sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Sat Dec 02 09:59:02 2017 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Sat Dec 02 12:40:03 2017 +0000
@@ -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 @@
 
 #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_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:
diff -r 5a3013269db5 -r ef3fba51ca1d sys/arch/amd64/conf/ALL
--- a/sys/arch/amd64/conf/ALL   Sat Dec 02 09:59:02 2017 +0000
+++ b/sys/arch/amd64/conf/ALL   Sat Dec 02 12:40:03 2017 +0000
@@ -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 @@
 
 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        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"
diff -r 5a3013269db5 -r ef3fba51ca1d sys/arch/amd64/conf/GENERIC
--- a/sys/arch/amd64/conf/GENERIC       Sat Dec 02 09:59:02 2017 +0000
+++ b/sys/arch/amd64/conf/GENERIC       Sat Dec 02 12:40:03 2017 +0000
@@ -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 @@
 
 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 @@
 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



Home | Main Index | Thread Index | Old Index