Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108682114
D34270.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D34270.diff
View Options
diff --git a/sys/riscv/include/pmap.h b/sys/riscv/include/pmap.h
--- a/sys/riscv/include/pmap.h
+++ b/sys/riscv/include/pmap.h
@@ -80,7 +80,7 @@
struct pmap {
struct mtx pm_mtx;
struct pmap_statistics pm_stats; /* pmap statictics */
- pd_entry_t *pm_l1;
+ pd_entry_t *pm_top; /* top-level page table page */
u_long pm_satp; /* value for SATP register */
cpuset_t pm_active; /* active on cpus */
TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */
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
@@ -353,7 +353,7 @@
KASSERT(VIRT_IS_VALID(va),
("%s: malformed virtual address %#lx", __func__, va));
- return (&pmap->pm_l1[pmap_l1_index(va)]);
+ return (&pmap->pm_top[pmap_l1_index(va)]);
}
static __inline pd_entry_t *
@@ -442,7 +442,7 @@
mtx_lock(&allpmaps_lock);
LIST_FOREACH(user_pmap, &allpmaps, pm_list) {
- l1 = &user_pmap->pm_l1[l1index];
+ l1 = &user_pmap->pm_top[l1index];
pmap_store(l1, entry);
}
mtx_unlock(&allpmaps_lock);
@@ -572,7 +572,7 @@
printf("pmap_bootstrap %lx %lx %lx\n", l1pt, kernstart, kernlen);
/* Set this early so we can use the pagetable walking functions */
- kernel_pmap_store.pm_l1 = (pd_entry_t *)l1pt;
+ kernel_pmap_store.pm_top = (pd_entry_t *)l1pt;
PMAP_LOCK_INIT(kernel_pmap);
rw_init(&pvh_global_lock, "pmap pv global");
@@ -1205,8 +1205,8 @@
PMAP_LOCK_INIT(pmap);
bzero(&pmap->pm_stats, sizeof(pmap->pm_stats));
- pmap->pm_l1 = kernel_pmap->pm_l1;
- pmap->pm_satp = SATP_MODE_SV39 | (vtophys(pmap->pm_l1) >> PAGE_SHIFT);
+ pmap->pm_top = kernel_pmap->pm_top;
+ pmap->pm_satp = SATP_MODE_SV39 | (vtophys(pmap->pm_top) >> PAGE_SHIFT);
CPU_ZERO(&pmap->pm_active);
pmap_activate_boot(pmap);
}
@@ -1214,18 +1214,15 @@
int
pmap_pinit(pmap_t pmap)
{
- vm_paddr_t l1phys;
- vm_page_t l1pt;
+ vm_paddr_t topphys;
+ vm_page_t mtop;
- /*
- * allocate the l1 page
- */
- l1pt = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO |
+ mtop = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO |
VM_ALLOC_WAITOK);
- l1phys = VM_PAGE_TO_PHYS(l1pt);
- pmap->pm_l1 = (pd_entry_t *)PHYS_TO_DMAP(l1phys);
- pmap->pm_satp = SATP_MODE_SV39 | (l1phys >> PAGE_SHIFT);
+ topphys = VM_PAGE_TO_PHYS(mtop);
+ pmap->pm_top = (pd_entry_t *)PHYS_TO_DMAP(topphys);
+ pmap->pm_satp = SATP_MODE_SV39 | (topphys >> PAGE_SHIFT);
bzero(&pmap->pm_stats, sizeof(pmap->pm_stats));
@@ -1239,10 +1236,10 @@
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];
+ pmap->pm_top[i] = kernel_pmap->pm_top[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];
+ pmap->pm_top[i] = kernel_pmap->pm_top[i];
mtx_unlock(&allpmaps_lock);
vm_radix_init(&pmap->pm_root);
@@ -1303,7 +1300,7 @@
vm_pindex_t l1index;
l1index = ptepindex - NUL2E;
- l1 = &pmap->pm_l1[l1index];
+ l1 = &pmap->pm_top[l1index];
KASSERT((pmap_load(l1) & PTE_V) == 0,
("%s: L1 entry %#lx is valid", __func__, pmap_load(l1)));
@@ -1317,7 +1314,7 @@
pd_entry_t *l1, *l2;
l1index = ptepindex >> (L1_SHIFT - L2_SHIFT);
- l1 = &pmap->pm_l1[l1index];
+ l1 = &pmap->pm_top[l1index];
if (pmap_load(l1) == 0) {
/* recurse for allocating page dir */
if (_pmap_alloc_l3(pmap, NUL2E + l1index,
@@ -1437,7 +1434,7 @@
LIST_REMOVE(pmap, pm_list);
mtx_unlock(&allpmaps_lock);
- m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1));
+ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_top));
vm_page_unwire_noq(m);
vm_page_free(m);
}
@@ -4729,7 +4726,7 @@
else if (i == pmap_l1_index(VM_MIN_KERNEL_ADDRESS))
sbuf_printf(sb, "\nKernel map:\n");
- l1e = kernel_pmap->pm_l1[i];
+ l1e = kernel_pmap->pm_top[i];
if ((l1e & PTE_V) == 0) {
sysctl_kmaps_dump(sb, &range, sva);
sva += L1_SIZE;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 28, 7:03 AM (4 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16257546
Default Alt Text
D34270.diff (3 KB)
Attached To
Mode
D34270: riscv: Rename struct pmap's pm_l1 field to pm_top
Attached
Detach File
Event Timeline
Log In to Comment