Module Name: src
Committed By: riastradh
Date: Sat Nov 11 21:03:01 UTC 2017
Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c xbd_xenbus.c xbdback_xenbus.c
xencons.c xennetback_xenbus.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/xen/xen/xbdback_xenbus.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/xen/xen/xencons.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/xennetback_xenbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.72 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.73
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.72 Mon Nov 6 15:27:09 2017
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c Sat Nov 11 21:03:01 2017
@@ -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 @@ xennet_xenbus_resume(device_t dev, const
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;
Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.77 src/sys/arch/xen/xen/xbd_xenbus.c:1.78
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.77 Mon Nov 6 15:27:09 2017
+++ src/sys/arch/xen/xen/xbd_xenbus.c Sat Nov 11 21:03:01 2017
@@ -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 @@ xbd_xenbus_resume(device_t dev, const pm
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:
Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.64 src/sys/arch/xen/xen/xbdback_xenbus.c:1.65
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.64 Mon Nov 6 15:27:09 2017
+++ src/sys/arch/xen/xen/xbdback_xenbus.c Sat Nov 11 21:03:01 2017
@@ -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 @@ xbdback_connect(struct xbdback_instance
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,
Index: src/sys/arch/xen/xen/xencons.c
diff -u src/sys/arch/xen/xen/xencons.c:1.42 src/sys/arch/xen/xen/xencons.c:1.43
--- src/sys/arch/xen/xen/xencons.c:1.42 Mon Nov 6 15:27:09 2017
+++ src/sys/arch/xen/xen/xencons.c Sat Nov 11 21:03:01 2017
@@ -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 @@ xencons_resume(device_t dev, const pmf_q
/* 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);
}
Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.60 src/sys/arch/xen/xen/xennetback_xenbus.c:1.61
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.60 Mon Nov 6 15:27:09 2017
+++ src/sys/arch/xen/xen/xennetback_xenbus.c Sat Nov 11 21:03:01 2017
@@ -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 @@ xennetback_connect(struct xnetback_insta
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);