Module Name:    src
Committed By:   maxv
Date:           Sat Jul 29 11:54:14 UTC 2017

Modified Files:
        src/sys/arch/i386/conf: files.i386
        src/sys/arch/i386/i386: locore.S machdep.c
        src/sys/arch/xen/conf: files.xen
Removed Files:
        src/sys/arch/i386/i386: svr4_machdep.c svr4_sigcode.S svr4_syscall.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.786 -r1.787 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.99 -r0 src/sys/arch/i386/i386/svr4_machdep.c
cvs rdiff -u -r1.13 -r0 src/sys/arch/i386/i386/svr4_sigcode.S
cvs rdiff -u -r1.48 -r0 src/sys/arch/i386/i386/svr4_syscall.c
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/xen/conf/files.xen

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/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.380 src/sys/arch/i386/conf/files.i386:1.381
--- src/sys/arch/i386/conf/files.i386:1.380	Sat Jul 29 06:29:31 2017
+++ src/sys/arch/i386/conf/files.i386	Sat Jul 29 11:54:14 2017
@@ -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 @@ file	arch/i386/i386/compat_16_machdep.c	
 
 # 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"

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.147 src/sys/arch/i386/i386/locore.S:1.148
--- src/sys/arch/i386/i386/locore.S:1.147	Sat Jul 29 06:29:31 2017
+++ src/sys/arch/i386/i386/locore.S	Sat Jul 29 11:54:14 2017
@@ -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 @@ IDTVEC(syscall)
 	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.

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.786 src/sys/arch/i386/i386/machdep.c:1.787
--- src/sys/arch/i386/i386/machdep.c:1.786	Sat Jul 29 06:29:32 2017
+++ src/sys/arch/i386/i386/machdep.c	Sat Jul 29 11:54:14 2017
@@ -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 @@ setsegment(struct segment_descriptor *sd
 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 @@ init386(paddr_t first_avail)
 	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(&region, gdtstore, NGDT * sizeof(gdtstore[0]) - 1);
 	lgdt(&region);
@@ -1336,11 +1329,6 @@ init386(paddr_t first_avail)
 	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 @@ init386(paddr_t first_avail)
 		cngetc();
 	}
 
-	rw_init(&svr4_fasttrap_lock);
-
 	pcb->pcb_dbregs = NULL;
 
 	x86_dbregs_setup_initdbstate();

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.149 src/sys/arch/xen/conf/files.xen:1.150
--- src/sys/arch/xen/conf/files.xen:1.149	Sun Jul 16 14:02:48 2017
+++ src/sys/arch/xen/conf/files.xen	Sat Jul 29 11:54:14 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.149 2017/07/16 14:02:48 cherry Exp $
+#	$NetBSD: files.xen,v 1.150 2017/07/29 11:54:14 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -321,9 +321,6 @@ file	arch/i386/i386/compat_16_machdep.c	
 
 # 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"

Reply via email to