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
This commit is contained in:
Alan Cox 2006-04-27 21:26:25 +00:00
parent bd02c63f13
commit 7dece6c7d9
2 changed files with 12 additions and 14 deletions

View File

@ -2061,6 +2061,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;
@ -2098,7 +2099,13 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
}
#endif
pte = pmap_pte(pmap, va);
pde = pmap_pde(pmap, va);
if (pde != NULL) {
if ((*pde & PG_PS) != 0)
panic("pmap_enter: attempted pmap_enter on 2MB page");
pte = pmap_pde_to_pte(pde, va);
} else
pte = NULL;
/*
* Page Directory table entry not valid, we need a new PT page
@ -2111,9 +2118,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)
panic("pmap_enter: attempted pmap_enter on 2MB page");
/*
* Mapping has not changed, must be protection or wiring change.
*/

View File

@ -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.
*/