Module Name: src
Committed By: martin
Date: Mon Jul 31 15:41:01 UTC 2023
Modified Files:
src/sys/arch/xen/x86 [netbsd-8]: hypervisor_machdep.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1864):
sys/arch/xen/x86/hypervisor_machdep.c: revision 1.46 (patch)
xen/x86: Need kpreempt_disable/enable around curcpu() access.
This is called with `hardware' interrupts enabled (between sti and
cli), so presumably preemption is possible here.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.12.1 src/sys/arch/xen/x86/hypervisor_machdep.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/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.28 src/sys/arch/xen/x86/hypervisor_machdep.c:1.28.12.1
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.28 Sun Sep 21 12:46:15 2014
+++ src/sys/arch/xen/x86/hypervisor_machdep.c Mon Jul 31 15:41:00 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor_machdep.c,v 1.28 2014/09/21 12:46:15 bouyer Exp $ */
+/* $NetBSD: hypervisor_machdep.c,v 1.28.12.1 2023/07/31 15:41:00 martin Exp $ */
/*
*
@@ -54,7 +54,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.28 2014/09/21 12:46:15 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.28.12.1 2023/07/31 15:41:00 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -163,6 +163,8 @@ stipending(void)
volatile struct vcpu_info *vci;
int ret;
+ kpreempt_disable();
+
ret = 0;
ci = curcpu();
vci = ci->ci_vcpu;
@@ -206,6 +208,8 @@ stipending(void)
ci->ci_ipending);
#endif
+ kpreempt_enable();
+
return (ret);
}