Limit system PTE space mapping to calculated pool size
This commit is contained in:
@@ -194,16 +194,21 @@ MM::Pte::InitializeSystemPteSpace(VOID)
|
|||||||
PMMPTE PointerPte;
|
PMMPTE PointerPte;
|
||||||
PMMPTE FirstZeroingPte;
|
PMMPTE FirstZeroingPte;
|
||||||
PMMMEMORY_LAYOUT MemoryLayout;
|
PMMMEMORY_LAYOUT MemoryLayout;
|
||||||
|
ULONGLONG NonPagedSystemPoolEnd;
|
||||||
|
|
||||||
/* Retrieve the system's memory layout */
|
/* Retrieve the system's memory layout */
|
||||||
MemoryLayout = MM::Manager::GetMemoryLayout();
|
MemoryLayout = MM::Manager::GetMemoryLayout();
|
||||||
|
|
||||||
|
NonPagedSystemPoolEnd = ((ULONGLONG)MemoryLayout->SystemSpaceStart +
|
||||||
|
MM::Manager::GetNumberOfSystemPtes() * MM_PAGE_SIZE);
|
||||||
|
|
||||||
/* Map the page table hierarchy for the entire system PTE space */
|
/* Map the page table hierarchy for the entire system PTE space */
|
||||||
MM::Pte::MapPPE(MemoryLayout->SystemSpaceStart, MemoryLayout->SystemSpaceEnd, &ValidPte);
|
MM::Pte::MapPPE(MemoryLayout->SystemSpaceStart, (PVOID)NonPagedSystemPoolEnd, &ValidPte);
|
||||||
MM::Pte::MapPDE(MemoryLayout->SystemSpaceStart, MemoryLayout->SystemSpaceEnd, &ValidPte);
|
MM::Pte::MapPDE(MemoryLayout->SystemSpaceStart, (PVOID)NonPagedSystemPoolEnd, &ValidPte);
|
||||||
|
|
||||||
/* Format the main block of system PTEs into a free list pool */
|
/* Format the main block of system PTEs into a free list pool */
|
||||||
PointerPte = MM::Paging::GetPteAddress(MemoryLayout->SystemSpaceStart);
|
PointerPte = MM::Paging::GetPteAddress(MemoryLayout->SystemSpaceStart);
|
||||||
|
|
||||||
InitializeSystemPtePool(PointerPte, MM::Manager::GetNumberOfSystemPtes(), SystemPteSpace);
|
InitializeSystemPtePool(PointerPte, MM::Manager::GetNumberOfSystemPtes(), SystemPteSpace);
|
||||||
|
|
||||||
/* Reserve and zero a dedicated block of system PTEs */
|
/* Reserve and zero a dedicated block of system PTEs */
|
||||||
|
|||||||
Reference in New Issue
Block a user