Page MenuHomeFreeBSD

D33776.id101072.diff
No OneTemporary

D33776.id101072.diff

diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -1516,40 +1516,28 @@
}
}
+pt_entry_t vtoptem __read_mostly = (1ul << (NPTEPGSHIFT + NPDEPGSHIFT +
+ NPDPEPGSHIFT + NPML4EPGSHIFT)) - 1;
+pt_entry_t *PTmap __read_mostly = P4Tmap;
+
PMAP_INLINE pt_entry_t *
vtopte(vm_offset_t va)
{
- u_int64_t mask;
-
KASSERT(va >= VM_MAXUSER_ADDRESS, ("vtopte on a uva/gpa 0x%0lx", va));
- if (la57) {
- mask = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT +
- NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1);
- return (P5Tmap + ((va >> PAGE_SHIFT) & mask));
- } else {
- mask = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT +
- NPML4EPGSHIFT)) - 1);
- return (P4Tmap + ((va >> PAGE_SHIFT) & mask));
- }
+ return (PTmap + ((va >> PAGE_SHIFT) & vtoptem));
}
+pd_entry_t vtopdem __read_mostly = (1ul << (NPDEPGSHIFT + NPDPEPGSHIFT +
+ NPML4EPGSHIFT)) - 1;
+pd_entry_t *PDmap __read_mostly = P4Dmap;
+
static __inline pd_entry_t *
vtopde(vm_offset_t va)
{
- u_int64_t mask;
-
KASSERT(va >= VM_MAXUSER_ADDRESS, ("vtopde on a uva/gpa 0x%0lx", va));
- if (la57) {
- mask = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT +
- NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1);
- return (P5Dmap + ((va >> PDRSHIFT) & mask));
- } else {
- mask = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT +
- NPML4EPGSHIFT)) - 1);
- return (P4Dmap + ((va >> PDRSHIFT) & mask));
- }
+ return (PDmap + ((va >> PDRSHIFT) & vtopdem));
}
static u_int64_t
@@ -2241,6 +2229,13 @@
*/
v_pml5[PML5PML5I] = KPML5phys | X86_PG_RW | X86_PG_V | pg_nx;
+ vtoptem = (1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT +
+ NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1;
+ PTmap = P5Tmap;
+ vtopdem = (1ul << (NPDEPGSHIFT + NPDPEPGSHIFT +
+ NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1;
+ PDmap = P5Dmap;
+
kernel_pmap->pm_cr3 = KPML5phys;
kernel_pmap->pm_pmltop = v_pml5;
pmap_pt_page_count_adj(kernel_pmap, 1);

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 6:24 PM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14744587
Default Alt Text
D33776.id101072.diff (1 KB)

Event Timeline