Author: sginsberg
Date: Thu Oct 15 01:49:26 2015
New Revision: 69532
URL:
http://svn.reactos.org/svn/reactos?rev=69532&view=rev
Log:
[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
Modified:
trunk/reactos/ntoskrnl/include/internal/amd64/mm.h
trunk/reactos/ntoskrnl/include/internal/arm/mm.h
trunk/reactos/ntoskrnl/include/internal/i386/mm.h
trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c
trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
trunk/reactos/ntoskrnl/mm/ARM3/session.c
Modified: trunk/reactos/ntoskrnl/include/internal/amd64/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] Thu Oct 15 01:49:26
2015
@@ -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)
Modified: trunk/reactos/ntoskrnl/include/internal/arm/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/arm/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/arm/mm.h [iso-8859-1] Thu Oct 15 01:49:26
2015
@@ -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)
Modified: trunk/reactos/ntoskrnl/include/internal/i386/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1] Thu Oct 15 01:49:26
2015
@@ -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)
Modified: trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/hypermap.…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c [iso-8859-1] Thu Oct 15 01:49:26 2015
@@ -44,9 +44,8 @@
//
// 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
Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Thu Oct 15 01:49:26 2015
@@ -492,8 +492,8 @@
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 @@
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 */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Thu Oct 15 01:49:26 2015
@@ -1163,10 +1163,8 @@
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;
Modified: trunk/reactos/ntoskrnl/mm/ARM3/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/session.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] Thu Oct 15 01:49:26 2015
@@ -162,9 +162,9 @@
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 @@
}
/* 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 @@
}
/* 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 @@
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 @@
}
/* 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 @@
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++)
{