Module Name: src
Committed By: riastradh
Date: Wed Jul 26 21:45:29 UTC 2023
Modified Files:
src/sys/arch/x86/x86: pmap.c
Log Message:
x86/pmap: Print quantities in failed assertions in pmap_load.
To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/sys/arch/x86/x86/pmap.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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.424 src/sys/arch/x86/x86/pmap.c:1.425
--- src/sys/arch/x86/x86/pmap.c:1.424 Sun Jul 16 19:55:43 2023
+++ src/sys/arch/x86/x86/pmap.c Wed Jul 26 21:45:28 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.424 2023/07/16 19:55:43 riastradh Exp $ */
+/* $NetBSD: pmap.c,v 1.425 2023/07/26 21:45:28 riastradh Exp $ */
/*
* Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.424 2023/07/16 19:55:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.425 2023/07/26 21:45:28 riastradh Exp $");
#include "opt_user_ldt.h"
#include "opt_lockdebug.h"
@@ -3574,6 +3574,8 @@ pmap_load(void)
struct pmap *pmap, *oldpmap;
struct lwp *l;
uint64_t ncsw;
+ int ilevel __diagused;
+ u_long psl __diagused;
kpreempt_disable();
retry:
@@ -3587,12 +3589,12 @@ pmap_load(void)
__insn_barrier();
/* should be able to take ipis. */
- KASSERT(ci->ci_ilevel < IPL_HIGH);
+ KASSERTMSG((ilevel = ci->ci_ilevel) < IPL_HIGH, "ilevel=%d", ilevel);
#ifdef XENPV
/* Check to see if interrupts are enabled (ie; no events are masked) */
- KASSERT(x86_read_psl() == 0);
+ KASSERTMSG((psl = x86_read_psl()) == 0, "psl=0x%lx", psl);
#else
- KASSERT((x86_read_psl() & PSL_I) != 0);
+ KASSERTMSG(((psl = x86_read_psl()) & PSL_I) != 0, "psl=0x%lx", psl);
#endif
KASSERT(l != NULL);