Module Name:    src
Committed By:   martin
Date:           Sat Aug 25 14:28:00 UTC 2018

Modified Files:
        src/sys/arch/xen/xen [netbsd-8]: xbd_xenbus.c

Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #984):

        sys/arch/xen/xen/xbd_xenbus.c: revision 1.83

avoid race condition between I/O submission in xbd_diskstart() and
interrupt handling in xbd_handler() - need to protect it with splbio()

fixes PR port-xen/53506 by Emmanuel Dreyfus, and likely also port-xen/53074
by Brad Spencer


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.76.6.1 src/sys/arch/xen/xen/xbd_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/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.76 src/sys/arch/xen/xen/xbd_xenbus.c:1.76.6.1
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.76	Sun Mar  5 23:07:12 2017
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sat Aug 25 14:28:00 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.76 2017/03/05 23:07:12 mlelstv Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.76.6.1 2018/08/25 14:28:00 martin Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.76 2017/03/05 23:07:12 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.76.6.1 2018/08/25 14:28:00 martin Exp $");
 
 #include "opt_xen.h"
 
@@ -916,6 +916,7 @@ xbd_diskstart(device_t self, struct buf 
 	vaddr_t va;
 	int nsects, nbytes, seg;
 	int notify, error = 0;
+	int s;
 
 	DPRINTF(("xbd_diskstart(%p): b_bcount = %ld\n",
 	    bp, (long)bp->b_bcount));
@@ -931,6 +932,8 @@ xbd_diskstart(device_t self, struct buf 
 		goto err;
 	}
 
+	s = splbio();	/* XXX SMP */
+
 	if (__predict_false(
 	    sc->sc_backend_status == BLKIF_STATE_SUSPENDED)) {
 		/* device is suspended, do not consume buffer */
@@ -1008,6 +1011,7 @@ out:
 	RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&sc->sc_ring, notify);
 	if (notify)
 		hypervisor_notify_via_evtchn(sc->sc_evtchn);
+	splx(s);	/* XXXSMP */
 err:
 	return error;
 }

Reply via email to