Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 x86/pmap: Print quantities in failed assert...



details:   https://anonhg.NetBSD.org/src/rev/6b7020ba0bad
branches:  trunk
changeset: 378212:6b7020ba0bad
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 26 21:45:28 2023 +0000

description:
x86/pmap: Print quantities in failed assertions in pmap_load.

diffstat:

 sys/arch/x86/x86/pmap.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 5e8863a9e680 -r 6b7020ba0bad sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Wed Jul 26 18:00:51 2023 +0000
+++ b/sys/arch/x86/x86/pmap.c   Wed Jul 26 21:45:28 2023 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index