diff --git a/sys/arch/x86/include/intr.h b/sys/arch/x86/include/intr.h index 96ccc487257e..c6df1cf97fc1 100644 --- a/sys/arch/x86/include/intr.h +++ b/sys/arch/x86/include/intr.h @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.62 2020/04/25 15:26:18 bouyer Exp $ */ +/* $NetBSD: intr.h,v 1.63 2022/03/12 15:50:44 riastradh Exp $ */ /*- * Copyright (c) 1998, 2001, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc. @@ -145,6 +145,7 @@ struct intrhand { struct intrhand *ih_evt_next; #endif struct cpu_info *ih_cpu; + char ih_xname[INTRDEVNAMEBUF]; }; #define IMASK(ci,level) (ci)->ci_imask[(level)] diff --git a/sys/arch/x86/x86/intr.c b/sys/arch/x86/x86/intr.c index a822591a1044..8247c8fcae68 100644 --- a/sys/arch/x86/x86/intr.c +++ b/sys/arch/x86/x86/intr.c @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.159 2021/12/23 02:45:43 yamaguchi Exp $ */ +/* $NetBSD: intr.c,v 1.160 2022/03/12 15:50:45 riastradh Exp $ */ /* * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.159 2021/12/23 02:45:43 yamaguchi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.160 2022/03/12 15:50:45 riastradh Exp $"); #include "opt_intrdebug.h" #include "opt_multiprocessor.h" @@ -653,11 +653,16 @@ static int intr_biglock_wrapper(void *vp) { struct intrhand *ih = vp; + int locks; int ret; KERNEL_LOCK(1, NULL); + locks = curcpu()->ci_biglock_count; ret = (*ih->ih_realfun)(ih->ih_realarg); + KASSERTMSG(locks == curcpu()->ci_biglock_count, + "%s @ %p slipped locks %d -> %d", + ih->ih_xname, ih->ih_realfun, locks, curcpu()->ci_biglock_count); KERNEL_UNLOCK_ONE(NULL); @@ -904,6 +909,7 @@ intr_establish_xname(int legacy_irq, struct pic *pic, int pin, int type, ih->ih_pin = pin; ih->ih_cpu = ci; ih->ih_slot = slot; + strlcpy(ih->ih_xname, xname, sizeof(ih->ih_xname)); #ifdef MULTIPROCESSOR if (!mpsafe) { ih->ih_fun = intr_biglock_wrapper;