Module Name: src
Committed By: martin
Date: Tue Apr 23 18:22:37 UTC 2019
Modified Files:
src/sys/arch/arm/arm32 [netbsd-8]: pmap.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.349.2.1 -r1.349.2.2 src/sys/arch/arm/arm32/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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.349.2.1 src/sys/arch/arm/arm32/pmap.c:1.349.2.2
--- src/sys/arch/arm/arm32/pmap.c:1.349.2.1 Thu Nov 2 21:29:51 2017
+++ src/sys/arch/arm/arm32/pmap.c Tue Apr 23 18:22:37 2019
@@ -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 @@ vaddr_t pmap_directlimit;
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 @@ pmap_acquire_pmap_lock(pmap_t pm)
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);