CVS commit: [netbsd-9] src/sys/arch/xen/xen

2023-07-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 31 15:29:23 UTC 2023

Modified Files:
src/sys/arch/xen/xen [netbsd-9]: if_xennet_xenbus.c

Log Message:
Apply patch, requested by riastradh in ticket #1680, pulling up
the essential part of

sys/arch/xen/xen/if_xennet_xenbus.c 1.129

xennet(4): Add missing membar.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.4.1 src/sys/arch/xen/xen/if_xennet_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/arch/xen/xen

2023-07-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 31 15:29:23 UTC 2023

Modified Files:
src/sys/arch/xen/xen [netbsd-9]: if_xennet_xenbus.c

Log Message:
Apply patch, requested by riastradh in ticket #1680, pulling up
the essential part of

sys/arch/xen/xen/if_xennet_xenbus.c 1.129

xennet(4): Add missing membar.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.4.1 src/sys/arch/xen/xen/if_xennet_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.86 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.86.4.1
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.86	Sat Mar  9 08:42:25 2019
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Mon Jul 31 15:29:23 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.86 2019/03/09 08:42:25 maxv Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.86.4.1 2023/07/31 15:29:23 martin Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.86 2019/03/09 08:42:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.86.4.1 2023/07/31 15:29:23 martin Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -967,7 +967,7 @@ again:
 	sc->sc_tx_ring.sring->rsp_event =
 	resp_prod + ((sc->sc_tx_ring.sring->req_prod - resp_prod) >> 1) + 1;
 	ifp->if_timer = 0;
-	xen_wmb();
+	xen_mb();
 	if (resp_prod != sc->sc_tx_ring.sring->rsp_prod)
 		goto again;
 end:



CVS commit: [netbsd-9] src/sys/arch/xen/xen

2023-07-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul 27 16:55:41 UTC 2023

Modified Files:
src/sys/arch/xen/xen [netbsd-9]: clock.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1668):

sys/arch/xen/xen/xen_clock.c: revision 1.10
sys/arch/xen/xen/xen_clock.c: revision 1.12
(applied to sys/arch/xen/xen/clock.c)

Unmask event after VCPUOP_stop_periodic_timer and
initializing ci->ci_xen_hardclock_systime_ns, to avoid a possible race with
xen_timer_handler()

Unmask event after arming the one-shot timer in clock initialisation,
to avoid a possible race with xen_timer_handler() updating
ci_xen_hardclock_systime_ns while we're reading it.

Pointed out by Taylor R Campbell


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.78.4.1 src/sys/arch/xen/xen/clock.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/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.78 src/sys/arch/xen/xen/clock.c:1.78.4.1
--- src/sys/arch/xen/xen/clock.c:1.78	Sat Mar  9 09:51:29 2019
+++ src/sys/arch/xen/xen/clock.c	Thu Jul 27 16:55:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.78 2019/03/09 09:51:29 kre Exp $	*/
+/*	$NetBSD: clock.c,v 1.78.4.1 2023/07/27 16:55:41 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.78 2019/03/09 09:51:29 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.78.4.1 2023/07/27 16:55:41 martin Exp $");
 
 #include 
 #include 
@@ -769,7 +769,6 @@ xen_resumeclocks(struct cpu_info *ci)
 	if (ci->ci_xen_timer_intrhand == NULL)
 		panic("failed to establish timer interrupt handler");
 
-	hypervisor_unmask_event(evtch);
 
 	aprint_verbose("Xen %s: using event channel %d\n", intr_xname, evtch);
 
@@ -783,10 +782,12 @@ xen_resumeclocks(struct cpu_info *ci)
 	/* Pretend the last hardclock happened right now.  */
 	ci->ci_xen_hardclock_systime_ns = xen_vcputime_systime_ns();
 
+
 	/* Arm the one-shot timer.  */
 	error = HYPERVISOR_set_timer_op(ci->ci_xen_hardclock_systime_ns +
 	NS_PER_TICK);
 	KASSERT(error == 0);
+	hypervisor_unmask_event(evtch);
 
 	/* We'd better not have switched CPUs.  */
 	KASSERT(ci == curcpu());



CVS commit: [netbsd-9] src/sys/arch/xen/xen

2023-07-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul 27 16:55:41 UTC 2023

Modified Files:
src/sys/arch/xen/xen [netbsd-9]: clock.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1668):

sys/arch/xen/xen/xen_clock.c: revision 1.10
sys/arch/xen/xen/xen_clock.c: revision 1.12
(applied to sys/arch/xen/xen/clock.c)

Unmask event after VCPUOP_stop_periodic_timer and
initializing ci->ci_xen_hardclock_systime_ns, to avoid a possible race with
xen_timer_handler()

Unmask event after arming the one-shot timer in clock initialisation,
to avoid a possible race with xen_timer_handler() updating
ci_xen_hardclock_systime_ns while we're reading it.

Pointed out by Taylor R Campbell


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.78.4.1 src/sys/arch/xen/xen/clock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.