Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107357018
D34267.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
831 B
Referenced Files
None
Subscribers
None
D34267.diff
View Options
diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c
--- a/sys/riscv/riscv/pmap.c
+++ b/sys/riscv/riscv/pmap.c
@@ -1231,12 +1231,20 @@
CPU_ZERO(&pmap->pm_active);
+ /*
+ * Copy L1 entries from the kernel pmap. This must be done with the
+ * allpmaps lock held to avoid races with pmap_distribute_l1().
+ */
mtx_lock(&allpmaps_lock);
LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
+ for (size_t i = pmap_l1_index(VM_MIN_KERNEL_ADDRESS);
+ i < pmap_l1_index(VM_MAX_KERNEL_ADDRESS); i++)
+ pmap->pm_l1[i] = kernel_pmap->pm_l1[i];
+ for (size_t i = pmap_l1_index(DMAP_MIN_ADDRESS);
+ i < pmap_l1_index(DMAP_MAX_ADDRESS); i++)
+ pmap->pm_l1[i] = kernel_pmap->pm_l1[i];
mtx_unlock(&allpmaps_lock);
- memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE);
-
vm_radix_init(&pmap->pm_root);
return (1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 13, 11:57 PM (21 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15788912
Default Alt Text
D34267.diff (831 B)
Attached To
Mode
D34267: riscv: Fix another race in pmap_pinit()
Attached
Detach File
Event Timeline
Log In to Comment