Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Drop support for svr4 on i386. This feature is not ...
details: https://anonhg.NetBSD.org/src/rev/1989dca077c0
branches: trunk
changeset: 355458:1989dca077c0
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Jul 29 11:54:14 2017 +0000
description:
Drop support for svr4 on i386. This feature is not maintained, not
reliable, and of a limited use case. Most svr4 applications got time to be
ported to linux, and we do have a functional, maintained linux emulation.
Reduces the number of entry points into the kernel, the number of
places that need special care (cpu context).
Note that compat_svr4 is still available on sparc.
diffstat:
sys/arch/i386/conf/files.i386 | 5 +-
sys/arch/i386/i386/locore.S | 37 +--
sys/arch/i386/i386/machdep.c | 18 +-
sys/arch/i386/i386/svr4_machdep.c | 578 --------------------------------------
sys/arch/i386/i386/svr4_sigcode.S | 92 ------
sys/arch/i386/i386/svr4_syscall.c | 147 ---------
sys/arch/xen/conf/files.xen | 5 +-
7 files changed, 6 insertions(+), 876 deletions(-)
diffs (truncated from 990 to 300 lines):
diff -r 9a63edcdcc80 -r 1989dca077c0 sys/arch/i386/conf/files.i386
--- a/sys/arch/i386/conf/files.i386 Sat Jul 29 10:39:48 2017 +0000
+++ b/sys/arch/i386/conf/files.i386 Sat Jul 29 11:54:14 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.i386,v 1.380 2017/07/29 06:29:31 maxv Exp $
+# $NetBSD: files.i386,v 1.381 2017/07/29 11:54:14 maxv Exp $
#
# new style config file for i386 architecture
#
@@ -327,9 +327,6 @@
# SVR4 binary compatibility (COMPAT_SVR4)
include "compat/svr4/files.svr4"
-file arch/i386/i386/svr4_machdep.c compat_svr4
-file arch/i386/i386/svr4_sigcode.S compat_svr4
-file arch/i386/i386/svr4_syscall.c compat_svr4
# iBCS-2 binary compatibility (COMPAT_IBCS2)
include "compat/ibcs2/files.ibcs2"
diff -r 9a63edcdcc80 -r 1989dca077c0 sys/arch/i386/i386/locore.S
--- a/sys/arch/i386/i386/locore.S Sat Jul 29 10:39:48 2017 +0000
+++ b/sys/arch/i386/i386/locore.S Sat Jul 29 11:54:14 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.147 2017/07/29 06:29:31 maxv Exp $ */
+/* $NetBSD: locore.S,v 1.148 2017/07/29 11:54:14 maxv Exp $ */
/*
* Copyright-o-rama!
@@ -128,7 +128,7 @@
*/
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.147 2017/07/29 06:29:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.148 2017/07/29 11:54:14 maxv Exp $");
#include "opt_copy_symtab.h"
#include "opt_ddb.h"
@@ -1330,39 +1330,6 @@
jmp .Lsyscall_checkast /* re-check ASTs */
IDTVEC_END(syscall)
-IDTVEC(svr4_fasttrap)
- pushl $2 /* size of instruction for restart */
- pushl $T_ASTFLT /* trap # for doing ASTs */
- INTRENTRY
- STI(%eax)
- pushl $RW_READER
- pushl $_C_LABEL(svr4_fasttrap_lock)
- call _C_LABEL(rw_enter)
- addl $8,%esp
- call *_C_LABEL(svr4_fasttrap_vec)
- pushl $_C_LABEL(svr4_fasttrap_lock)
- call _C_LABEL(rw_exit)
- addl $4,%esp
-2: /* Check for ASTs on exit to user mode. */
- cli
- CHECK_ASTPENDING(%eax)
- je 1f
- /* Always returning to user mode here. */
- CLEAR_ASTPENDING(%eax)
- sti
- /* Pushed T_ASTFLT into tf_trapno on entry. */
- pushl %esp
- call _C_LABEL(trap)
- addl $4,%esp
- jmp 2b
-1: CHECK_DEFERRED_SWITCH
- jnz 9f
- INTRFASTEXIT
-9: sti
- call _C_LABEL(pmap_load)
- cli
- jmp 2b
-
/*
* int npx586bug1(int a, int b)
* Used when checking for the FDIV bug on first generations pentiums.
diff -r 9a63edcdcc80 -r 1989dca077c0 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Sat Jul 29 10:39:48 2017 +0000
+++ b/sys/arch/i386/i386/machdep.c Sat Jul 29 11:54:14 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.786 2017/07/29 06:29:32 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.787 2017/07/29 11:54:14 maxv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,13 +67,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.786 2017/07/29 06:29:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.787 2017/07/29 11:54:14 maxv Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
#include "opt_compat_freebsd.h"
#include "opt_compat_netbsd.h"
-#include "opt_compat_svr4.h"
#include "opt_cpureset_delay.h"
#include "opt_ddb.h"
#include "opt_ipkdb.h"
@@ -923,9 +922,6 @@
typedef void (vector)(void);
extern vector IDTVEC(syscall);
extern vector *IDTVEC(exceptions)[];
-extern vector IDTVEC(svr4_fasttrap);
-void (*svr4_fasttrap_vec)(void) = (void (*)(void))nullop;
-krwlock_t svr4_fasttrap_lock;
#ifdef XEN
#define MAX_XEN_IDT 128
trap_info_t xen_idt[MAX_XEN_IDT];
@@ -1295,9 +1291,6 @@
idt_vec_reserve(128);
setgate(&idt[128], &IDTVEC(syscall), 0, SDT_SYS386IGT, SEL_UPL,
GSEL(GCODE_SEL, SEL_KPL));
- idt_vec_reserve(0xd2);
- setgate(&idt[0xd2], &IDTVEC(svr4_fasttrap), 0, SDT_SYS386IGT,
- SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
setregion(®ion, gdtstore, NGDT * sizeof(gdtstore[0]) - 1);
lgdt(®ion);
@@ -1336,11 +1329,6 @@
xen_idt[xen_idt_idx].address = (uint32_t)&IDTVEC(syscall);
xen_idt_idx++;
KASSERT(xen_idt_idx < MAX_XEN_IDT);
- xen_idt[xen_idt_idx].vector = 0xd2;
- xen_idt[xen_idt_idx].flags = SEL_UPL;
- xen_idt[xen_idt_idx].cs = GSEL(GCODE_SEL, SEL_KPL);
- xen_idt[xen_idt_idx].address = (uint32_t)&IDTVEC(svr4_fasttrap);
- xen_idt_idx++;
lldt(GSEL(GLDT_SEL, SEL_KPL));
cpu_init_idt();
#endif /* XEN */
@@ -1390,8 +1378,6 @@
cngetc();
}
- rw_init(&svr4_fasttrap_lock);
-
pcb->pcb_dbregs = NULL;
x86_dbregs_setup_initdbstate();
diff -r 9a63edcdcc80 -r 1989dca077c0 sys/arch/i386/i386/svr4_machdep.c
--- a/sys/arch/i386/i386/svr4_machdep.c Sat Jul 29 10:39:48 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,578 +0,0 @@
-/* $NetBSD: svr4_machdep.c,v 1.99 2014/02/23 22:35:27 dsl Exp $ */
-
-/*-
- * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.99 2014/02/23 22:35:27 dsl Exp $");
-
-#if defined(_KERNEL_OPT)
-#include "opt_vm86.h"
-#include "opt_user_ldt.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/namei.h>
-#include <sys/proc.h>
-#include <sys/exec.h>
-#include <sys/filedesc.h>
-#include <sys/ioctl.h>
-#include <sys/kernel.h>
-#include <sys/signal.h>
-#include <sys/signalvar.h>
-#include <sys/malloc.h>
-#include <sys/mount.h>
-#include <sys/syscallargs.h>
-#include <sys/exec_elf.h>
-
-#include <compat/svr4/svr4_types.h>
-#include <compat/svr4/svr4_lwp.h>
-#include <compat/svr4/svr4_ucontext.h>
-#include <compat/svr4/svr4_syscallargs.h>
-#include <compat/svr4/svr4_util.h>
-#include <compat/svr4/svr4_exec.h>
-
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
-#include <machine/psl.h>
-#include <machine/reg.h>
-#include <machine/specialreg.h>
-#include <machine/sysarch.h>
-#include <machine/vm86.h>
-#include <machine/vmparam.h>
-#include <machine/svr4_machdep.h>
-
-#include <x86/fpu.h>
-
-static void svr4_getsiginfo(union svr4_siginfo *, int, u_long, void *);
-extern void (*svr4_fasttrap_vec)(void);
-void svr4_fasttrap(struct trapframe);
-
-#ifdef DEBUG_SVR4
-static void svr4_printmcontext(const char *, svr4_mcontext_t *);
-
-
-static void
-svr4_printmcontext(const char *fun, svr4_mcontext_t *mc)
-{
- svr4_greg_t *r = mc->greg;
-
- uprintf("%s at %p\n", fun, mc);
-
- uprintf("Regs: ");
- uprintf("GS = 0x%x ", r[SVR4_X86_GS]);
- uprintf("FS = 0x%x ", r[SVR4_X86_FS]);
- uprintf("ES = 0x%x ", r[SVR4_X86_ES]);
- uprintf("DS = 0x%x ", r[SVR4_X86_DS]);
- uprintf("EDI = 0x%x ", r[SVR4_X86_EDI]);
- uprintf("ESI = 0x%x ", r[SVR4_X86_ESI]);
- uprintf("EBP = 0x%x ", r[SVR4_X86_EBP]);
- uprintf("ESP = 0x%x ", r[SVR4_X86_ESP]);
- uprintf("EBX = 0x%x ", r[SVR4_X86_EBX]);
- uprintf("EDX = 0x%x ", r[SVR4_X86_EDX]);
- uprintf("ECX = 0x%x ", r[SVR4_X86_ECX]);
- uprintf("EAX = 0x%x ", r[SVR4_X86_EAX]);
- uprintf("TRAPNO = 0x%x ", r[SVR4_X86_TRAPNO]);
- uprintf("ERR = 0x%x ", r[SVR4_X86_ERR]);
- uprintf("EIP = 0x%x ", r[SVR4_X86_EIP]);
- uprintf("CS = 0x%x ", r[SVR4_X86_CS]);
- uprintf("EFL = 0x%x ", r[SVR4_X86_EFL]);
- uprintf("UESP = 0x%x ", r[SVR4_X86_UESP]);
- uprintf("SS = 0x%x ", r[SVR4_X86_SS]);
- uprintf("\n");
-}
-#endif
-
-void
-svr4_setregs(struct lwp *l, struct exec_package *epp, vaddr_t stack)
-{
- struct trapframe *tf = l->l_md.md_regs;
-
- setregs(l, epp, stack);
- fpu_set_default_cw(l, __SVR4_NPXCW__);
-
- tf->tf_cs = GSEL(GUCODEBIG_SEL, SEL_UPL);
-}
-
-void *
-svr4_getmcontext(struct lwp *l, svr4_mcontext_t *mc, u_long *flags)
-{
- struct trapframe *tf = l->l_md.md_regs;
- svr4_greg_t *r = mc->greg;
-
- /* Save context. */
- tf = l->l_md.md_regs;
-#ifdef VM86
- if (tf->tf_eflags & PSL_VM) {
- r[SVR4_X86_GS] = tf->tf_vm86_gs;
- r[SVR4_X86_FS] = tf->tf_vm86_fs;
- r[SVR4_X86_ES] = tf->tf_vm86_es;
- r[SVR4_X86_DS] = tf->tf_vm86_ds;
- r[SVR4_X86_EFL] = get_vflags(l);
- } else
-#endif
- {
- r[SVR4_X86_GS] = tf->tf_gs;
- r[SVR4_X86_FS] = tf->tf_fs;
- r[SVR4_X86_ES] = tf->tf_es;
- r[SVR4_X86_DS] = tf->tf_ds;
- r[SVR4_X86_EFL] = tf->tf_eflags;
- }
- r[SVR4_X86_EDI] = tf->tf_edi;
- r[SVR4_X86_ESI] = tf->tf_esi;
- r[SVR4_X86_EBP] = tf->tf_ebp;
- r[SVR4_X86_ESP] = tf->tf_esp;
- r[SVR4_X86_EBX] = tf->tf_ebx;
- r[SVR4_X86_EDX] = tf->tf_edx;
- r[SVR4_X86_ECX] = tf->tf_ecx;
Home |
Main Index |
Thread Index |
Old Index