summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-12-05 11:31:33 +0000
committerru <ru@FreeBSD.org>2006-12-05 11:31:33 +0000
commit0d6f98c10fd6bd3d034f6095aec4c5ff1e0857fa (patch)
treeda999682301e8909336801e129dba45fe433cf71 /sys
parent12df44b4252096a8dc10f2dfb0abcb91abacff85 (diff)
downloadFreeBSD-src-0d6f98c10fd6bd3d034f6095aec4c5ff1e0857fa.zip
FreeBSD-src-0d6f98c10fd6bd3d034f6095aec4c5ff1e0857fa.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/minidump_machdep.c4
-rw-r--r--sys/amd64/amd64/pmap.c10
-rw-r--r--sys/amd64/include/pmap.h1
3 files changed, 6 insertions, 9 deletions
diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c
index 1f7af43..6ad8092 100644
--- a/sys/amd64/amd64/minidump_machdep.c
+++ b/sys/amd64/amd64/minidump_machdep.c
@@ -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;
}
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 661c7bf..7f623f7 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -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);
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 24103c1..9b147f7 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -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 */
OpenPOWER on IntegriCloud