tech-kern archive

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

Proposed change to makesyscalls.sh



I'd like to propose the following change to makesyscalls.sh to enable
specifying a sys-call which _can_ be provided by a module, but only if
the module is manually loaded.  For these sys-calls, no entry is made
in the autoload list, so the module will not be autoloaded.

The primary usage for this is for arch/usermode's syscallemu() which
(according to those working on arch/usermode) could be considered
"dangerous" and "should never be autoloaded.  Having this change will
allow use of a "registered" syscall number rather than having to have
a work-around for PR kern/45781.

Side note: the existing work-around is incomplete, as it does not
correctly restore the unregistered syscall's entry to sys_nomodule()
after the module's MODCMD_FINI routine calls syscall_disestablish().

Comments?


Index: syscalls.master
===================================================================
RCS file: /cvsroot/src/sys/kern/syscalls.master,v
retrieving revision 1.293
diff -u -p -r1.293 syscalls.master
--- syscalls.master	31 Jul 2018 13:00:13 -0000	1.293
+++ syscalls.master	4 Aug 2018 22:23:51 -0000
@@ -13,6 +13,7 @@
 ; Optional fields are specified after the type field
 ; (NOTE! they *must* be specified in this order):
 ;	MODULAR modname :attempt to autoload system call module if not present
+;    or	MODULAR NONE    :optional system call which must be manually loaded
 ;	RUMP:	generate rump syscall entry point
 ;
 ; types:
Index: makesyscalls.sh
===================================================================
RCS file: /cvsroot/src/sys/kern/makesyscalls.sh,v
retrieving revision 1.169
diff -u -p -r1.169 makesyscalls.sh
--- makesyscalls.sh	10 May 2017 06:08:56 -0000	1.169
+++ makesyscalls.sh	4 Aug 2018 22:23:51 -0000
@@ -694,12 +694,13 @@ function printproto(wrap) {
 	    syscall) > sysnumhdr

 	# output entry for syscall autoload table, if modular
-	if (modular ) {
-		printf("\t    { %s%s%s, \"%s\" },\n", constprefix, wrap,
-		    funcalias, modname) > sysautoload
+	if (modular) {
+		if (modname != "NONE") {
+			printf("\t    { %s%s%s, \"%s\" },\n", constprefix,
+			    wrap, funcalias, modname) > sysautoload
+		}
 	}

-
 	# rumpalooza
 	if (!rumpable)
 		return


+------------------+--------------------------+----------------------------+
| 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 |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index