Mon Apr 20 19:46:44 2020 UTC ()
Misc fixes after merge


(bouyer)
diff -r1.28.2.2 -r1.28.2.3 src/sys/arch/xen/include/evtchn.h
diff -r1.35.6.5 -r1.35.6.6 src/sys/arch/xen/x86/xen_ipi.c
diff -r1.88.2.10 -r1.88.2.11 src/sys/arch/xen/xen/evtchn.c

cvs diff -r1.28.2.2 -r1.28.2.3 src/sys/arch/xen/include/evtchn.h (expand / switch to context diff)
--- src/sys/arch/xen/include/evtchn.h 2020/04/20 11:29:00 1.28.2.2
+++ src/sys/arch/xen/include/evtchn.h 2020/04/20 19:46:44 1.28.2.3
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.h,v 1.28.2.2 2020/04/20 11:29:00 bouyer Exp $	*/
+/*	$NetBSD: evtchn.h,v 1.28.2.3 2020/04/20 19:46:44 bouyer Exp $	*/
 
 /*
  *
@@ -41,8 +41,8 @@
 unsigned int evtchn_do_event(int, struct intrframe *);
 void call_evtchn_do_event(int, struct intrframe *);
 void call_xenevt_event(int);
-int event_set_handler(int, int (*func)(void *), void *, int, const char *,
-    const char *, bool, bool);
+struct intrhand *event_set_handler(int, int (*func)(void *), void *,
+    int, const char *, const char *, bool, bool);
 int event_remove_handler(int, int (*func)(void *), void *);
 
 struct cpu_info;

cvs diff -r1.35.6.5 -r1.35.6.6 src/sys/arch/xen/x86/xen_ipi.c (expand / switch to context diff)
--- src/sys/arch/xen/x86/xen_ipi.c 2020/04/20 11:29:01 1.35.6.5
+++ src/sys/arch/xen/x86/xen_ipi.c 2020/04/20 19:46:44 1.35.6.6
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.35.6.5 2020/04/20 11:29:01 bouyer Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.35.6.6 2020/04/20 19:46:44 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  * Based on: x86/ipi.c
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35.6.5 2020/04/20 11:29:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35.6.6 2020/04/20 19:46:44 bouyer Exp $");
 
 #include "opt_ddb.h"
 
@@ -143,7 +143,7 @@
 	    device_xname(ci->ci_dev));
 
 	if (event_set_handler(evtchn, xen_ipi_handler, ci, IPL_HIGH, NULL,
-	    intr_xname, true, false) != 0) {
+	    intr_xname, true, false) == NULL) {
 		panic("%s: unable to register ipi handler\n", __func__);
 		/* NOTREACHED */
 	}

cvs diff -r1.88.2.10 -r1.88.2.11 src/sys/arch/xen/xen/evtchn.c (expand / switch to context diff)
--- src/sys/arch/xen/xen/evtchn.c 2020/04/20 11:29:01 1.88.2.10
+++ src/sys/arch/xen/xen/evtchn.c 2020/04/20 19:46:44 1.88.2.11
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.88.2.10 2020/04/20 11:29:01 bouyer Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.88.2.11 2020/04/20 19:46:44 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.10 2020/04/20 11:29:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.11 2020/04/20 19:46:44 bouyer Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -885,10 +885,11 @@
 		if (bind) {
 			op.cmd = EVTCHNOP_bind_vcpu;
 			op.u.bind_vcpu.port = evtch;
-			op.u.bind_vcpu.vcpu = ci->ci_cpuid;
+			op.u.bind_vcpu.vcpu = ci->ci_vcpuid;
 			if (HYPERVISOR_event_channel_op(&op) != 0) {
-				panic("Failed to bind event %d to "
-				    "VCPU %"PRIuCPUID, evtch, ci->ci_cpuid);
+				panic("Failed to bind event %d to VCPU  %s %d",
+				    evtch, device_xname(ci->ci_dev),
+				    ci->ci_vcpuid);
 			}
 		}
 	} else {
@@ -955,15 +956,14 @@
 		ipls->is_recurse = xenev_stubs[level - IPL_VM].ist_recurse;
 		ipls->is_resume = xenev_stubs[level - IPL_VM].ist_resume;
 		ipls->is_handlers = ih;
-		ipls->is_maxlevel = level;
 		ipls->is_pic = &xen_pic;
 		ci->ci_isources[sir] = ipls;
-		x86_intr_calculatemasks(ci);
 	} else {
 		ipls = ci->ci_isources[sir];
 		ih->ih_next = ipls->is_handlers;
 		ipls->is_handlers = ih;
 	}
+	x86_intr_calculatemasks(ci);
 }
 
 int