Module Name: src
Committed By: jdolecek
Date: Mon Apr 6 18:02:33 UTC 2020
Modified Files:
src/sys/arch/xen/include: evtchn.h
src/sys/arch/xen/x86: xen_intr.c
src/sys/arch/xen/xen: evtchn.c
Log Message:
remove restriction on interrupt level for MP-safe interrupt handlers
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/include/evtchn.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/x86/xen_intr.c
cvs rdiff -u -r1.86 -r1.87 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/include/evtchn.h
diff -u src/sys/arch/xen/include/evtchn.h:1.26 src/sys/arch/xen/include/evtchn.h:1.27
--- src/sys/arch/xen/include/evtchn.h:1.26 Sun Jun 24 13:35:32 2018
+++ src/sys/arch/xen/include/evtchn.h Mon Apr 6 18:02:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: evtchn.h,v 1.26 2018/06/24 13:35:32 jdolecek Exp $ */
+/* $NetBSD: evtchn.h,v 1.27 2020/04/06 18:02:33 jdolecek Exp $ */
/*
*
@@ -42,7 +42,7 @@ unsigned int evtchn_do_event(int, struct
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 *);
+ const char *, bool);
int event_remove_handler(int, int (*func)(void *), void *);
struct cpu_info;
Index: src/sys/arch/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.19 src/sys/arch/xen/x86/xen_intr.c:1.20
--- src/sys/arch/xen/x86/xen_intr.c:1.19 Fri Apr 3 22:20:36 2020
+++ src/sys/arch/xen/x86/xen_intr.c Mon Apr 6 18:02:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $ */
+/* $NetBSD: xen_intr.c,v 1.20 2020/04/06 18:02:33 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.20 2020/04/06 18:02:33 jdolecek Exp $");
#include "opt_multiprocessor.h"
@@ -166,17 +166,11 @@ xen_intr_establish_xname(int legacy_irq,
if (pic->pic_type == PIC_XEN) {
struct intrhand *rih;
- /*
- * event_set_handler interprets `level != IPL_VM' to
- * mean MP-safe, so we require the caller to match that
- * for the moment.
- */
- KASSERT(known_mpsafe == (level != IPL_VM));
-
intrstr = intr_create_intrid(legacy_irq, pic, pin, intrstr_buf,
sizeof(intrstr_buf));
- event_set_handler(pin, handler, arg, level, intrstr, xname);
+ event_set_handler(pin, handler, arg, level, intrstr, xname,
+ known_mpsafe);
rih = kmem_zalloc(sizeof(*rih), cold ? KM_NOSLEEP : KM_SLEEP);
if (rih == NULL) {
Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.86 src/sys/arch/xen/xen/evtchn.c:1.87
--- src/sys/arch/xen/xen/evtchn.c:1.86 Thu May 9 17:09:51 2019
+++ src/sys/arch/xen/xen/evtchn.c Mon Apr 6 18:02:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: evtchn.c,v 1.86 2019/05/09 17:09:51 bouyer Exp $ */
+/* $NetBSD: evtchn.c,v 1.87 2020/04/06 18:02:33 jdolecek Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.86 2019/05/09 17:09:51 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.87 2020/04/06 18:02:33 jdolecek Exp $");
#include "opt_xen.h"
#include "isa.h"
@@ -834,15 +834,12 @@ intr_calculatemasks(struct evtsource *ev
int
event_set_handler(int evtch, int (*func)(void *), void *arg, int level,
- const char *intrname, const char *xname)
+ const char *intrname, const char *xname, bool mpsafe)
{
struct cpu_info *ci = curcpu(); /* XXX: pass in ci ? */
struct evtsource *evts;
struct intrhand *ih, **ihp;
int s;
-#ifdef MULTIPROCESSOR
- bool mpsafe = (level != IPL_VM);
-#endif /* MULTIPROCESSOR */
#ifdef IRQ_DEBUG
printf("event_set_handler IRQ %d handler %p\n", evtch, func);