Module Name:    src
Committed By:   bouyer
Date:           Sun Apr 19 20:29:30 UTC 2020

Modified Files:
        src/sys/arch/xen/conf [bouyer-xenpvh]: files.xen files.xen.pv
        src/sys/arch/xen/x86 [bouyer-xenpvh]: hypervisor_machdep.c
        src/sys/arch/xen/xen [bouyer-xenpvh]: evtchn.c

Log Message:
Move xen_ipi.c to XENPV only.
Make sure we don't need to send events to remote CPUs (outside of IPIs)


To generate a diff of this commit:
cvs rdiff -u -r1.180.2.4 -r1.180.2.5 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/xen/conf/files.xen.pv
cvs rdiff -u -r1.36.8.4 -r1.36.8.5 src/sys/arch/xen/x86/hypervisor_machdep.c
cvs rdiff -u -r1.88.2.8 -r1.88.2.9 src/sys/arch/xen/xen/evtchn.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/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.180.2.4 src/sys/arch/xen/conf/files.xen:1.180.2.5
--- src/sys/arch/xen/conf/files.xen:1.180.2.4	Thu Apr 16 19:23:50 2020
+++ src/sys/arch/xen/conf/files.xen	Sun Apr 19 20:29:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.180.2.4 2020/04/16 19:23:50 bouyer Exp $
+#	$NetBSD: files.xen,v 1.180.2.5 2020/04/19 20:29:30 bouyer Exp $
 
 defflag	opt_xen.h			XEN XENPVH XENPVHVM
 
@@ -7,7 +7,6 @@ file	arch/xen/x86/xen_intr.c			xen
 file	arch/xen/xen/xen_machdep.c		xen
 file	arch/xen/xen/evtchn.c			xen
 file	arch/xen/xen/xengnt.c			xen
-file	arch/xen/x86/xen_ipi.c			multiprocessor & xen
 file	arch/xen/x86/xen_mainbus.c		xen
 file	arch/xen/xen/xen_clock.c		xen
 

Index: src/sys/arch/xen/conf/files.xen.pv
diff -u src/sys/arch/xen/conf/files.xen.pv:1.1.2.2 src/sys/arch/xen/conf/files.xen.pv:1.1.2.3
--- src/sys/arch/xen/conf/files.xen.pv:1.1.2.2	Thu Apr 16 19:23:50 2020
+++ src/sys/arch/xen/conf/files.xen.pv	Sun Apr 19 20:29:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen.pv,v 1.1.2.2 2020/04/16 19:23:50 bouyer Exp $
+#	$NetBSD: files.xen.pv,v 1.1.2.3 2020/04/19 20:29:30 bouyer Exp $
 
 file	arch/xen/x86/autoconf.c		xenpv
 file	arch/xen/x86/x86_xpmap.c	xenpv
@@ -10,6 +10,8 @@ file	arch/xen/x86/xen_bus_dma.c	machdep 
 file	arch/xen/x86/consinit.c		machdep & xenpv
 file	arch/xen/x86/pintr.c		machdep & dom0ops & xenpv
 
+file	arch/xen/x86/xen_ipi.c			multiprocessor & xenpv
+
 #
 # System bus types
 #

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.36.8.4 src/sys/arch/xen/x86/hypervisor_machdep.c:1.36.8.5
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.36.8.4	Sat Apr 18 15:06:18 2020
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Sun Apr 19 20:29:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.36.8.4 2020/04/18 15:06:18 bouyer Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.36.8.5 2020/04/19 20:29:30 bouyer Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.36.8.4 2020/04/18 15:06:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.36.8.5 2020/04/19 20:29:30 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -291,6 +291,7 @@ do_hypervisor_callback(struct intrframe 
 #endif
 }
 
+#if 0
 void
 hypervisor_send_event(struct cpu_info *ci, unsigned int ev)
 {
@@ -323,6 +324,7 @@ hypervisor_send_event(struct cpu_info *c
 		}
 	}
 }
+#endif
 
 void
 hypervisor_unmask_event(unsigned int ev)
@@ -422,6 +424,8 @@ hypervisor_set_ipending(uint32_t imask, 
 	KASSERT(ci->ci_isources[sir] != NULL);
 	ci->ci_isources[sir]->ipl_evt_mask1 |= 1UL << l1;
 	ci->ci_isources[sir]->ipl_evt_mask2[l1] |= 1UL << l2;
+	KASSERT(ci == curcpu());
+#if 0
 	if (__predict_false(ci != curcpu())) {
 		if (xen_send_ipi(ci, XEN_IPI_HVCB)) {
 			panic("hypervisor_set_ipending: "
@@ -429,6 +433,7 @@ hypervisor_set_ipending(uint32_t imask, 
 			    (int) ci->ci_cpuid, ci->ci_vcpuid);
 		}
 	}
+#endif
 }
 
 void

Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.88.2.8 src/sys/arch/xen/xen/evtchn.c:1.88.2.9
--- src/sys/arch/xen/xen/evtchn.c:1.88.2.8	Sun Apr 19 19:39:11 2020
+++ src/sys/arch/xen/xen/evtchn.c	Sun Apr 19 20:29:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.88.2.8 2020/04/19 19:39:11 bouyer Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.88.2.9 2020/04/19 20:29:30 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.8 2020/04/19 19:39:11 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.9 2020/04/19 20:29:30 bouyer Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -376,12 +376,15 @@ evtchn_do_event(int evtch, struct intrfr
 	mutex_spin_enter(&evtlock[evtch]);
 	ih = evtsource[evtch]->ev_handlers;
 	while (ih != NULL) {
+		KASSERT(ih->ih_cpu == ci);
+#if 0
 		if (ih->ih_cpu != ci) {
 			hypervisor_send_event(ih->ih_cpu, evtch);
 			iplmask &= ~(1 << XEN_IPL2SIR(ih->ih_level));
 			ih = ih->ih_evt_next;
 			continue;
 		}
+#endif
 		if (ih->ih_level <= ilevel) {
 #ifdef IRQ_DEBUG
 		if (evtch == IRQ_DEBUG)

Reply via email to