summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc64
diff options
context:
space:
mode:
authorGeorge Koehler <gkoehler@cvs.openbsd.org>2024-04-03 19:31:00 +0000
committerGeorge Koehler <gkoehler@cvs.openbsd.org>2024-04-03 19:31:00 +0000
commit2418f5dbbba5b18957d9c8fa47e9cbdf63797f55 (patch)
tree0a37960dc25e98f67160d6e071c6509b6a013047 /sys/arch/powerpc64
parent9fd1f73d56fa2dd2d71dcf9e12bdd79071d2351e (diff)
Initialize earlier macppc's and powerpc64's pmap_hash_lock
At boot, the powerpc64 kernel was calling pmap_bootstrap -> pmap_kenter_pa -> mtx_enter(&pmap_hash_lock) before it did pmap_init -> mtx_init(&pmap_hash_lock, IPL_HIGH) Change from mtx_init to MUTEX_INITIALIZER. This allows an option WITNESS kernel to boot without warning of an uninitialized mutex. Also change macppc's pmap_hash_lock from __ppc_lock_init to PPC_LOCK_INITIALIZER, though WITNESS doesn't see this lock. ok mpi@
Diffstat (limited to 'sys/arch/powerpc64')
-rw-r--r--sys/arch/powerpc64/powerpc64/pmap.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/arch/powerpc64/powerpc64/pmap.c b/sys/arch/powerpc64/powerpc64/pmap.c
index 3e17df7ec4e..53c2badc438 100644
--- a/sys/arch/powerpc64/powerpc64/pmap.c
+++ b/sys/arch/powerpc64/powerpc64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.60 2023/04/13 15:23:22 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.61 2024/04/03 19:30:59 gkoehler Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
@@ -67,9 +67,7 @@ extern char _start[], _etext[], _erodata[], _end[];
#ifdef MULTIPROCESSOR
-struct mutex pmap_hash_lock;
-
-#define PMAP_HASH_LOCK_INIT() mtx_init(&pmap_hash_lock, IPL_HIGH)
+struct mutex pmap_hash_lock = MUTEX_INITIALIZER(IPL_HIGH);
#define PMAP_HASH_LOCK(s) \
do { \
@@ -104,7 +102,6 @@ do { \
#else
-#define PMAP_HASH_LOCK_INIT() /* nothing */
#define PMAP_HASH_LOCK(s) (void)s
#define PMAP_HASH_UNLOCK(s) /* nothing */
@@ -1036,8 +1033,6 @@ pmap_init(void)
"slbd", NULL);
pool_setlowat(&pmap_slbd_pool, 5);
- PMAP_HASH_LOCK_INIT();
-
LIST_INIT(&pmap_kernel()->pm_slbd);
for (i = 0; i < nitems(kernel_slb_desc); i++) {
LIST_INSERT_HEAD(&pmap_kernel()->pm_slbd,