Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test run (which works again with this, even on non x86 SMP machines).
This commit is contained in:
parent
9093b029d2
commit
7587f0bb0d
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpcpu.c,v 1.9 2010/04/28 00:34:25 pooka Exp $ */
|
||||
/* $NetBSD: rumpcpu.c,v 1.10 2013/02/19 09:04:54 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
|
||||
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rumpcpu.c,v 1.9 2010/04/28 00:34:25 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rumpcpu.c,v 1.10 2013/02/19 09:04:54 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
|
@ -49,6 +49,9 @@ rump_cpu_attach(struct cpu_info *ci)
|
|||
/* XXX: wrong order, but ... */
|
||||
ci->ci_next = cpu_info_list;
|
||||
cpu_info_list = ci;
|
||||
|
||||
kcpuset_set(kcpuset_attached, cpu_index(ci));
|
||||
kcpuset_set(kcpuset_running, cpu_index(ci));
|
||||
}
|
||||
|
||||
struct cpu_info *
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: emul.c,v 1.152 2013/01/20 17:09:47 rmind Exp $ */
|
||||
/* $NetBSD: emul.c,v 1.153 2013/02/19 09:04:54 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
|
||||
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.152 2013/01/20 17:09:47 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.153 2013/02/19 09:04:54 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/null.h>
|
||||
|
@ -281,37 +281,6 @@ syscall_intern(struct proc *p)
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
xc_send_ipi(struct cpu_info *ci)
|
||||
{
|
||||
const struct cpu_info *curci = curcpu();
|
||||
CPU_INFO_ITERATOR cii;
|
||||
|
||||
/*
|
||||
* IPI are considered asynchronous, therefore no need to wait for
|
||||
* unicast call delivery (nor the order of calls matters). Our LWP
|
||||
* needs to be bound to the CPU, since xc_unicast(9) may block.
|
||||
*
|
||||
* WARNING: These must be low-priority calls, as this routine is
|
||||
* used to emulate high-priority (XC_HIGHPRI) mechanism.
|
||||
*/
|
||||
|
||||
if (ci) {
|
||||
KASSERT(curci != ci);
|
||||
(void)xc_unicast(0, (xcfunc_t)xc_ipi_handler, NULL, NULL, ci);
|
||||
return;
|
||||
}
|
||||
|
||||
curlwp->l_pflag |= LP_BOUND;
|
||||
for (CPU_INFO_FOREACH(cii, ci)) {
|
||||
if (curci == ci) {
|
||||
continue;
|
||||
}
|
||||
(void)xc_unicast(0, (xcfunc_t)xc_ipi_handler, NULL, NULL, ci);
|
||||
}
|
||||
curlwp->l_pflag &= ~LP_BOUND;
|
||||
}
|
||||
|
||||
int
|
||||
trace_enter(register_t code, const register_t *args, int narg)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump.c,v 1.250 2013/01/14 16:52:35 pooka Exp $ */
|
||||
/* $NetBSD: rump.c,v 1.251 2013/02/19 09:04:54 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
|
||||
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.250 2013/01/14 16:52:35 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.251 2013/02/19 09:04:54 martin Exp $");
|
||||
|
||||
#include <sys/systm.h>
|
||||
#define ELFSIZE ARCH_ELFSIZE
|
||||
|
@ -892,3 +892,23 @@ rump_allbetsareoff_setid(pid_t pid, int lid)
|
|||
l->l_lid = lid;
|
||||
p->p_pid = pid;
|
||||
}
|
||||
|
||||
#include <sys/pserialize.h>
|
||||
|
||||
static void
|
||||
ipiemu(void *a1, void *a2)
|
||||
{
|
||||
|
||||
xc__highpri_intr(NULL);
|
||||
pserialize_switchpoint();
|
||||
}
|
||||
|
||||
void
|
||||
rump_xc_highpri(struct cpu_info *ci)
|
||||
{
|
||||
|
||||
if (ci)
|
||||
xc_unicast(0, ipiemu, NULL, NULL, ci);
|
||||
else
|
||||
xc_broadcast(0, ipiemu, NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump_private.h,v 1.72 2013/01/14 16:45:47 pooka Exp $ */
|
||||
/* $NetBSD: rump_private.h,v 1.73 2013/02/19 09:04:54 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
|
||||
|
@ -139,4 +139,6 @@ void rump_softint_run(struct cpu_info *);
|
|||
void *rump_hypermalloc(size_t, int, bool, const char *);
|
||||
void rump_hyperfree(void *, size_t);
|
||||
|
||||
void rump_xc_highpri(struct cpu_info *);
|
||||
|
||||
#endif /* _SYS_RUMP_PRIVATE_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xcall.h,v 1.4 2010/06/22 18:29:01 rmind Exp $ */
|
||||
/* $NetBSD: xcall.h,v 1.5 2013/02/19 09:04:53 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -43,6 +43,8 @@ void xc_init_cpu(struct cpu_info *);
|
|||
void xc_send_ipi(struct cpu_info *);
|
||||
void xc_ipi_handler(void);
|
||||
|
||||
void xc__highpri_intr(void *);
|
||||
|
||||
uint64_t xc_broadcast(u_int, xcfunc_t, void *, void *);
|
||||
uint64_t xc_unicast(u_int, xcfunc_t, void *, void *, struct cpu_info *);
|
||||
void xc_wait(uint64_t);
|
||||
|
|
Loading…
Reference in New Issue