Hi,

The attached patch makes sysproxy a separate component instead of it always being embedded in librump. Two issues are addressed:

1) librumpuser no longer needs to provide stubs for the sysproxy hypercalls in case sysproxy is never used on said platform 2) it becomes easy to ensure that remote system calls are not possible in a given configuration

Old binaries using sysproxy will now fail to link due to a missing rump_init_server(). This is by design so that you get an explicit compile-time failure instead of a "huh it just stopped working" runtime failure. There are just a handful of cases on repo.rumpkernel.org, I'll fix them:
http://nxr.netbsd.org/search?q=&project=src-rumpkernel&defs=&refs=rump_init_server&path=&hist=

Part two of the patch will move the sysproxy hypercalls from the rumpuser interface to the sysproxy component (*), but that's not done yet, and won't cause a flag day like the proposed change.

thoughts?

*) the reason they are in rumpuser in the first place is that component private hypercalls were invented after sysproxy
Index: sys/rump/kern/Makefile.rumpkerncomp
===================================================================
RCS file: /cvsroot/src/sys/rump/kern/Makefile.rumpkerncomp,v
retrieving revision 1.10
diff -u -r1.10 Makefile.rumpkerncomp
--- sys/rump/kern/Makefile.rumpkerncomp	2 Apr 2014 19:37:17 -0000	1.10
+++ sys/rump/kern/Makefile.rumpkerncomp	5 Jan 2015 19:54:21 -0000
@@ -3,7 +3,7 @@
 
 .include <bsd.own.mk>
 
-RUMPKERNCOMPS=	crypto tty z
+RUMPKERNCOMPS=	crypto sysproxy tty z
 
 .if ${MKSLJIT} != "no"
 RUMPKERNCOMPS+=	sljit
Index: sys/rump/kern/lib/libsysproxy/Makefile
===================================================================
RCS file: sys/rump/kern/lib/libsysproxy/Makefile
diff -N sys/rump/kern/lib/libsysproxy/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sys/rump/kern/lib/libsysproxy/Makefile	5 Jan 2015 19:54:21 -0000
@@ -0,0 +1,11 @@
+#	$NetBSD$
+#
+
+LIB=	rumpkern_sysproxy
+
+SRCS=	sysproxy.c
+
+CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
Index: sys/rump/kern/lib/libsysproxy/sysproxy.c
===================================================================
RCS file: sys/rump/kern/lib/libsysproxy/sysproxy.c
diff -N sys/rump/kern/lib/libsysproxy/sysproxy.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sys/rump/kern/lib/libsysproxy/sysproxy.c	5 Jan 2015 19:54:21 -0000
@@ -0,0 +1,212 @@
+/*	$NetBSD: sysproxy.c,v 1.1 2015/01/03 17:23:51 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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: sysproxy.c,v 1.1 2015/01/03 17:23:51 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/filedesc.h>
+#include <sys/kmem.h>
+#include <sys/syscall.h>
+#include <sys/syscallvar.h>
+#include <sys/systm.h>
+#include <sys/xcall.h>
+
+#define _RUMP_SYSPROXY
+#include <rump/rumpuser.h>
+
+#include "rump_private.h"
+
+int
+rump_init_server(const char *url)
+{
+
+	return rumpuser_sp_init(url, ostype, osrelease, MACHINE);
+}
+
+static pid_t
+hyp_getpid(void)
+{
+
+	return curproc->p_pid;
+}
+
+static int
+hyp_syscall(int num, void *arg, long *retval)
+{
+	register_t regrv[2] = {0, 0};
+	struct lwp *l;
+	struct sysent *callp;
+	int rv;
+
+	if (__predict_false(num >= SYS_NSYSENT))
+		return ENOSYS;
+
+	/* XXX: always uses native syscall vector */
+	callp = rump_sysent + num;
+	l = curlwp;
+	rv = sy_invoke(callp, l, (void *)arg, regrv, num);
+	retval[0] = regrv[0];
+	retval[1] = regrv[1];
+
+	return rv;
+}
+
+static int
+hyp_rfork(void *priv, int flags, const char *comm)
+{
+	struct vmspace *newspace;
+	struct proc *p;
+	struct lwp *l;
+	int error;
+	bool initfds;
+
+	/*
+	 * If we are forking off of pid 1, initialize file descriptors.
+	 */
+	l = curlwp;
+	if (l->l_proc->p_pid == 1) {
+		KASSERT(flags == RUMP_RFFD_CLEAR);
+		initfds = true;
+	} else {
+		initfds = false;
+	}
+
+	if ((error = rump_lwproc_rfork(flags)) != 0)
+		return error;
+
+	/*
+	 * We forked in this routine, so cannot use curlwp (const)
+	 */
+	l = rump_lwproc_curlwp();
+	p = l->l_proc;
+
+	/*
+	 * Since it's a proxy proc, adjust the vmspace.
+	 * Refcount will eternally be 1.
+	 */
+	newspace = kmem_zalloc(sizeof(*newspace), KM_SLEEP);
+	newspace->vm_refcnt = 1;
+	newspace->vm_map.pmap = priv;
+	KASSERT(p->p_vmspace == vmspace_kernel());
+	p->p_vmspace = newspace;
+	if (comm)
+		strlcpy(p->p_comm, comm, sizeof(p->p_comm));
+	if (initfds)
+		rump_consdev_init();
+
+	return 0;
+}
+
+/*
+ * Order all lwps in a process to exit.  does *not* wait for them to drain.
+ */
+static void
+hyp_lwpexit(void)
+{
+	struct proc *p = curproc;
+	uint64_t where;
+	struct lwp *l;
+
+	mutex_enter(p->p_lock);
+	/*
+	 * First pass: mark all lwps in the process with LW_RUMP_QEXIT
+	 * so that they know they should exit.
+	 */
+	LIST_FOREACH(l, &p->p_lwps, l_sibling) {
+		if (l == curlwp)
+			continue;
+		l->l_flag |= LW_RUMP_QEXIT;
+	}
+	mutex_exit(p->p_lock);
+
+	/*
+	 * Next, make sure everyone on all CPUs sees our status
+	 * update.  This keeps threads inside cv_wait() and makes
+	 * sure we don't access a stale cv pointer later when
+	 * we wake up the threads.
+	 */
+
+	where = xc_broadcast(0, (xcfunc_t)nullop, NULL, NULL);
+	xc_wait(where);
+
+	/*
+	 * Ok, all lwps are either:
+	 *  1) not in the cv code
+	 *  2) sleeping on l->l_private
+	 *  3) sleeping on p->p_waitcv
+	 *
+	 * Either way, l_private is stable until we set PS_RUMP_LWPEXIT
+	 * in p->p_sflag.
+	 */
+
+	mutex_enter(p->p_lock);
+	LIST_FOREACH(l, &p->p_lwps, l_sibling) {
+		if (l->l_private)
+			cv_broadcast(l->l_private);
+	}
+	p->p_sflag |= PS_RUMP_LWPEXIT;
+	cv_broadcast(&p->p_waitcv);
+	mutex_exit(p->p_lock);
+}
+
+/*
+ * Notify process that all threads have been drained and exec is complete.
+ */
+static void
+hyp_execnotify(const char *comm)
+{
+	struct proc *p = curproc;
+
+	fd_closeexec();
+	mutex_enter(p->p_lock);
+	KASSERT(p->p_nlwps == 1 && p->p_sflag & PS_RUMP_LWPEXIT);
+	p->p_sflag &= ~PS_RUMP_LWPEXIT;
+	mutex_exit(p->p_lock);
+	strlcpy(p->p_comm, comm, sizeof(p->p_comm));
+}
+
+/*
+ * Initialize interface pointers since component is present.
+ */
+RUMP_COMPONENT(RUMP_COMPONENT_KERN)
+{
+
+	rump_sysproxy_ops.rspo_copyin		= rumpuser_sp_copyin;
+	rump_sysproxy_ops.rspo_copyinstr	= rumpuser_sp_copyinstr;
+	rump_sysproxy_ops.rspo_copyout		= rumpuser_sp_copyout;
+	rump_sysproxy_ops.rspo_copyoutstr	= rumpuser_sp_copyoutstr;
+	rump_sysproxy_ops.rspo_anonmmap		= rumpuser_sp_anonmmap;
+	rump_sysproxy_ops.rspo_raise		= rumpuser_sp_raise;
+	rump_sysproxy_ops.rspo_fini		= rumpuser_sp_fini;
+
+	rump_sysproxy_ops.rspo_hyp_getpid	= hyp_getpid;
+	rump_sysproxy_ops.rspo_hyp_syscall	= hyp_syscall;
+	rump_sysproxy_ops.rspo_hyp_rfork	= hyp_rfork;
+	rump_sysproxy_ops.rspo_hyp_lwpexit	= hyp_lwpexit;
+	rump_sysproxy_ops.rspo_hyp_execnotify	= hyp_execnotify;
+}
Index: sys/rump/librump/rumpkern/Makefile.rumpkern
===================================================================
RCS file: /cvsroot/src/sys/rump/librump/rumpkern/Makefile.rumpkern,v
retrieving revision 1.152
diff -u -r1.152 Makefile.rumpkern
--- sys/rump/librump/rumpkern/Makefile.rumpkern	3 Jan 2015 17:23:51 -0000	1.152
+++ sys/rump/librump/rumpkern/Makefile.rumpkern	5 Jan 2015 19:54:21 -0000
@@ -28,7 +28,7 @@
 SRCS+=	rump.c rumpcopy.c cons.c emul.c etfs_wrap.c intr.c	\
 	lwproc.c klock.c kobj_rename.c ltsleep.c scheduler.c	\
 	signals.c sleepq.c threads.c vm.c hyperentropy.c	\
-	accessors.c sysproxy.c
+	accessors.c
 
 SRCS+=	rumpkern_syscalls.c
 
Index: sys/rump/librump/rumpkern/rump.c
===================================================================
RCS file: /cvsroot/src/sys/rump/librump/rumpkern/rump.c,v
retrieving revision 1.314
diff -u -r1.314 rump.c
--- sys/rump/librump/rumpkern/rump.c	4 Jan 2015 22:11:40 -0000	1.314
+++ sys/rump/librump/rumpkern/rump.c	5 Jan 2015 19:54:21 -0000
@@ -149,6 +149,21 @@
 	    CTL_HW, HW_PAGESIZE, CTL_EOL);
 }
 
+static pid_t rspo_wrap_getpid(void) {
+	return rump_sysproxy_hyp_getpid();
+}
+static int rspo_wrap_syscall(int num, void *arg, long *retval) {
+	return rump_sysproxy_hyp_syscall(num, arg, retval);
+}
+static int rspo_wrap_rfork(void *priv, int flag, const char *comm) {
+	return rump_sysproxy_hyp_rfork(priv, flag, comm);
+}
+static void rspo_wrap_lwpexit(void) {
+	rump_sysproxy_hyp_lwpexit();
+}
+static void rspo_wrap_execnotify(const char *comm) {
+	rump_sysproxy_hyp_execnotify(comm);
+}
 static const struct rumpuser_hyperup hyp = {
 	.hyp_schedule		= rump_schedule,
 	.hyp_unschedule		= rump_unschedule,
@@ -156,13 +171,28 @@
 	.hyp_backend_schedule	= rump_user_schedule,
 	.hyp_lwproc_switch	= rump_lwproc_switch,
 	.hyp_lwproc_release	= rump_lwproc_releaselwp,
-	.hyp_lwproc_rfork	= rump_sysproxy_hyp_rfork,
 	.hyp_lwproc_newlwp	= rump_lwproc_newlwp,
 	.hyp_lwproc_curlwp	= rump_lwproc_curlwp,
-	.hyp_lwpexit		= rump_sysproxy_hyp_lwpexit,
-	.hyp_syscall		= rump_sysproxy_hyp_syscall,
-	.hyp_execnotify		= rump_sysproxy_hyp_execnotify,
-	.hyp_getpid		= rump_sysproxy_hyp_getpid,
+
+	.hyp_getpid		= rspo_wrap_getpid,
+	.hyp_syscall		= rspo_wrap_syscall,
+	.hyp_lwproc_rfork	= rspo_wrap_rfork,
+	.hyp_lwpexit		= rspo_wrap_lwpexit,
+	.hyp_execnotify		= rspo_wrap_execnotify,
+};
+struct rump_sysproxy_ops rump_sysproxy_ops = {
+	.rspo_copyin		= (void *)enxio,
+	.rspo_copyinstr 	= (void *)enxio,
+	.rspo_copyout	 	= (void *)enxio,
+	.rspo_copyoutstr 	= (void *)enxio,
+	.rspo_anonmmap 		= (void *)enxio,
+	.rspo_raise 		= (void *)enxio,
+	.rspo_fini 		= (void *)enxio,
+	.rspo_hyp_getpid 	= (void *)enxio,
+	.rspo_hyp_syscall 	= (void *)enxio,
+	.rspo_hyp_rfork 	= (void *)enxio,
+	.rspo_hyp_lwpexit 	= (void *)enxio,
+	.rspo_hyp_execnotify 	= (void *)enxio,
 };
 
 int
Index: sys/rump/librump/rumpkern/rump_private.h
===================================================================
RCS file: /cvsroot/src/sys/rump/librump/rumpkern/rump_private.h,v
retrieving revision 1.86
diff -u -r1.86 rump_private.h
--- sys/rump/librump/rumpkern/rump_private.h	3 Jan 2015 17:23:51 -0000	1.86
+++ sys/rump/librump/rumpkern/rump_private.h	5 Jan 2015 19:54:21 -0000
@@ -187,18 +187,50 @@
 void	rump_lwproc_curlwp_set(struct lwp *);
 void	rump_lwproc_curlwp_clear(struct lwp *);
 
-/* in-kernel sysproxy bouncers */
-int	rump_sysproxy_copyin(void *, const void *, void *, size_t);
-int	rump_sysproxy_copyinstr(void *, const void *, void *, size_t *);
-int	rump_sysproxy_copyout(void *, const void *, void *, size_t);
-int	rump_sysproxy_copyoutstr(void *, const void *, void *, size_t *);
-int	rump_sysproxy_anonmmap(void *, size_t, void **);
-int	rump_sysproxy_raise(void *, int);
-void	rump_sysproxy_fini(void *);
-pid_t	rump_sysproxy_hyp_getpid(void);
-int	rump_sysproxy_hyp_syscall(int, void *, long *);
-int	rump_sysproxy_hyp_rfork(void *, int, const char *);
-void	rump_sysproxy_hyp_lwpexit(void);
-void	rump_sysproxy_hyp_execnotify(const char *);
+/*
+ * sysproxy is an optional component.  The interfaces with "hyp"
+ * in the name come into the rump kernel from the client or sysproxy
+ * stub, the rest go out of the rump kernel.
+ */
+struct rump_sysproxy_ops {
+	int (*rspo_copyin)(void *, const void *, void *, size_t);
+	int (*rspo_copyinstr)(void *, const void *, void *, size_t *);
+	int (*rspo_copyout)(void *, const void *, void *, size_t);
+	int (*rspo_copyoutstr)(void *, const void *, void *, size_t *);
+	int (*rspo_anonmmap)(void *, size_t, void **);
+	int (*rspo_raise)(void *, int);
+	void (*rspo_fini)(void *);
+
+	pid_t (*rspo_hyp_getpid)(void);
+	int (*rspo_hyp_syscall)(int, void *, long *);
+	int (*rspo_hyp_rfork)(void *, int, const char *);
+	void (*rspo_hyp_lwpexit)(void);
+	void (*rspo_hyp_execnotify)(const char *);
+};
+extern struct rump_sysproxy_ops rump_sysproxy_ops;
+#define rump_sysproxy_copyin(arg, raddr, laddr, len)			\
+ 	rump_sysproxy_ops.rspo_copyin(arg, raddr, laddr, len)
+#define rump_sysproxy_copyinstr(arg, raddr, laddr, lenp)		\
+ 	rump_sysproxy_ops.rspo_copyinstr(arg, raddr, laddr, lenp)
+#define rump_sysproxy_copyout(arg, laddr, raddr, len)			\
+ 	rump_sysproxy_ops.rspo_copyout(arg, laddr, raddr, len)
+#define rump_sysproxy_copyoutstr(arg, laddr, raddr, lenp)		\
+ 	rump_sysproxy_ops.rspo_copyoutstr(arg, laddr, raddr, lenp)
+#define rump_sysproxy_anonmmap(arg, howmuch, addr)			\
+	rump_sysproxy_ops.rspo_anonmmap(arg, howmuch, addr)
+#define rump_sysproxy_raise(arg, signo)					\
+	rump_sysproxy_ops.rspo_raise(arg, signo)
+#define rump_sysproxy_fini(arg)						\
+	rump_sysproxy_ops.rspo_fini(arg)
+#define rump_sysproxy_hyp_getpid()					\
+	rump_sysproxy_ops.rspo_hyp_getpid()
+#define rump_sysproxy_hyp_syscall(num, arg, retval)			\
+	rump_sysproxy_ops.rspo_hyp_syscall(num, arg, retval)
+#define rump_sysproxy_hyp_rfork(priv, flag, comm)			\
+	rump_sysproxy_ops.rspo_hyp_rfork(priv, flag, comm)
+#define rump_sysproxy_hyp_lwpexit()					\
+	rump_sysproxy_ops.rspo_hyp_lwpexit()
+#define rump_sysproxy_hyp_execnotify(comm)				\
+	rump_sysproxy_ops.rspo_hyp_execnotify(comm)
 
 #endif /* _SYS_RUMP_PRIVATE_H_ */
Index: sys/rump/librump/rumpkern/sysproxy.c
===================================================================
RCS file: sys/rump/librump/rumpkern/sysproxy.c
diff -N sys/rump/librump/rumpkern/sysproxy.c
--- sys/rump/librump/rumpkern/sysproxy.c	3 Jan 2015 17:23:51 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,246 +0,0 @@
-/*	$NetBSD: sysproxy.c,v 1.1 2015/01/03 17:23:51 pooka Exp $	*/
-
-/*
- * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
- *
- * 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 AUTHOR ``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 AUTHOR 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: sysproxy.c,v 1.1 2015/01/03 17:23:51 pooka Exp $");
-
-#include <sys/param.h>
-#include <sys/filedesc.h>
-#include <sys/kmem.h>
-#include <sys/syscall.h>
-#include <sys/syscallvar.h>
-#include <sys/systm.h>
-#include <sys/xcall.h>
-
-#define _RUMP_SYSPROXY
-#include <rump/rumpuser.h>
-
-#include "rump_private.h"
-
-int
-rump_init_server(const char *url)
-{
-
-	return rumpuser_sp_init(url, ostype, osrelease, MACHINE);
-}
-
-pid_t
-rump_sysproxy_hyp_getpid(void)
-{
-
-	return curproc->p_pid;
-}
-
-int
-rump_sysproxy_hyp_syscall(int num, void *arg, long *retval)
-{
-	register_t regrv[2] = {0, 0};
-	struct lwp *l;
-	struct sysent *callp;
-	int rv;
-
-	if (__predict_false(num >= SYS_NSYSENT))
-		return ENOSYS;
-
-	/* XXX: always uses native syscall vector */
-	callp = rump_sysent + num;
-	l = curlwp;
-	rv = sy_invoke(callp, l, (void *)arg, regrv, num);
-	retval[0] = regrv[0];
-	retval[1] = regrv[1];
-
-	return rv;
-}
-
-int
-rump_sysproxy_hyp_rfork(void *priv, int flags, const char *comm)
-{
-	struct vmspace *newspace;
-	struct proc *p;
-	struct lwp *l;
-	int error;
-	bool initfds;
-
-	/*
-	 * If we are forking off of pid 1, initialize file descriptors.
-	 */
-	l = curlwp;
-	if (l->l_proc->p_pid == 1) {
-		KASSERT(flags == RUMP_RFFD_CLEAR);
-		initfds = true;
-	} else {
-		initfds = false;
-	}
-
-	if ((error = rump_lwproc_rfork(flags)) != 0)
-		return error;
-
-	/*
-	 * We forked in this routine, so cannot use curlwp (const)
-	 */
-	l = rump_lwproc_curlwp();
-	p = l->l_proc;
-
-	/*
-	 * Since it's a proxy proc, adjust the vmspace.
-	 * Refcount will eternally be 1.
-	 */
-	newspace = kmem_zalloc(sizeof(*newspace), KM_SLEEP);
-	newspace->vm_refcnt = 1;
-	newspace->vm_map.pmap = priv;
-	KASSERT(p->p_vmspace == vmspace_kernel());
-	p->p_vmspace = newspace;
-	if (comm)
-		strlcpy(p->p_comm, comm, sizeof(p->p_comm));
-	if (initfds)
-		rump_consdev_init();
-
-	return 0;
-}
-
-/*
- * Order all lwps in a process to exit.  does *not* wait for them to drain.
- */
-void
-rump_sysproxy_hyp_lwpexit(void)
-{
-	struct proc *p = curproc;
-	uint64_t where;
-	struct lwp *l;
-
-	mutex_enter(p->p_lock);
-	/*
-	 * First pass: mark all lwps in the process with LW_RUMP_QEXIT
-	 * so that they know they should exit.
-	 */
-	LIST_FOREACH(l, &p->p_lwps, l_sibling) {
-		if (l == curlwp)
-			continue;
-		l->l_flag |= LW_RUMP_QEXIT;
-	}
-	mutex_exit(p->p_lock);
-
-	/*
-	 * Next, make sure everyone on all CPUs sees our status
-	 * update.  This keeps threads inside cv_wait() and makes
-	 * sure we don't access a stale cv pointer later when
-	 * we wake up the threads.
-	 */
-
-	where = xc_broadcast(0, (xcfunc_t)nullop, NULL, NULL);
-	xc_wait(where);
-
-	/*
-	 * Ok, all lwps are either:
-	 *  1) not in the cv code
-	 *  2) sleeping on l->l_private
-	 *  3) sleeping on p->p_waitcv
-	 *
-	 * Either way, l_private is stable until we set PS_RUMP_LWPEXIT
-	 * in p->p_sflag.
-	 */
-
-	mutex_enter(p->p_lock);
-	LIST_FOREACH(l, &p->p_lwps, l_sibling) {
-		if (l->l_private)
-			cv_broadcast(l->l_private);
-	}
-	p->p_sflag |= PS_RUMP_LWPEXIT;
-	cv_broadcast(&p->p_waitcv);
-	mutex_exit(p->p_lock);
-}
-
-/*
- * Notify process that all threads have been drained and exec is complete.
- */
-void
-rump_sysproxy_hyp_execnotify(const char *comm)
-{
-	struct proc *p = curproc;
-
-	fd_closeexec();
-	mutex_enter(p->p_lock);
-	KASSERT(p->p_nlwps == 1 && p->p_sflag & PS_RUMP_LWPEXIT);
-	p->p_sflag &= ~PS_RUMP_LWPEXIT;
-	mutex_exit(p->p_lock);
-	strlcpy(p->p_comm, comm, sizeof(p->p_comm));
-}
-
-/*
- * rest are rump kernel -> client calls
- */
-
-int
-rump_sysproxy_copyin(void *arg, const void *raddr, void *laddr, size_t len)
-{
-
-	return rumpuser_sp_copyin(arg, raddr, laddr, len);
-}
-
-int
-rump_sysproxy_copyinstr(void *arg, const void *raddr, void *laddr, size_t *lenp)
-{
-
-	return rumpuser_sp_copyinstr(arg, raddr, laddr, lenp);
-}
-
-int
-rump_sysproxy_copyout(void *arg,
-	const void *laddr, void *raddr, size_t len)
-{
-
-	return rumpuser_sp_copyout(arg, laddr, raddr, len);
-}
-
-int
-rump_sysproxy_copyoutstr(void *arg,
-	const void *laddr, void *raddr, size_t *lenp)
-{
-
-	return rumpuser_sp_copyoutstr(arg, laddr, raddr, lenp);
-}
-
-int
-rump_sysproxy_anonmmap(void *arg, size_t howmuch, void **addr)
-{
-
-	return rumpuser_sp_anonmmap(arg, howmuch, addr);
-}
-
-int
-rump_sysproxy_raise(void *arg, int signo)
-{
-
-	return rumpuser_sp_raise(arg, signo);
-}
-
-void
-rump_sysproxy_fini(void *arg)
-{
-
-	rumpuser_sp_fini(arg);
-}
Index: usr.bin/rump_server/Makefile
===================================================================
RCS file: /cvsroot/src/usr.bin/rump_server/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- usr.bin/rump_server/Makefile	13 Nov 2013 17:47:27 -0000	1.7
+++ usr.bin/rump_server/Makefile	5 Jan 2015 19:54:21 -0000
@@ -7,6 +7,7 @@
 SRCS=		rump_allserver.c
 NOMAN=		installed by ../rump_allserver
 
-LDADD+= -Wl,--whole-archive -lrump -lrumpuser -Wl,--no-whole-archive -lpthread
+LDADD+=		-Wl,--whole-archive -lrumpkern_sysproxy -lrump \
+		-lrumpuser -Wl,--no-whole-archive -lpthread
 
 .include <bsd.prog.mk>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
rumpkernel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rumpkernel-users

Reply via email to