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 avoid race condition between I/O submission...
details: https://anonhg.NetBSD.org/src/rev/abf5ec62d519
branches: trunk
changeset: 365563:abf5ec62d519
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Tue Aug 21 18:11:10 2018 +0000
description:
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 f720c3927ff7 -r abf5ec62d519 sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c Tue Aug 21 15:37:33 2018 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c Tue Aug 21 18:11:10 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xbd_xenbus.c,v 1.82 2018/08/15 15:49:15 jdolecek Exp $ */
+/* $NetBSD: xbd_xenbus.c,v 1.83 2018/08/21 18:11:10 jdolecek Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.82 2018/08/15 15:49:15 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.83 2018/08/21 18:11:10 jdolecek Exp $");
#include "opt_xen.h"
@@ -932,6 +932,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));
@@ -947,6 +948,8 @@
goto err;
}
+ s = splbio(); /* XXX SMP */
+
if (__predict_false(
sc->sc_backend_status == BLKIF_STATE_SUSPENDED)) {
/* device is suspended, do not consume buffer */
@@ -1024,6 +1027,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