Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen Restore MP-safety annotations in intr_estab...



details:   https://anonhg.NetBSD.org/src/rev/5eec0d6b9322
branches:  trunk
changeset: 357458:5eec0d6b9322
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Nov 11 21:03:01 2017 +0000

description:
Restore MP-safety annotations in intr_establish_xname.

In the old API, event_set_handler would assume MP-unsafe for IPL_VM
and MP-safe for all other levels (IPL_SCHED, IPL_HIGH).  The recent
Xen interrupt rototill started passing known_mpsafe=true for _all_
interrupt handlers.  Change it to known_mpsafe=false for the IPL_VM
(= IPL_CLOCK, IPL_NET) ones.

diffstat:

 sys/arch/xen/xen/if_xennet_xenbus.c  |   8 ++++----
 sys/arch/xen/xen/xbd_xenbus.c        |   8 ++++----
 sys/arch/xen/xen/xbdback_xenbus.c    |   9 +++++----
 sys/arch/xen/xen/xencons.c           |  14 ++++++++------
 sys/arch/xen/xen/xennetback_xenbus.c |   9 +++++----
 5 files changed, 26 insertions(+), 22 deletions(-)

diffs (157 lines):

diff -r 35f44cf7e6c0 -r 5eec0d6b9322 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c       Sat Nov 11 20:23:49 2017 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c       Sat Nov 11 21:03:01 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.72 2017/11/06 15:27:09 cherry Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.73 2017/11/11 21:03:01 riastradh Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.72 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.73 2017/11/11 21:03:01 riastradh Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -514,8 +514,8 @@
                goto abort_resume;
        aprint_verbose_dev(dev, "using event channel %d\n",
            sc->sc_evtchn);
-       sc->sc_ih = intr_establish_xname(0, &xen_pic, sc->sc_evtchn, IST_LEVEL, IPL_NET,
-           &xennet_handler, sc, true, device_xname(dev));
+       sc->sc_ih = intr_establish_xname(0, &xen_pic, sc->sc_evtchn, IST_LEVEL,
+           IPL_NET, &xennet_handler, sc, false, device_xname(dev));
        KASSERT(sc->sc_ih != NULL);
        return true;
 
diff -r 35f44cf7e6c0 -r 5eec0d6b9322 sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Sat Nov 11 20:23:49 2017 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Sat Nov 11 21:03:01 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.77 2017/11/06 15:27:09 cherry Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.78 2017/11/11 21:03:01 riastradh Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.77 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.78 2017/11/11 21:03:01 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -452,8 +452,8 @@
 
        aprint_verbose_dev(dev, "using event channel %d\n",
            sc->sc_evtchn);
-       sc->sc_ih = intr_establish_xname(0, &xen_pic, sc->sc_evtchn, IST_LEVEL, IPL_BIO, &xbd_handler, sc, true, "clock");
-       
+       sc->sc_ih = intr_establish_xname(0, &xen_pic, sc->sc_evtchn, IST_LEVEL,
+           IPL_BIO, &xbd_handler, sc, false, device_xname(dev));
        KASSERT(sc->sc_ih != NULL);
 
 again:
diff -r 35f44cf7e6c0 -r 5eec0d6b9322 sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Sat Nov 11 20:23:49 2017 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Sat Nov 11 21:03:01 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.64 2017/11/06 15:27:09 cherry Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.65 2017/11/11 21:03:01 riastradh Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.64 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.65 2017/11/11 21:03:01 riastradh Exp $");
 
 #include <sys/atomic.h>
 #include <sys/buf.h>
@@ -637,8 +637,9 @@
        XENPRINTF(("xbdback %s: connect evchannel %d\n", xbusd->xbusd_path, xbdi->xbdi_evtchn));
        xbdi->xbdi_evtchn = evop.u.bind_interdomain.local_port;
 
-       xbdi->xbdi_ih = intr_establish_xname(0, &xen_pic, xbdi->xbdi_evtchn, IST_LEVEL, IPL_BIO,
-           xbdback_evthandler, xbdi, true, xbdi->xbdi_name);
+       xbdi->xbdi_ih = intr_establish_xname(0, &xen_pic, xbdi->xbdi_evtchn,
+           IST_LEVEL, IPL_BIO, xbdback_evthandler, xbdi, false,
+           xbdi->xbdi_name);
        KASSERT(xbdi->xbdi_ih != NULL);
        aprint_verbose("xbd backend domain %d handle %#x (%d) "
            "using event channel %d, protocol %s\n", xbdi->xbdi_domid,
diff -r 35f44cf7e6c0 -r 5eec0d6b9322 sys/arch/xen/xen/xencons.c
--- a/sys/arch/xen/xen/xencons.c        Sat Nov 11 20:23:49 2017 +0000
+++ b/sys/arch/xen/xen/xencons.c        Sat Nov 11 21:03:01 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xencons.c,v 1.42 2017/11/06 15:27:09 cherry Exp $      */
+/*     $NetBSD: xencons.c,v 1.43 2017/11/11 21:03:01 riastradh Exp $   */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.42 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.43 2017/11/11 21:03:01 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -233,14 +233,16 @@
        /* dom0 console resume is required only during first start-up */
                if (cold) {
                        evtch = bind_virq_to_evtch(VIRQ_CONSOLE);
-                       ih = intr_establish_xname(0, &xen_pic, evtch, IST_LEVEL, IPL_TTY,
-                           xencons_intr, xencons_console_device, true, "xencons");
+                       ih = intr_establish_xname(0, &xen_pic, evtch,
+                           IST_LEVEL, IPL_TTY, xencons_intr,
+                           xencons_console_device, false, "xencons");
                        KASSERT(ih != NULL);
                }
        } else {
                evtch = xen_start_info.console_evtchn;
-               ih = intr_establish_xname(0, &xen_pic, evtch, IST_LEVEL, IPL_TTY,
-                   xencons_handler, xencons_console_device, true, "xencons");
+               ih = intr_establish_xname(0, &xen_pic, evtch,
+                   IST_LEVEL, IPL_TTY, xencons_handler,
+                   xencons_console_device, false, "xencons");
                KASSERT(ih != NULL);
        }
 
diff -r 35f44cf7e6c0 -r 5eec0d6b9322 sys/arch/xen/xen/xennetback_xenbus.c
--- a/sys/arch/xen/xen/xennetback_xenbus.c      Sat Nov 11 20:23:49 2017 +0000
+++ b/sys/arch/xen/xen/xennetback_xenbus.c      Sat Nov 11 21:03:01 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.60 2017/11/06 15:27:09 cherry Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.61 2017/11/11 21:03:01 riastradh Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.60 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.61 2017/11/11 21:03:01 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -551,8 +551,9 @@
        xneti->xni_status = CONNECTED;
        xen_wmb();
 
-       xneti->xni_ih = intr_establish_xname(0, &xen_pic, xneti->xni_evtchn, IST_LEVEL, IPL_NET,
-           xennetback_evthandler, xneti, true, xneti->xni_if.if_xname);
+       xneti->xni_ih = intr_establish_xname(0, &xen_pic, xneti->xni_evtchn,
+           IST_LEVEL, IPL_NET, xennetback_evthandler, xneti, false,
+           xneti->xni_if.if_xname);
        KASSERT(xneti->xni_ih != NULL);
        xennetback_ifinit(&xneti->xni_if);
        hypervisor_enable_event(xneti->xni_evtchn);



Home | Main Index | Thread Index | Old Index