Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148305417
D18721.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18721.diff
View Options
Index: head/sys/riscv/riscv/pmap.c
===================================================================
--- head/sys/riscv/riscv/pmap.c
+++ head/sys/riscv/riscv/pmap.c
@@ -228,6 +228,7 @@
CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS);
static struct rwlock_padalign pvh_global_lock;
+static struct mtx_padalign allpmaps_lock;
/*
* Data for the pv entry allocation mechanism
@@ -380,10 +381,12 @@
if (pmap != kernel_pmap)
return;
+ mtx_lock(&allpmaps_lock);
LIST_FOREACH(user_pmap, &allpmaps, pm_list) {
l1 = &user_pmap->pm_l1[l1index];
pmap_store(l1, entry);
}
+ mtx_unlock(&allpmaps_lock);
}
static pt_entry_t *
@@ -636,9 +639,10 @@
int i;
/*
- * Initialize the pv chunk list mutex.
+ * Initialize the pv chunk and pmap list mutexes.
*/
mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF);
+ mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_DEF);
/*
* Initialize the pool of pv list locks.
@@ -1132,7 +1136,9 @@
memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE);
/* Add to the list of all user pmaps */
+ mtx_lock(&allpmaps_lock);
LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
+ mtx_unlock(&allpmaps_lock);
return (1);
}
@@ -1296,7 +1302,9 @@
vm_page_free_zero(m);
/* Remove pmap from the allpmaps list */
+ mtx_lock(&allpmaps_lock);
LIST_REMOVE(pmap, pm_list);
+ mtx_unlock(&allpmaps_lock);
/* Remove kernel pagetables */
bzero(pmap->pm_l1, PAGE_SIZE);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 2:11 AM (7 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29851262
Default Alt Text
D18721.diff (1 KB)
Attached To
Mode
D18721: Synchronize access to the allpmaps list.
Attached
Detach File
Event Timeline
Log In to Comment