If we delete a page table, we have also to clear the entry in the page directory area explicitly. This may fix parts of bug #710.

svn path=/trunk/; revision=17414
This commit is contained in:
Hartmut Birr 2005-08-16 16:17:47 +00:00
parent 459c10a65e
commit 37aea079c1

View file

@ -411,17 +411,18 @@ VOID MmDeletePageTable(PEPROCESS Process, PVOID Address)
{ {
ULONGLONG ZeroPde = 0LL; ULONGLONG ZeroPde = 0LL;
ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPde); ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPde);
MiFlushTlb((PULONG)PAE_ADDR_TO_PDE(Address), PAE_ADDR_TO_PTE(Address));
} }
else else
{ {
*(ADDR_TO_PDE(Address)) = 0; *(ADDR_TO_PDE(Address)) = 0;
MiFlushTlb(ADDR_TO_PDE(Address), ADDR_TO_PTE(Address));
} }
if (Address >= MmSystemRangeStart) if (Address >= MmSystemRangeStart)
{ {
KEBUGCHECK(0); KEBUGCHECK(0);
// MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0;
} }
MiFlushTlb(NULL, Address);
if (Process != NULL && Process != CurrentProcess) if (Process != NULL && Process != CurrentProcess)
{ {
KeDetachProcess(); KeDetachProcess();
@ -455,6 +456,7 @@ VOID MmFreePageTable(PEPROCESS Process, PVOID Address)
} }
Pfn = PAE_PTE_TO_PFN(*(PAE_ADDR_TO_PDE(Address))); Pfn = PAE_PTE_TO_PFN(*(PAE_ADDR_TO_PDE(Address)));
ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPte); ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPte);
MiFlushTlb((PULONG)PAE_ADDR_TO_PDE(Address), PAE_ADDR_TO_PTE(Address));
} }
else else
{ {
@ -471,8 +473,8 @@ VOID MmFreePageTable(PEPROCESS Process, PVOID Address)
} }
Pfn = PTE_TO_PFN(*(ADDR_TO_PDE(Address))); Pfn = PTE_TO_PFN(*(ADDR_TO_PDE(Address)));
*(ADDR_TO_PDE(Address)) = 0; *(ADDR_TO_PDE(Address)) = 0;
MiFlushTlb(ADDR_TO_PDE(Address), ADDR_TO_PTE(Address));
} }
MiFlushTlb(NULL, Address);
if (Address >= MmSystemRangeStart) if (Address >= MmSystemRangeStart)
{ {