Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen Add kasserts to help diagnose xen interrupt...



details:   https://anonhg.NetBSD.org/src/rev/2b75ec8ebc0a
branches:  trunk
changeset: 357445:2b75ec8ebc0a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Nov 11 08:23:50 2017 +0000

description:
Add kasserts to help diagnose xen interrupt level bug.

https://mail-index.netbsd.org/tech-kern/2017/11/09/msg022571.html

diffstat:

 sys/arch/xen/xen/evtchn.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 83229f66c6f7 -r 2b75ec8ebc0a sys/arch/xen/xen/evtchn.c
--- a/sys/arch/xen/xen/evtchn.c Sat Nov 11 08:22:08 2017 +0000
+++ b/sys/arch/xen/xen/evtchn.c Sat Nov 11 08:23:50 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evtchn.c,v 1.76 2017/11/11 08:22:08 riastradh Exp $    */
+/*     $NetBSD: evtchn.c,v 1.77 2017/11/11 08:23:50 riastradh Exp $    */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.76 2017/11/11 08:22:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.77 2017/11/11 08:23:50 riastradh Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -386,6 +386,11 @@
                ci->ci_ilevel = ih->ih_level;
                ih_fun = (void *)ih->ih_fun;
                ih_fun(ih->ih_arg, regs);
+               KASSERTMSG(ci->ci_ilevel == ih->ih_level,
+                   "event handler %p for evtsource[%d] (%s) changed ipl:"
+                   " %d != %d",
+                   ih->ih_realfun, evtch, evtsource[evtch]->ev_evname,
+                   ci->ci_ilevel, ih->ih_level);
                ih = ih->ih_evt_next;
        }
        mutex_spin_exit(&evtlock[evtch]);
@@ -410,6 +415,13 @@
                                        sti();
                                        ih_fun = (void *)ih->ih_fun;
                                        ih_fun(ih->ih_arg, regs);
+                                       KASSERTMSG(ci->ci_ilevel == i,
+                                           "interrupt handler %p"
+                                           " for interrupt source %s"
+                                           " changed ipl: %d != %d",
+                                           ih->ih_realfun,
+                                           ci->ci_isources[i]->is_xname,
+                                           ci->ci_ilevel, i);
                                        cli();
                                }
                                hypervisor_enable_ipl(i);



Home | Main Index | Thread Index | Old Index