aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2006-04-27 21:26:25 +0000
committerAlan Cox <alc@FreeBSD.org>2006-04-27 21:26:25 +0000
commit7dece6c7d92d619a9e83c95da598b19c992da6dc (patch)
treeb241b432af087e0c94c19127187fe9b0e0d1b0fd /sys/i386
parentbd02c63f136aaa5b03fa9143c586f2748d30c26a (diff)
downloadsrc-7dece6c7d92d619a9e83c95da598b19c992da6dc.tar.gz
src-7dece6c7d92d619a9e83c95da598b19c992da6dc.zip
In general, bits in the page directory entry (PDE) and the page table
entry (PTE) have the same meaning. The exception to this rule is the eighth bit (0x080). It is the PS bit in a PDE and the PAT bit in a PTE. This change avoids the possibility that pmap_enter() confuses a PAT bit with a PS bit, avoiding a panic(). Eliminate a diagnostic printf() from the i386 pmap_enter() that serves no current purpose, i.e., I've seen no bug reports in the last two years that are helped by this printf(). Reviewed by: jhb
Notes
Notes: svn path=/head/; revision=158088
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/pmap.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index ca9525ba881d..a69c09e61415 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -2090,6 +2090,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
boolean_t wired)
{
vm_paddr_t pa;
+ pd_entry_t *pde;
register pt_entry_t *pte;
vm_paddr_t opa;
pt_entry_t origpte, newpte;
@@ -2128,6 +2129,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
}
#endif
+ pde = pmap_pde(pmap, va);
+ if ((*pde & PG_PS) != 0)
+ panic("pmap_enter: attempted pmap_enter on 4MB page");
pte = pmap_pte_quick(pmap, va);
/*
@@ -2143,16 +2147,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
origpte = *pte;
opa = origpte & PG_FRAME;
- if (origpte & PG_PS) {
- /*
- * Yes, I know this will truncate upper address bits for PAE,
- * but I'm actually more interested in the lower bits
- */
- printf("pmap_enter: va %p, pte %p, origpte %p\n",
- (void *)va, (void *)pte, (void *)(uintptr_t)origpte);
- panic("pmap_enter: attempted pmap_enter on 4MB page");
- }
-
/*
* Mapping has not changed, must be protection or wiring change.
*/