Module Name:    src
Committed By:   martin
Date:           Mon Sep  4 16:36:46 UTC 2023

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

Log Message:
Actually apply a cherry picked version of

        sys/arch/xen/xen/xbd_xenbus.c   rev 1.130

xbd(4): Membar audit.

After consuming slots, must issue xen_wmb before notifying the other
side that we've consumed them in RING_FINAL_CHECK_FOR_RESPONSES.

Part of ticket #268 (and already noted in that CHANGES-10 entry, but
somehow lost during pullup)


To generate a diff of this commit:
cvs rdiff -u -r1.129.20.2 -r1.129.20.3 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.129.20.2 src/sys/arch/xen/xen/xbd_xenbus.c:1.129.20.3
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.129.20.2	Mon Jul 31 15:23:02 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Mon Sep  4 16:36:46 2023
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.129.20.2 2023/07/31 15:23:02 martin Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.129.20.3 2023/09/04 16:36:46 martin Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.129.20.2 2023/07/31 15:23:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.129.20.3 2023/09/04 16:36:46 martin Exp $");
 
 #include "opt_xen.h"
 
@@ -906,10 +906,9 @@ again:
 		}
 		SLIST_INSERT_HEAD(&sc->sc_xbdreq_head, xbdreq, req_next);
 	}
-
-	xen_rmb();
 	sc->sc_ring.rsp_cons = i;
 
+	xen_wmb();
 	RING_FINAL_CHECK_FOR_RESPONSES(&sc->sc_ring, more_to_do);
 	if (more_to_do)
 		goto again;

Reply via email to