Source-Changes-HG archive

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

[src/trunk]: src/sys Stopgap fix to make rump cooperate with pserialize, may ...



details:   https://anonhg.NetBSD.org/src/rev/4cfb922f9141
branches:  trunk
changeset: 785037:4cfb922f9141
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 19 09:04:53 2013 +0000

description:
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).

diffstat:

 sys/rump/librump/rumpkern/arch/i386/rumpcpu.c |   7 +++-
 sys/rump/librump/rumpkern/emul.c              |  35 +-------------------------
 sys/rump/librump/rumpkern/rump.c              |  24 ++++++++++++++++-
 sys/rump/librump/rumpkern/rump_private.h      |   4 ++-
 sys/sys/xcall.h                               |   4 ++-
 5 files changed, 35 insertions(+), 39 deletions(-)

diffs (160 lines):

diff -r 5a5f47831a69 -r 4cfb922f9141 sys/rump/librump/rumpkern/arch/i386/rumpcpu.c
--- a/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c     Tue Feb 19 06:06:53 2013 +0000
+++ b/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c     Tue Feb 19 09:04:53 2013 +0000
@@ -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 @@
        /* 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 *
diff -r 5a5f47831a69 -r 4cfb922f9141 sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c  Tue Feb 19 06:06:53 2013 +0000
+++ b/sys/rump/librump/rumpkern/emul.c  Tue Feb 19 09:04:53 2013 +0000
@@ -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 @@
 }
 #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)
 {
diff -r 5a5f47831a69 -r 4cfb922f9141 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Tue Feb 19 06:06:53 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Tue Feb 19 09:04:53 2013 +0000
@@ -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 @@
        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);
+}
diff -r 5a5f47831a69 -r 4cfb922f9141 sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h  Tue Feb 19 06:06:53 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h  Tue Feb 19 09:04:53 2013 +0000
@@ -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_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_ */
diff -r 5a5f47831a69 -r 4cfb922f9141 sys/sys/xcall.h
--- a/sys/sys/xcall.h   Tue Feb 19 06:06:53 2013 +0000
+++ b/sys/sys/xcall.h   Tue Feb 19 09:04:53 2013 +0000
@@ -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_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);



Home | Main Index | Thread Index | Old Index