Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/arch/arm/arm32 Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/6d0a868616d5
branches:  netbsd-8
changeset: 450712:6d0a868616d5
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Apr 23 18:22:37 2019 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1245):

        sys/arch/arm/arm32/pmap.c: revision 1.372

Don't try to aquire/release the pmap lock when in ddb.

Avoids a deadlock when entering ddb, or on "mach cpu n" ddb command
(the pmap lock may already be held by another CPU, which is halted when
entering ddb).

Posted to port-arm@ on April 19.

diffstat:

 sys/arch/arm/arm32/pmap.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r ded9a9df33a4 -r 6d0a868616d5 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Tue Apr 23 10:40:16 2019 +0000
+++ b/sys/arch/arm/arm32/pmap.c Tue Apr 23 18:22:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.349.2.1 2017/11/02 21:29:51 snj Exp $       */
+/*     $NetBSD: pmap.c,v 1.349.2.2 2019/04/23 18:22:37 martin Exp $    */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,11 @@
 
 #include <arm/locore.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.349.2.1 2017/11/02 21:29:51 snj Exp $");
+#ifdef DDB
+#include <arm/db_machdep.h>
+#endif
+
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.349.2.2 2019/04/23 18:22:37 martin Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -531,6 +535,11 @@
 static inline void
 pmap_acquire_pmap_lock(pmap_t pm)
 {
+#if defined(MULTIPROCESSOR) && defined(DDB)
+       if (db_onproc != NULL)
+               return;
+#endif
+       
        if (pm == pmap_kernel()) {
 #ifdef MULTIPROCESSOR
                KERNEL_LOCK(1, NULL);
@@ -543,6 +552,10 @@
 static inline void
 pmap_release_pmap_lock(pmap_t pm)
 {
+#if defined(MULTIPROCESSOR) && defined(DDB)
+       if (db_onproc != NULL)
+               return;
+#endif
        if (pm == pmap_kernel()) {
 #ifdef MULTIPROCESSOR
                KERNEL_UNLOCK_ONE(NULL);



Home | Main Index | Thread Index | Old Index