Source-Changes-HG archive

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

[src/netbsd-8]: src/sys Pull up following revision(s) (requested by mrg in ti...



details:   https://anonhg.NetBSD.org/src/rev/cdc67cc9b1ff
branches:  netbsd-8
changeset: 435249:cdc67cc9b1ff
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Sep 07 12:34:18 2018 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1013):

        sys/sys/lockdebug.h: revision 1.20
        sys/ddb/db_command.c: revision 1.155
        sys/kern/subr_lockdebug.c: revision 1.65

add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts.  use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.

diffstat:

 sys/ddb/db_command.c      |   8 ++++++--
 sys/kern/subr_lockdebug.c |  17 +++++++++++++++--
 sys/sys/lockdebug.h       |   3 ++-
 3 files changed, 23 insertions(+), 5 deletions(-)

diffs (84 lines):

diff -r 5ebbd1f8eedc -r cdc67cc9b1ff sys/ddb/db_command.c
--- a/sys/ddb/db_command.c      Fri Sep 07 12:31:30 2018 +0000
+++ b/sys/ddb/db_command.c      Fri Sep 07 12:34:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_command.c,v 1.148.8.2 2018/07/31 17:01:20 martin Exp $      */
+/*     $NetBSD: db_command.c,v 1.148.8.3 2018/09/07 12:34:18 martin Exp $      */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.148.8.2 2018/07/31 17:01:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.148.8.3 2018/09/07 12:34:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -1351,6 +1351,10 @@
         * called from cpu_reboot.
         */
        db_recover = 0;
+       /* Avoid all mutex errors */
+#ifdef LOCKDEBUG
+       lockdebug_dismiss();
+#endif
        panicstr = "reboot forced via kernel debugger";
        cpu_reboot((int)bootflags, NULL);
 #else  /* _KERNEL */
diff -r 5ebbd1f8eedc -r cdc67cc9b1ff sys/kern/subr_lockdebug.c
--- a/sys/kern/subr_lockdebug.c Fri Sep 07 12:31:30 2018 +0000
+++ b/sys/kern/subr_lockdebug.c Fri Sep 07 12:34:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_lockdebug.c,v 1.57.2.1 2018/04/02 09:07:52 martin Exp $   */
+/*     $NetBSD: subr_lockdebug.c,v 1.57.2.2 2018/09/07 12:34:18 martin Exp $   */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.57.2.1 2018/04/02 09:07:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.57.2.2 2018/09/07 12:34:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -977,6 +977,19 @@
 #endif /* DDB */
 
 /*
+ * lockdebug_dismiss:
+ *
+ *      The system is rebooting, and potentially from an unsafe
+ *      place so avoid any future aborts.
+ */
+void
+lockdebug_dismiss(void)
+{
+
+       atomic_inc_uint_nv(&ld_panic);
+}
+
+/*
  * lockdebug_abort:
  *
  *     An error has been trapped - dump lock info and call panic().
diff -r 5ebbd1f8eedc -r cdc67cc9b1ff sys/sys/lockdebug.h
--- a/sys/sys/lockdebug.h       Fri Sep 07 12:31:30 2018 +0000
+++ b/sys/sys/lockdebug.h       Fri Sep 07 12:34:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lockdebug.h,v 1.15.6.1 2018/04/02 09:07:53 martin Exp $        */
+/*     $NetBSD: lockdebug.h,v 1.15.6.2 2018/09/07 12:34:18 martin Exp $        */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@
 #define        LOCKDEBUG_ABORT(f, ln, l, o, m) \
     lockdebug_abort(f, ln, l, o, m)
 
+void   lockdebug_dismiss(void);
 void   lockdebug_abort(const char *, size_t, volatile void *, lockops_t *,
     const char *);
 



Home | Main Index | Thread Index | Old Index