KERNEL_LOCK(9): Limit ipi trace diagnostic to after init has started.

This commit is contained in:
riastradh 2022-08-20 23:37:12 +00:00
parent ffbd2bca51
commit c45e9f40fe
1 changed files with 5 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lock.c,v 1.177 2022/08/16 21:23:37 riastradh Exp $ */
/* $NetBSD: kern_lock.c,v 1.178 2022/08/20 23:37:12 riastradh Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.177 2022/08/16 21:23:37 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.178 2022/08/20 23:37:12 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_lockdebug.h"
@ -253,8 +253,8 @@ _kernel_lock(int nlocks)
splx(s);
while (__SIMPLELOCK_LOCKED_P(kernel_lock)) {
#ifdef LOCKDEBUG
if (SPINLOCK_SPINOUT(spins)) {
extern int start_init_exec;
extern int start_init_exec;
if (SPINLOCK_SPINOUT(spins) && start_init_exec) {
ipi_msg_t msg = {
.func = kernel_lock_trace_ipi,
};
@ -262,8 +262,7 @@ _kernel_lock(int nlocks)
ipi_unicast(&msg, kernel_lock_holder);
ipi_wait(&msg);
kpreempt_enable();
if (start_init_exec)
_KERNEL_LOCK_ABORT("spinout");
_KERNEL_LOCK_ABORT("spinout");
}
SPINLOCK_BACKOFF_HOOK;
SPINLOCK_SPIN_HOOK;