PERFORCE change 28528 for review
Peter Wemm
peter at FreeBSD.org
Tue Apr 8 10:07:06 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=28528
Change 28528 by peter at peter_daintree on 2003/04/08 10:06:24
What the heck. turn on PG_G and PG_PS unconditionally. It seems to work.
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#52 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#22 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#52 (text+ko) ====
@@ -1084,25 +1084,24 @@
/* Fill in the underlying page table pages */
/* Read-only from zero to physfree */
- /* XXX not actually used, underneath 2M pages */
+ /* XXX not fully used, underneath 2M pages */
for (i = 0; (i << PAGE_SHIFT) < physfree; i++) {
((pt_entry_t *)KPTphys)[i] = i << PAGE_SHIFT;
((pt_entry_t *)KPTphys)[i] |= PG_RW | PG_V;
}
-#if ENABLE_PSE
+ /* Now map the page tables at their location within PTmap */
+ for (i = 0; i < NKPT; i++) {
+ ((pd_entry_t *)IdlePTD)[i + KPTDI] = KPTphys + (i << PAGE_SHIFT);
+ ((pd_entry_t *)IdlePTD)[i + KPTDI] |= PG_RW | PG_V;
+ }
+
/* Map from zero to end of allocations under 2M pages */
+ /* This replaces some of the PTD entries above */
for (i = 0; (i << PDRSHIFT) < physfree; i++) {
((pd_entry_t *)IdlePTD)[i] = i << PDRSHIFT;
((pd_entry_t *)IdlePTD)[i] |= PG_RW | PG_V | PG_PS;
}
-#endif
-
- /* Now map the page tables at their location within PTmap */
- for (i = 0; i < NKPT; i++) {
- ((pd_entry_t *)IdlePTD)[i + KPTDI] = KPTphys + (i << PAGE_SHIFT);
- ((pd_entry_t *)IdlePTD)[i + KPTDI] |= PG_RW | PG_V;
- }
/* Now map the page tables at their location within PTmap */
for (i = 0; i < NKPT; i++) {
==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#22 (text+ko) ====
@@ -180,8 +180,6 @@
vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */
vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */
static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */
-static int pgeflag; /* PG_G or-in */
-static int pseflag; /* PG_PS or-in */
static int nkpt;
vm_offset_t kernel_vm_end;
@@ -250,9 +248,7 @@
{
vm_offset_t newaddr = addr;
-#if ENABLE_PSE
newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1);
-#endif
return newaddr;
}
@@ -359,15 +355,6 @@
for (i = 0; i < NKPT; i++)
PTD[i] = 0;
- pgeflag = 0;
-
-/*
- * Initialize the 2MB page size flag
- */
-#if ENABLE_PSE
- pseflag = PG_PS;
-#endif
-
invltlb();
}
@@ -595,7 +582,7 @@
pt_entry_t *pte;
pte = vtopte(va);
- *pte = pa | PG_RW | PG_V | pgeflag;
+ *pte = pa | PG_RW | PG_V | PG_G;
}
/*
@@ -1901,7 +1888,7 @@
if (va < VM_MAXUSER_ADDRESS)
newpte |= PG_U;
if (pmap == kernel_pmap)
- newpte |= pgeflag;
+ newpte |= PG_G;
/*
* if the mapping or permission bits are different, we need
@@ -2057,7 +2044,7 @@
* processor address space. Note that some shortcuts
* are taken, but the code works.
*/
- if (pseflag && (object->type == OBJT_DEVICE) &&
+ if ((object->type == OBJT_DEVICE) &&
((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) {
int i;
vm_page_t m[1];
More information about the p4-projects
mailing list