Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/arch/xen/xen Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/567ae67d0ccf
branches:  netbsd-8
changeset: 851944:567ae67d0ccf
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Aug 25 14:28:00 2018 +0000

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

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 04a4ffae01c3 -r 567ae67d0ccf sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Sat Aug 25 14:22:49 2018 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Sat Aug 25 14:28:00 2018 +0000
@@ -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 @@
        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 @@
                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 @@
        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;
 }



Home | Main Index | Thread Index | Old Index