Skip to content

Commit 1401fbe

Browse files
committed
[NTOSKRNL]: Fix broken UsedPageTableEntries/page table ref counting ASSERTs. The reference can be UP TO 1024, inclusive, but no more. This might fix a bunch of assertions related to this. Thanks to Richard for catching this one during his VAD work.
svn path=/trunk/; revision=55921
1 parent d485558 commit 1401fbe

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

reactos/ntoskrnl/mm/ARM3/virtual.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
412412
{
413413
DPRINT("Decrement used PTEs by address: %lx\n", Va);
414414
(*UsedPageTableEntries)--;
415-
ASSERT((*UsedPageTableEntries) < PTE_COUNT);
415+
ASSERT((*UsedPageTableEntries) <= PTE_COUNT);
416416
DPRINT("Refs: %lx\n", (*UsedPageTableEntries));
417417

418418
/* Check if the PTE is actually mapped in */

reactos/ntoskrnl/mm/section.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process, PVOID Address)
19781978
if((Address < MmSystemRangeStart) && (Process != PageOutContext->CallingProcess))
19791979
{
19801980
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
1981-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] < PTE_COUNT);
1981+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
19821982
}
19831983
#endif
19841984

@@ -2158,7 +2158,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
21582158
if(Address < MmSystemRangeStart)
21592159
{
21602160
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
2161-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] < PTE_COUNT);
2161+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
21622162
}
21632163
#endif
21642164
MmSetSavedSwapEntryPage(Page, 0);
@@ -2186,7 +2186,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
21862186
if(Address < MmSystemRangeStart)
21872187
{
21882188
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
2189-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] < PTE_COUNT);
2189+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
21902190
}
21912191
#endif
21922192
MmSetSavedSwapEntryPage(Page, 0);
@@ -2209,7 +2209,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
22092209
if(Address < MmSystemRangeStart)
22102210
{
22112211
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
2212-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] < PTE_COUNT);
2212+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
22132213
}
22142214
#endif
22152215
if (SwapEntry != 0)
@@ -2247,7 +2247,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
22472247
if(Address < MmSystemRangeStart)
22482248
{
22492249
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
2250-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] < PTE_COUNT);
2250+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
22512251
}
22522252
#endif
22532253
MmReleasePageMemoryConsumer(MC_USER, Page);
@@ -2413,7 +2413,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
24132413
if(Address < MmSystemRangeStart)
24142414
{
24152415
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
2416-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] < PTE_COUNT);
2416+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
24172417
}
24182418
#endif
24192419
Entry = MAKE_SWAP_SSE(SwapEntry);

0 commit comments

Comments
 (0)