mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTOS]
Fix mapping of working set list page -- it should be local. Get rid of MI_MAKE_LOCAL_PAGE and use ValidKernelPdeLocal/ValidKernelPteLocal consistently. This is what they exist for! We should now hopefully not be creating any global pages when we don't want them. Next step; fix flushing. Bonus: Use the right lock in MiSessionLeader svn path=/trunk/; revision=69532
This commit is contained in:
parent
caccb5cc8f
commit
b7d35a7776
7 changed files with 11 additions and 16 deletions
|
@ -85,7 +85,6 @@
|
|||
#define PFN_FROM_PXE(v) ((v)->u.Hard.PageFrameNumber)
|
||||
|
||||
/* Macros for portable PTE modification */
|
||||
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.Global = 0)
|
||||
#define MI_MAKE_DIRTY_PAGE(x) ((x)->u.Hard.Dirty = 1)
|
||||
#define MI_MAKE_CLEAN_PAGE(x) ((x)->u.Hard.Dirty = 0)
|
||||
#define MI_MAKE_ACCESSED_PAGE(x) ((x)->u.Hard.Accessed = 1)
|
||||
|
|
|
@ -74,7 +74,6 @@
|
|||
#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber)
|
||||
|
||||
/* Macros for portable PTE modification */
|
||||
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.NonGlobal = 1)
|
||||
#define MI_MAKE_DIRTY_PAGE(x)
|
||||
#define MI_MAKE_CLEAN_PAGE(x)
|
||||
#define MI_MAKE_ACCESSED_PAGE(x)
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber)
|
||||
|
||||
/* Macros for portable PTE modification */
|
||||
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.Global = 0)
|
||||
#define MI_MAKE_DIRTY_PAGE(x) ((x)->u.Hard.Dirty = 1)
|
||||
#define MI_MAKE_CLEAN_PAGE(x) ((x)->u.Hard.Dirty = 0)
|
||||
#define MI_MAKE_ACCESSED_PAGE(x) ((x)->u.Hard.Accessed = 1)
|
||||
|
|
|
@ -44,9 +44,8 @@ MiMapPageInHyperSpace(IN PEPROCESS Process,
|
|||
//
|
||||
// Build the PTE
|
||||
//
|
||||
TempPte = ValidKernelPte;
|
||||
TempPte = ValidKernelPteLocal;
|
||||
TempPte.u.Hard.PageFrameNumber = Page;
|
||||
MI_MAKE_LOCAL_PAGE(&TempPte); // Hyperspace is local!
|
||||
|
||||
//
|
||||
// Pick the first hyperspace PTE
|
||||
|
|
|
@ -492,8 +492,8 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
|
||||
MI_SET_PROCESS2("Kernel");
|
||||
PageFrameIndex = MiRemoveAnyPage(0);
|
||||
TempPde = ValidKernelPdeLocal;
|
||||
TempPde.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||
TempPde.u.Hard.Global = FALSE; // Hyperspace is local!
|
||||
MI_WRITE_VALID_PTE(StartPde, TempPde);
|
||||
|
||||
/* Flush the TLB */
|
||||
|
@ -542,6 +542,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
|
||||
MI_SET_PROCESS2("Kernel WS List");
|
||||
PageFrameIndex = MiRemoveAnyPage(0);
|
||||
TempPte = ValidKernelPteLocal;
|
||||
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||
|
||||
/* Map the working set list */
|
||||
|
|
|
@ -1163,10 +1163,8 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
|||
HyperTable = MiPteToAddress(PointerPte);
|
||||
|
||||
/* Now write the PTE/PDE entry for the working set list index itself */
|
||||
TempPte = ValidKernelPte;
|
||||
TempPte = ValidKernelPteLocal;
|
||||
TempPte.u.Hard.PageFrameNumber = WsListIndex;
|
||||
/* Hyperspace is local */
|
||||
MI_MAKE_LOCAL_PAGE(&TempPte);
|
||||
PdeOffset = MiAddressToPteOffset(MmWorkingSetList);
|
||||
HyperTable[PdeOffset] = TempPte;
|
||||
|
||||
|
|
|
@ -162,9 +162,9 @@ MiSessionLeader(IN PEPROCESS Process)
|
|||
KIRQL OldIrql;
|
||||
|
||||
/* Set the flag while under the expansion lock */
|
||||
OldIrql = KeAcquireQueuedSpinLock(LockQueueExpansionLock);
|
||||
OldIrql = MiAcquireExpansionLock();
|
||||
Process->Vm.Flags.SessionLeader = TRUE;
|
||||
KeReleaseQueuedSpinLock(LockQueueExpansionLock, OldIrql);
|
||||
MiReleaseExpansionLock(OldIrql);
|
||||
}
|
||||
|
||||
ULONG
|
||||
|
@ -517,7 +517,7 @@ MiSessionInitializeWorkingSetList(VOID)
|
|||
}
|
||||
|
||||
/* Write a valid PDE for it */
|
||||
TempPde.u.Long = ValidKernelPdeLocal.u.Long;
|
||||
TempPde = ValidKernelPdeLocal;
|
||||
TempPde.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||
MI_WRITE_VALID_PDE(PointerPde, TempPde);
|
||||
|
||||
|
@ -548,7 +548,7 @@ MiSessionInitializeWorkingSetList(VOID)
|
|||
}
|
||||
|
||||
/* Write a valid PTE for it */
|
||||
TempPte.u.Long = ValidKernelPteLocal.u.Long;
|
||||
TempPte = ValidKernelPteLocal;
|
||||
MI_MAKE_DIRTY_PAGE(&TempPte);
|
||||
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||
|
||||
|
@ -667,7 +667,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
|||
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||
|
||||
/* Loop the global PTEs */
|
||||
TempPte.u.Long = ValidKernelPte.u.Long;
|
||||
TempPte = ValidKernelPte;
|
||||
for (i = 0; i < MiSessionDataPages; i++)
|
||||
{
|
||||
/* Get a zeroed colored zero page */
|
||||
|
@ -707,7 +707,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
|||
}
|
||||
|
||||
/* Fill the PTE out */
|
||||
TempPde.u.Long = ValidKernelPdeLocal.u.Long;
|
||||
TempPde = ValidKernelPdeLocal;
|
||||
TempPde.u.Hard.PageFrameNumber = SessionPageDirIndex;
|
||||
|
||||
/* Setup, allocate, fill out the MmSessionSpace PTE */
|
||||
|
@ -720,7 +720,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
|||
ASSERT(MI_PFN_ELEMENT(SessionPageDirIndex)->u1.WsIndex == 0);
|
||||
|
||||
/* Loop all the local PTEs for it */
|
||||
TempPte.u.Long = ValidKernelPteLocal.u.Long;
|
||||
TempPte = ValidKernelPteLocal;
|
||||
PointerPte = MiAddressToPte(MmSessionSpace);
|
||||
for (i = 0; i < MiSessionDataPages; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue