tech-kern archive

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

Re: Proposed change to makesyscalls.sh



 | My initial pass at this was to maintain the bit vector at run-time
 | rather than having makesyscalls.sh calculate the value.  The cost to
 | set the bits in syscall_establish() is not very large.

EIther way, but that makes the kernel fractionally bigger for no real
benefit - if it can be done at compile time, let it be.

Yeah, I knew that!

The attached patch calculates the bit vector at "regen" time.  So we
don't need to maintain the bit vector at run time, and we need only
test the bit vector in one place - syscall_disestablish().

 | The only drawback here is to add a new entry to struct emul to point
 | at the bit vector,

Sure.

 | and to initialize it in every place that the entrypoint array is
 | initialized.

Whenever e_sysent is set, so shall be the new one.  How many places
can there be?

About 20 of them!  :)  Each of the compat-<otherOS> modules has its own
struct emul.  The attached patch includes all of the required changes.

Note that after making these changes, we'll need to regenerate the
various syscall files for each emul.  The attachment also lists these
files.

 | FWIW, what would you suggest as the name of a new struct emul member
 | (in sys/proc.h)?

Naming ... not my strong suit...   e_sc_nomodbits  ?

I ended up using e_nomodbits[] but it would be quite simple to change
if anyone has a strong preference.

 | I'm beginning to think that this change really isn't worthwhile.

I'm still not totally sure if this change is worthwhile.  However, it
does resolve the issue in kern/45781, and it removes the need for the
work-around as currently implemented in

	src/sys/arch/usermode/modules/syscallemu/syscallemu.c

I really would appreciate feedback from others on whether or not this
change should be committed.


+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+
Index: arch/i386/i386/linux_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/linux_syscall.c,v
retrieving revision 1.53
diff -u -p -r1.53 linux_syscall.c
--- arch/i386/i386/linux_syscall.c	12 Aug 2017 07:21:57 -0000	1.53
+++ arch/i386/i386/linux_syscall.c	6 Aug 2018 12:02:16 -0000
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscal
 
 static void linux_syscall(struct trapframe *);
 extern struct sysent linux_sysent[];
+extern const uint32_t linux_sysent_nomodbits[];
 
 void
 linux_syscall_intern(struct proc *p)
Index: compat/aoutm68k/aoutm68k_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/aoutm68k/aoutm68k_exec.c,v
retrieving revision 1.29
diff -u -p -r1.29 aoutm68k_exec.c
--- compat/aoutm68k/aoutm68k_exec.c	6 May 2018 13:40:50 -0000	1.29
+++ compat/aoutm68k/aoutm68k_exec.c	6 Aug 2018 12:02:17 -0000
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: aoutm68k_exe
 #include <compat/aoutm68k/aoutm68k_syscall.h>
 
 extern struct sysent aoutm68k_sysent[];
+extern const uint32_t aoutm68k_sysent_nomodbits[];
 extern char sigcode[], esigcode[];
 void aoutm68k_syscall_intern(struct proc *);
 
@@ -64,6 +65,7 @@ struct emul emul_netbsd_aoutm68k = {
 	.e_nsysent =		AOUTM68K_SYS_NSYSENT,
 #endif
 	.e_sysent =		aoutm68k_sysent,
+	.e_nomodbits =		aoutm68k_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	syscallnames,
 #endif
Index: compat/freebsd/freebsd_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/freebsd/freebsd_exec.c,v
retrieving revision 1.41
diff -u -p -r1.41 freebsd_exec.c
--- compat/freebsd/freebsd_exec.c	6 May 2018 13:40:50 -0000	1.41
+++ compat/freebsd/freebsd_exec.c	6 Aug 2018 12:02:17 -0000
@@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_exec
 #include <compat/freebsd/freebsd_machdep.h>
 
 extern struct sysent freebsd_sysent[];
+extern const uint32_t freebsd_sysent_nomodbits[];
 extern const char * const freebsd_syscallnames[];
 
 struct uvm_object *emul_freebsd_object;
@@ -72,6 +73,7 @@ struct emul emul_freebsd = {
 	.e_nsysent =		FREEBSD_SYS_NSYSENT,
 #endif
 	.e_sysent =		freebsd_sysent,
+	.e_nomodbits =		freebsd_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	freebsd_syscallnames,
 #else
Index: compat/ibcs2/ibcs2_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/ibcs2/ibcs2_exec.c,v
retrieving revision 1.78
diff -u -p -r1.78 ibcs2_exec.c
--- compat/ibcs2/ibcs2_exec.c	6 May 2018 13:40:51 -0000	1.78
+++ compat/ibcs2/ibcs2_exec.c	6 Aug 2018 12:02:17 -0000
@@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c
 static void ibcs2_e_proc_exec(struct proc *, struct exec_package *);
 
 extern struct sysent ibcs2_sysent[];
+extern const uint32_t ibcs2_sysent_nomodbits[];
 extern const char * const ibcs2_syscallnames[];
 extern char ibcs2_sigcode[], ibcs2_esigcode[];
 #ifndef __HAVE_SYSCALL_INTERN
@@ -86,6 +87,7 @@ struct emul emul_ibcs2 = {
 	.e_nsysent =		IBCS2_SYS_NSYSENT,
 #endif
 	.e_sysent =		ibcs2_sysent,
+	.e_nomodbits =		ibcs2_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	ibcs2_syscallnames,
 #else
Index: compat/linux/common/linux_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_exec.c,v
retrieving revision 1.119
diff -u -p -r1.119 linux_exec.c
--- compat/linux/common/linux_exec.c	6 May 2018 13:40:51 -0000	1.119
+++ compat/linux/common/linux_exec.c	6 Aug 2018 12:02:17 -0000
@@ -70,6 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec.c
 #include <compat/linux/common/linux_emuldata.h>
 
 extern struct sysent linux_sysent[];
+extern const uint32_t linux_sysent_nomodbits[];
 extern const char * const linux_syscallnames[];
 extern char linux_sigcode[], linux_esigcode[];
 
@@ -89,6 +90,7 @@ struct emul emul_linux = {
 	.e_nsysent =		LINUX_SYS_NSYSENT,
 #endif
 	.e_sysent =		linux_sysent,
+	.e_nomodbits =		linux_sysent_nomodbits,
 	.e_syscallnames =	linux_syscallnames,
 	.e_sendsig =		linux_sendsig,
 	.e_trapsignal =		linux_trapsignal,
Index: compat/linux32/common/linux32_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux32/common/linux32_exec.c,v
retrieving revision 1.23
diff -u -p -r1.23 linux32_exec.c
--- compat/linux32/common/linux32_exec.c	6 May 2018 13:40:51 -0000	1.23
+++ compat/linux32/common/linux32_exec.c	6 Aug 2018 12:02:18 -0000
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_exec
 #include <compat/linux32/linux32_syscall.h>
 
 extern struct sysent linux32_sysent[];
+extern const uint32_t linux32_sysent_nomodbits[];
 extern const char * const linux32_syscallnames[];
 extern char linux32_sigcode[], linux32_esigcode[];
 
@@ -74,6 +75,7 @@ struct emul emul_linux32 = {
 	.e_nsysent =		LINUX32_SYS_NSYSENT,
 #endif
 	.e_sysent =		linux32_sysent,
+	.e_nomodbits =		linux32_sysent_nomodbits,
 	.e_syscallnames =	linux32_syscallnames,
 	.e_sendsig =		linux32_sendsig,
 	.e_trapsignal =		linux_trapsignal,
Index: compat/netbsd32/netbsd32_netbsd.c
===================================================================
RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_netbsd.c,v
retrieving revision 1.217
diff -u -p -r1.217 netbsd32_netbsd.c
--- compat/netbsd32/netbsd32_netbsd.c	31 Jul 2018 21:00:02 -0000	1.217
+++ compat/netbsd32/netbsd32_netbsd.c	6 Aug 2018 12:02:18 -0000
@@ -90,6 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net
 #endif
 
 extern struct sysent netbsd32_sysent[];
+extern const uint32_t netbsd32_sysent_nomodbits[];
 #ifdef SYSCALL_DEBUG
 extern const char * const netbsd32_syscallnames[];
 #endif
@@ -122,6 +123,7 @@ struct emul emul_netbsd32 = {
 	.e_nsysent =		NETBSD32_SYS_NSYSENT,
 #endif
 	.e_sysent =		netbsd32_sysent,
+	.e_nomodbits =		netbsd32_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	netbsd32_syscallnames,
 #else
Index: compat/osf1/osf1_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/osf1/osf1_exec.c,v
retrieving revision 1.46
diff -u -p -r1.46 osf1_exec.c
--- compat/osf1/osf1_exec.c	6 May 2018 13:40:51 -0000	1.46
+++ compat/osf1/osf1_exec.c	6 Aug 2018 12:02:18 -0000
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_exec.c,
 #include <compat/osf1/osf1_cvt.h>
 
 extern struct sysent osf1_sysent[];
+extern const uint32_t osf1_sysent_nomodbits[];
 extern const char * const osf1_syscallnames[];
 extern char osf1_sigcode[], osf1_esigcode[];
 #ifdef __HAVE_SYSCALL_INTERN
@@ -70,6 +71,7 @@ struct emul emul_osf1 = {
 	.e_nsysent =		OSF1_SYS_NSYSENT,
 #endif
 	.e_sysent =		osf1_sysent,
+	.e_nomodbits =		osf1_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	osf1_syscallnames,
 #else
Index: compat/sunos/sunos_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/sunos/sunos_exec.c,v
retrieving revision 1.56
diff -u -p -r1.56 sunos_exec.c
--- compat/sunos/sunos_exec.c	6 May 2018 13:40:51 -0000	1.56
+++ compat/sunos/sunos_exec.c	6 Aug 2018 12:02:18 -0000
@@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunos_exec.c
 
 extern int nsunos_sysent;
 extern struct sysent sunos_sysent[];
+extern const uint32_t sunos_sysent_nomodbits[];
 #ifdef SYSCALL_DEBUG
 extern const char * const sunos_syscallnames[];
 #endif
@@ -72,6 +73,7 @@ struct emul emul_sunos = {
 	.e_nsysent =		SUNOS_SYS_NSYSENT,
 #endif
 	.e_sysent =		sunos_sysent,
+	.e_nomodbits =		sunos_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	sunos_syscallnames,
 #else
Index: compat/sunos32/sunos32_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/sunos32/sunos32_exec.c,v
retrieving revision 1.35
diff -u -p -r1.35 sunos32_exec.c
--- compat/sunos32/sunos32_exec.c	6 May 2018 13:40:51 -0000	1.35
+++ compat/sunos32/sunos32_exec.c	6 Aug 2018 12:02:18 -0000
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_exec
 
 extern int nsunos32_sysent;
 extern struct sysent sunos32_sysent[];
+extern const uint32_t sunos32_sysent_nomodbits[];
 #ifdef SYSCALL_DEBUG
 extern const char * const sunos32_syscallnames[];
 #endif
@@ -71,6 +72,7 @@ struct emul emul_sunos = {
 	.e_nsysent =		SUNOS32_SYS_NSYSENT,
 #endif
 	.e_sysent =		sunos32_sysent,
+	.e_nomodbits =		sunos32_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	sunos32_syscallnames,
 #else
Index: compat/svr4/svr4_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/svr4/svr4_exec.c,v
retrieving revision 1.68
diff -u -p -r1.68 svr4_exec.c
--- compat/svr4/svr4_exec.c	6 May 2018 13:40:51 -0000	1.68
+++ compat/svr4/svr4_exec.c	6 Aug 2018 12:02:18 -0000
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_exec.c,
 
 extern char svr4_sigcode[], svr4_esigcode[];
 extern struct sysent svr4_sysent[];
+extern const uint32_t svr4_sysent_nomodbits[];
 extern const char * const svr4_syscallnames[];
 #ifndef __HAVE_SYSCALL_INTERN
 void syscall(void);
@@ -70,6 +71,7 @@ struct emul emul_svr4 = {
 	.e_nsysent =		SVR4_SYS_NSYSENT,
 #endif
 	.e_sysent =		svr4_sysent,
+	.e_nomodbits =		svr4_systent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	svr4_syscallnames,
 #else
Index: compat/svr4_32/svr4_32_exec.c
===================================================================
RCS file: /cvsroot/src/sys/compat/svr4_32/svr4_32_exec.c,v
retrieving revision 1.29
diff -u -p -r1.29 svr4_32_exec.c
--- compat/svr4_32/svr4_32_exec.c	6 May 2018 13:40:51 -0000	1.29
+++ compat/svr4_32/svr4_32_exec.c	6 Aug 2018 12:02:18 -0000
@@ -56,6 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_exec
 
 extern char svr4_32_sigcode[], svr4_32_esigcode[];
 extern struct sysent svr4_32_sysent[];
+extern const uint32_t svr4_32_sysent_nomodbits[];
 extern const char * const svr4_32_syscallnames[];
 #ifndef __HAVE_SYSCALL_INTERN
 void syscall(void);
@@ -73,6 +74,7 @@ struct emul emul_svr4_32 = {
 	.e_nsysent =		SVR4_32_SYS_NSYSENT,
 #endif
 	.e_sysent =		svr4_32_sysent,
+	.e_nomodbits =		svr4_32_systent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	svr4_32_syscallnames,
 #else
Index: compat/ultrix/ultrix_misc.c
===================================================================
RCS file: /cvsroot/src/sys/compat/ultrix/ultrix_misc.c,v
retrieving revision 1.124
diff -u -p -r1.124 ultrix_misc.c
--- compat/ultrix/ultrix_misc.c	6 May 2018 13:40:51 -0000	1.124
+++ compat/ultrix/ultrix_misc.c	6 Aug 2018 12:02:18 -0000
@@ -149,6 +149,7 @@ static int ultrix_to_bsd_flock(struct ul
 static void bsd_to_ultrix_flock(struct flock *, struct ultrix_flock *);
 
 extern struct sysent ultrix_sysent[];
+extern const uint32_t ultrix_sysent_nomodbits[];
 extern const char * const ultrix_syscallnames[];
 extern char ultrix_sigcode[], ultrix_esigcode[];
 
@@ -168,6 +169,7 @@ struct emul emul_ultrix = {
 	.e_nsysent =		ULTRIX_SYS_NSYSENT,
 #endif
 	.e_sysent =		ultrix_sysent,
+	.e_nomodbits =		ultrix_sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	ultrix_syscallnames,
 #else
Index: kern/kern_exec.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_exec.c,v
retrieving revision 1.459
diff -u -p -r1.459 kern_exec.c
--- kern/kern_exec.c	28 May 2018 11:32:20 -0000	1.459
+++ kern/kern_exec.c	6 Aug 2018 12:02:18 -0000
@@ -209,6 +209,7 @@ struct emul emul_netbsd = {
 	.e_sc_autoload =	netbsd_syscalls_autoload,
 #endif
 	.e_sysent =		sysent,
+	.e_nomodbits =		sysent_nomodbits,
 #ifdef SYSCALL_DEBUG
 	.e_syscallnames =	syscallnames,
 #else
Index: kern/kern_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_syscall.c,v
retrieving revision 1.16
diff -u -p -r1.16 kern_syscall.c
--- kern/kern_syscall.c	24 Mar 2017 17:40:44 -0000	1.16
+++ kern/kern_syscall.c	6 Aug 2018 12:02:18 -0000
@@ -123,7 +123,10 @@ syscall_establish(const struct emul *em,
 	 * on error.
 	 */
 	for (i = 0; sp[i].sp_call != NULL; i++) {
-		if (sy[sp[i].sp_code].sy_call != sys_nomodule) {
+		if (sp[i].sp_code >= SYS_NSYSENT)
+			return EINVAL;
+		if (sy[sp[i].sp_code].sy_call != sys_nomodule &&
+		    sy[sp[i].sp_code].sy_call != sys_nosys) {
 #ifdef DIAGNOSTIC
 			printf("syscall %d is busy\n", sp[i].sp_code);
 #endif
@@ -142,6 +145,7 @@ int
 syscall_disestablish(const struct emul *em, const struct syscall_package *sp)
 {
 	struct sysent *sy;
+	const uint32_t *sb;
 	uint64_t where;
 	lwp_t *l;
 	int i;
@@ -152,14 +156,17 @@ syscall_disestablish(const struct emul *
 		em = &emul_netbsd;
 	}
 	sy = em->e_sysent;
+	sb = em->e_nomodbits;
 
 	/*
-	 * First, patch the system calls to sys_nomodule to gate further
-	 * activity.
+	 * First, patch the system calls to sys_nomodule or sys_nosys
+	 * to gate further activity.
 	 */
 	for (i = 0; sp[i].sp_call != NULL; i++) {
 		KASSERT(sy[sp[i].sp_code].sy_call == sp[i].sp_call);
-		sy[sp[i].sp_code].sy_call = sys_nomodule;
+		sy[sp[i].sp_code].sy_call =
+		    sb[sp[i].sp_code / 32] & (1 << (sp[i].sp_code % 32)) ?
+		      sys_nomodule : sys_nosys;
 	}
 
 	/*
Index: kern/makesyscalls.sh
===================================================================
RCS file: /cvsroot/src/sys/kern/makesyscalls.sh,v
retrieving revision 1.169
diff -u -p -r1.169 makesyscalls.sh
--- kern/makesyscalls.sh	10 May 2017 06:08:56 -0000	1.169
+++ kern/makesyscalls.sh	6 Aug 2018 12:02:18 -0000
@@ -391,6 +391,10 @@ NR == 1 {
 	uncompattypes["struct timespec50"] = "struct timespec";
 	uncompattypes["struct stat30"] = "struct stat";
 
+	# initialize the nomodbits[] array
+	for (i = 0; i < int(nsysent); i += 32) {
+		nomodbits[i / 32] = 0
+	}
 	next
 }
 NF == 0 || $1 ~ /^;/ {
@@ -855,9 +859,12 @@ function putent(type, compatwrap) {
 	if (argc != 0) {
 		printf("\n\t\tns(struct %s%s_args),", compatwrap_, funcname) > sysent
 	}
-	if (modular) 
+	if (modular) {
 		wfn = "sys_nomodule";
-	else if (compatwrap == "")
+		idx = syscall / 32;
+		bit = 2 ** (syscall % 32);
+		nomodbits[ int(syscall / 32) ] += 2 ** (syscall % 32);
+	} else if (compatwrap == "")
 		wfn = funcname;
 	else
 		wfn = compatwrap "(" funcname ")";
@@ -1142,6 +1149,16 @@ END {
 		}
 	}
 	printf("};\n") > sysent
+	printf("\nconst uint32_t %s_nomodbits[] = {\n", switchname) > sysent
+	printf("};\n") > rumpsysent
+	printf("\nconst uint32_t rump_sysent_nomodbits[] = {\n") > rumpsysent
+	for (i = 0; i < int(nsysent); i += 32) {
+		printf("\t0x%08x,\t /* syscalls %3d-%3d */\n",
+			nomodbits[i / 32], i, i + 31) > sysent
+		printf("\t0x%08x,\t /* syscalls %3d-%3d */\n",
+			nomodbits[i / 32], i, i + 31) > rumpsysent
+	}
+	printf("};\n") > sysent
 	printf("};\n") > rumpsysent
 	printf("CTASSERT(__arraycount(rump_sysent) == SYS_NSYSENT);\n") > rumpsysent
 	printf("__strong_alias(rumpns_sysent,rump_sysent);\n") > rumpsysent
Index: rump/include/rump-sys/kern.h
===================================================================
RCS file: /cvsroot/src/sys/rump/include/rump-sys/kern.h,v
retrieving revision 1.3
diff -u -p -r1.3 kern.h
--- rump/include/rump-sys/kern.h	8 Feb 2016 18:18:19 -0000	1.3
+++ rump/include/rump-sys/kern.h	6 Aug 2018 12:02:18 -0000
@@ -51,6 +51,7 @@ extern int rump_threads;
 extern struct device rump_rootdev;
 
 extern struct sysent rump_sysent[];
+extern const uint32_t rump_sysent_nomodbits[];
 
 enum rump_component_type {
 	RUMP_COMPONENT_DEV,
Index: rump/kern/lib/libsys_cygwin/sys_cygwin_component.c
===================================================================
RCS file: /cvsroot/src/sys/rump/kern/lib/libsys_cygwin/sys_cygwin_component.c,v
retrieving revision 1.2
diff -u -p -r1.2 sys_cygwin_component.c
--- rump/kern/lib/libsys_cygwin/sys_cygwin_component.c	26 Jan 2016 23:12:17 -0000	1.2
+++ rump/kern/lib/libsys_cygwin/sys_cygwin_component.c	6 Aug 2018 12:02:18 -0000
@@ -10,10 +10,12 @@
 #include "rump_cygwin_syscall.h"
 
 extern struct sysent rump_cygwin_sysent[];
+extern const uint32_t rump_cygwin_sysent_nomodbits[];
 
 struct emul emul_rump_sys_cygwin = {
 	.e_name = "cygwin-rump",
 	.e_sysent = rump_cygwin_sysent,
+	.e_nomodbits = rump_cygwin_sysent_nomodbits,
 #ifndef __HAVE_MINIMAL_EMUL
 	.e_nsysent = RUMP_CYGWIN_SYS_NSYSENT,
 #endif
Index: rump/kern/lib/libsys_linux/sys_linux_component.c
===================================================================
RCS file: /cvsroot/src/sys/rump/kern/lib/libsys_linux/sys_linux_component.c,v
retrieving revision 1.3
diff -u -p -r1.3 sys_linux_component.c
--- rump/kern/lib/libsys_linux/sys_linux_component.c	26 Jan 2016 23:12:17 -0000	1.3
+++ rump/kern/lib/libsys_linux/sys_linux_component.c	6 Aug 2018 12:02:18 -0000
@@ -12,6 +12,7 @@
 #include "rump_linux_syscall.h"
 
 extern struct sysent rump_linux_sysent[];
+extern const uint32_t rump_linux_sysent_nomodbits[];
 
 #ifdef __HAVE_SYSCALL_INTERN
 static void
@@ -25,6 +26,7 @@ rumplinux_syscall_intern(struct proc *p)
 struct emul emul_rump_sys_linux = {
 	.e_name = "linux-rump",
 	.e_sysent = rump_linux_sysent,
+	.e_nomodbits = rump_linux_sysent_nomodbits,
 #ifndef __HAVE_MINIMAL_EMUL
 	.e_nsysent = RUMP_LINUX_SYS_NSYSENT,
 	.e_errno = native_to_linux_errno,
Index: rump/kern/lib/libsys_sunos/sys_sunos_component.c
===================================================================
RCS file: /cvsroot/src/sys/rump/kern/lib/libsys_sunos/sys_sunos_component.c,v
retrieving revision 1.2
diff -u -p -r1.2 sys_sunos_component.c
--- rump/kern/lib/libsys_sunos/sys_sunos_component.c	26 Jan 2016 23:12:17 -0000	1.2
+++ rump/kern/lib/libsys_sunos/sys_sunos_component.c	6 Aug 2018 12:02:18 -0000
@@ -10,10 +10,12 @@
 #include "rump_sunos_syscall.h"
 
 extern struct sysent rump_sunos_sysent[];
+extern const uint32_t rump_sunos_sysent_nomodbits[];
 
 struct emul emul_rump_sys_sunos = {
 	.e_name = "sunos-rump",
 	.e_sysent = rump_sunos_sysent,
+	.e_nomodbits = rump_sunos_sysent_nomodbits,
 #ifndef __HAVE_MINIMAL_EMUL
 	.e_nsysent = RUMP_SUNOS_SYS_NSYSENT,
 #endif
Index: rump/librump/rumpkern/emul.c
===================================================================
RCS file: /cvsroot/src/sys/rump/librump/rumpkern/emul.c,v
retrieving revision 1.185
diff -u -p -r1.185 emul.c
--- rump/librump/rumpkern/emul.c	21 Nov 2017 15:22:06 -0000	1.185
+++ rump/librump/rumpkern/emul.c	6 Aug 2018 12:02:18 -0000
@@ -119,6 +119,7 @@ struct loadavg averunnable = {
 struct emul emul_netbsd = {
 	.e_name = "netbsd-rump",
 	.e_sysent = rump_sysent,
+	.e_nomodbits = rump_sysent_nomodbits,
 #ifndef __HAVE_MINIMAL_EMUL
 	.e_nsysent = SYS_NSYSENT,
 #endif
Index: sys/proc.h
===================================================================
RCS file: /cvsroot/src/sys/sys/proc.h,v
retrieving revision 1.348
diff -u -p -r1.348 proc.h
--- sys/proc.h	9 May 2018 19:55:35 -0000	1.348
+++ sys/proc.h	6 Aug 2018 12:02:18 -0000
@@ -150,6 +150,8 @@ struct emul {
 	int		e_nsysent;	/* Number of system call entries */
 #endif
 	struct sysent	*e_sysent;	/* System call array */
+	const uint32_t	*e_nomodbits;	/* sys_nosys/sys_nomodule flags
+					 * for syscall_disestablish() */
 	const char * const *e_syscallnames; /* System call name array */
 					/* Signal sending function */
 	struct sc_autoload *e_sc_autoload;	/* List of autoloadable syscalls */
Index: sys/systm.h
===================================================================
RCS file: /cvsroot/src/sys/sys/systm.h,v
retrieving revision 1.276
diff -u -p -r1.276 systm.h
--- sys/systm.h	28 May 2018 21:04:41 -0000	1.276
+++ sys/systm.h	6 Aug 2018 12:02:18 -0000
@@ -127,6 +127,7 @@ extern struct sysent {		/* system call t
 	uint32_t sy_return;	/* DTrace return ID for systrace. */
 } sysent[];
 extern int nsysent;
+extern const uint32_t sysent_nomodbits[];
 #endif
 
 #if	BYTE_ORDER == BIG_ENDIAN


The following files need to be regenerated (by running makesyscalls.sh
with appropriate arguments) AFTER the above changes are committed.

Regen: compat/aoutm68k/aoutm68k_syscall.h
Regen: compat/aoutm68k/aoutm68k_syscallargs.h
Regen: compat/aoutm68k/aoutm68k_syscalls.c
Regen: compat/aoutm68k/aoutm68k_sysent.c
Regen: compat/freebsd/freebsd_syscall.h
Regen: compat/freebsd/freebsd_syscallargs.h
Regen: compat/freebsd/freebsd_syscalls.c
Regen: compat/freebsd/freebsd_sysent.c
Regen: compat/ibcs2/ibcs2_syscall.h
Regen: compat/ibcs2/ibcs2_syscallargs.h
Regen: compat/ibcs2/ibcs2_syscalls.c
Regen: compat/ibcs2/ibcs2_sysent.c
Regen: compat/linux/arch/alpha/linux_syscall.h
Regen: compat/linux/arch/alpha/linux_syscallargs.h
Regen: compat/linux/arch/alpha/linux_syscalls.c
Regen: compat/linux/arch/alpha/linux_sysent.c
Regen: compat/linux/arch/amd64/linux_syscall.h
Regen: compat/linux/arch/amd64/linux_syscallargs.h
Regen: compat/linux/arch/amd64/linux_syscalls.c
Regen: compat/linux/arch/amd64/linux_sysent.c
Regen: compat/linux/arch/amd64/linux_systrace_args.c
Regen: compat/linux/arch/arm/linux_syscall.h
Regen: compat/linux/arch/arm/linux_syscallargs.h
Regen: compat/linux/arch/arm/linux_syscalls.c
Regen: compat/linux/arch/arm/linux_sysent.c
Regen: compat/linux/arch/arm/linux_systrace_args.c
Regen: compat/linux/arch/i386/linux_syscall.h
Regen: compat/linux/arch/i386/linux_syscallargs.h
Regen: compat/linux/arch/i386/linux_syscalls.c
Regen: compat/linux/arch/i386/linux_sysent.c
Regen: compat/linux/arch/i386/linux_systrace_args.c
Regen: compat/linux/arch/m68k/linux_syscall.h
Regen: compat/linux/arch/m68k/linux_syscallargs.h
Regen: compat/linux/arch/m68k/linux_syscalls.c
Regen: compat/linux/arch/m68k/linux_sysent.c
Regen: compat/linux/arch/mips/linux_syscall.h
Regen: compat/linux/arch/mips/linux_syscallargs.h
Regen: compat/linux/arch/mips/linux_syscalls.c
Regen: compat/linux/arch/mips/linux_sysent.c
Regen: compat/linux/arch/powerpc/linux_syscall.h
Regen: compat/linux/arch/powerpc/linux_syscallargs.h
Regen: compat/linux/arch/powerpc/linux_syscalls.c
Regen: compat/linux/arch/powerpc/linux_sysent.c
Regen: compat/linux32/arch/amd64/linux32_syscall.h
Regen: compat/linux32/arch/amd64/linux32_syscallargs.h
Regen: compat/linux32/arch/amd64/linux32_syscalls.c
Regen: compat/linux32/arch/amd64/linux32_sysent.c
Regen: compat/linux32/arch/amd64/linux32_systrace_args.c
Regen: compat/netbsd32/netbsd32_syscall.h
Regen: compat/netbsd32/netbsd32_syscallargs.h
Regen: compat/netbsd32/netbsd32_syscalls.c
Regen: compat/netbsd32/netbsd32_syscalls_autoload.c
Regen: compat/netbsd32/netbsd32_sysent.c
Regen: compat/netbsd32/netbsd32_systrace_args.c
Regen: compat/osf1/osf1_syscall.h
Regen: compat/osf1/osf1_syscallargs.h
Regen: compat/osf1/osf1_syscalls.c
Regen: compat/osf1/osf1_sysent.c
Regen: compat/sunos/sunos_syscall.h
Regen: compat/sunos/sunos_syscallargs.h
Regen: compat/sunos/sunos_syscalls.c
Regen: compat/sunos/sunos_sysent.c
Regen: compat/sunos32/sunos32_syscall.h
Regen: compat/sunos32/sunos32_syscallargs.h
Regen: compat/sunos32/sunos32_syscalls.c
Regen: compat/sunos32/sunos32_sysent.c
Regen: compat/svr4/svr4_syscall.h
Regen: compat/svr4/svr4_syscallargs.h
Regen: compat/svr4/svr4_syscalls.c
Regen: compat/svr4/svr4_sysent.c
Regen: compat/svr4_32/svr4_32_syscall.h
Regen: compat/svr4_32/svr4_32_syscallargs.h
Regen: compat/svr4_32/svr4_32_syscalls.c
Regen: compat/svr4_32/svr4_32_sysent.c
Regen: compat/ultrix/ultrix_syscall.h
Regen: compat/ultrix/ultrix_syscallargs.h
Regen: compat/ultrix/ultrix_syscalls.c
Regen: compat/ultrix/ultrix_sysent.c
Regen: kern/init_sysent.c
Regen: kern/syscalls.c
Regen: kern/syscalls_autoload.c
Regen: kern/systrace_args.c
Regen: rump/rump.sysmap
Regen: rump/include/rump/rump_syscalls.h
Regen: rump/librump/rumpkern/rump_syscalls.c
Regen: sys/syscall.h
Regen: sys/syscallargs.h


Home | Main Index | Thread Index | Old Index