Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107304149
D34277.id102763.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
D34277.id102763.diff
View Options
Index: sys/riscv/riscv/pmap.c
===================================================================
--- sys/riscv/riscv/pmap.c
+++ sys/riscv/riscv/pmap.c
@@ -486,8 +486,13 @@
struct pmap *user_pmap;
pd_entry_t *l1;
- /* Distribute new kernel L1 entry to all the user pmaps */
- if (pmap != kernel_pmap)
+ /*
+ * Distribute new kernel L1 entry to all the user pmaps. This is only
+ * necessary with three-level paging configured: with four-level paging
+ * the kernel's half of the top-level page table page is static and can
+ * simply be copied at pmap initialization time.
+ */
+ if (pmap != kernel_pmap || pmap_mode != PMAP_MODE_SV39)
return;
mtx_lock(&allpmaps_lock);
@@ -1278,11 +1283,15 @@
CPU_ZERO(&pmap->pm_active);
- mtx_lock(&allpmaps_lock);
- LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
- mtx_unlock(&allpmaps_lock);
+ if (pmap_mode == PMAP_MODE_SV39) {
+ mtx_lock(&allpmaps_lock);
+ LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
+ mtx_unlock(&allpmaps_lock);
- memcpy(pmap->pm_top, kernel_pmap->pm_top, PAGE_SIZE);
+ memcpy(pmap->pm_top, kernel_pmap->pm_top, PAGE_SIZE);
+ } else {
+ memcpy(pmap->pm_top, kernel_pmap->pm_top, PAGE_SIZE);
+ }
vm_radix_init(&pmap->pm_root);
@@ -1472,9 +1481,11 @@
KASSERT(CPU_EMPTY(&pmap->pm_active),
("releasing active pmap %p", pmap));
- mtx_lock(&allpmaps_lock);
- LIST_REMOVE(pmap, pm_list);
- mtx_unlock(&allpmaps_lock);
+ if (pmap_mode == PMAP_MODE_SV39) {
+ mtx_lock(&allpmaps_lock);
+ LIST_REMOVE(pmap, pm_list);
+ mtx_unlock(&allpmaps_lock);
+ }
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_top));
vm_page_unwire_noq(m);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 13, 6:31 AM (11 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15777688
Default Alt Text
D34277.id102763.diff (1 KB)
Attached To
Mode
D34277: riscv: Maintain the allpmaps list only in SV39 mode
Attached
Detach File
Event Timeline
Log In to Comment