Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/701549b4ed69
branches:  trunk
changeset: 785040:701549b4ed69
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 19 11:20:17 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/kern/subr_xcall.c |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (93 lines):

diff -r 349eb7bb0d7a -r 701549b4ed69 sys/kern/subr_xcall.c
--- a/sys/kern/subr_xcall.c     Tue Feb 19 10:58:35 2013 +0000
+++ b/sys/kern/subr_xcall.c     Tue Feb 19 11:20:17 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_xcall.c,v 1.13 2011/05/13 22:16:44 rmind Exp $    */
+/*     $NetBSD: subr_xcall.c,v 1.14 2013/02/19 11:20:17 martin Exp $   */
 
 /*-
  * Copyright (c) 2007-2010 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.13 2011/05/13 22:16:44 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.14 2013/02/19 11:20:17 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -85,6 +85,10 @@
 #include <sys/kthread.h>
 #include <sys/cpu.h>
 
+#ifdef _RUMPKERNEL
+#include "rump_private.h"
+#endif
+
 /* Cross-call state box. */
 typedef struct {
        kmutex_t        xc_lock;
@@ -113,7 +117,6 @@
 
 static void            xc_init(void);
 static void            xc_thread(void *);
-static void            xc_highpri_intr(void *);
 
 static inline uint64_t xc_highpri(xcfunc_t, void *, void *, struct cpu_info *);
 static inline uint64_t xc_lowpri(xcfunc_t, void *, void *, struct cpu_info *);
@@ -137,7 +140,7 @@
        mutex_init(&xchi->xc_lock, MUTEX_DEFAULT, IPL_SOFTCLOCK);
        cv_init(&xchi->xc_busy, "xchicv");
        xc_sih = softint_establish(SOFTINT_CLOCK | SOFTINT_MPSAFE,
-           xc_highpri_intr, NULL);
+           xc__highpri_intr, NULL);
        KASSERT(xc_sih != NULL);
 
        evcnt_attach_dynamic(&xc_unicast_ev, EVCNT_TYPE_MISC, NULL,
@@ -329,23 +332,23 @@
 void
 xc_ipi_handler(void)
 {
-       /* Executes xc_highpri_intr() via software interrupt. */
+       /* Executes xc__highpri_intr() via software interrupt. */
        softint_schedule(xc_sih);
 }
 
 /*
- * xc_highpri_intr:
+ * xc__highpri_intr:
  *
  *     A software interrupt handler for high priority calls.
  */
-static void
-xc_highpri_intr(void *dummy)
+void
+xc__highpri_intr(void *dummy)
 {
        xc_state_t *xc = &xc_high_pri;
        void *arg1, *arg2;
        xcfunc_t func;
 
-       KASSERT(cpu_softintr_p());
+       KASSERT(!cpu_intr_p());
        /*
         * Lock-less fetch of function and its arguments.
         * Safe since it cannot change at this point.
@@ -396,6 +399,9 @@
         * Note: it will handle the local CPU case.
         */
 
+#ifdef _RUMPKERNEL
+       rump_xc_highpri(ci);
+#else
 #ifdef MULTIPROCESSOR
        kpreempt_disable();
        if (curcpu() == ci) {
@@ -414,6 +420,7 @@
        KASSERT(curcpu() == ci);
        xc_ipi_handler();
 #endif
+#endif
 
        /* Indicate a high priority ticket. */
        return (where | XC_PRI_BIT);



Home | Main Index | Thread Index | Old Index