Use a different bitmask for superpages' base address so that it

doesn't conflict with the PG_PDE_PAT bit.  (We still don't mask
off all the reserved bits but that's okay for now.)

Reviewed by:	alc
This commit is contained in:
Ruslan Ermilov 2006-12-05 11:31:33 +00:00
parent cbc8bb98ef
commit 3cbc967ef7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164912
3 changed files with 6 additions and 9 deletions

View File

@ -215,7 +215,7 @@ minidumpsys(struct dumperinfo *di)
j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) {
/* This is an entire 2M page. */
pa = pd[j] & PG_FRAME & ~PDRMASK;
pa = pd[j] & PG_PS_FRAME;
for (k = 0; k < NPTEPG; k++) {
if (is_dumpable(pa))
dump_add_page(pa);
@ -326,7 +326,7 @@ minidumpsys(struct dumperinfo *di)
j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) {
/* This is a single 2M block. Generate a fake PTP */
pa = pd[j] & PG_FRAME & ~PDRMASK;
pa = pd[j] & PG_PS_FRAME;
for (k = 0; k < NPTEPG; k++) {
fakept[k] = (pa + (k * PAGE_SIZE)) | PG_V | PG_RW | PG_A | PG_M;
}

View File

@ -947,9 +947,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
pde = *pdep;
if (pde) {
if ((pde & PG_PS) != 0) {
KASSERT((pde & PG_FRAME & PDRMASK) == 0,
("pmap_extract: bad pde"));
rtval = (pde & PG_FRAME) | (va & PDRMASK);
rtval = (pde & PG_PS_FRAME) | (va & PDRMASK);
PMAP_UNLOCK(pmap);
return rtval;
}
@ -982,9 +980,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
if (pdep != NULL && (pde = *pdep)) {
if (pde & PG_PS) {
if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) {
KASSERT((pde & PG_FRAME & PDRMASK) == 0,
("pmap_extract_and_hold: bad pde"));
m = PHYS_TO_VM_PAGE((pde & PG_FRAME) |
m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) |
(va & PDRMASK));
vm_page_hold(m);
}
@ -1013,7 +1009,7 @@ pmap_kextract(vm_offset_t va)
} else {
pde = vtopde(va);
if (*pde & PG_PS) {
pa = (*pde & ~(NBPDR - 1)) | (va & (NBPDR - 1));
pa = (*pde & PG_PS_FRAME) | (va & PDRMASK);
} else {
pa = *vtopte(va);
pa = (pa & PG_FRAME) | (va & PAGE_MASK);

View File

@ -71,6 +71,7 @@
#define PG_W PG_AVAIL1 /* "Wired" pseudoflag */
#define PG_MANAGED PG_AVAIL2
#define PG_FRAME (0x000ffffffffff000ul)
#define PG_PS_FRAME (0x000fffffffe00000ul)
#define PG_PROT (PG_RW|PG_U) /* all protection bits . */
#define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */