Author: dgorbachev
Date: Wed Feb 10 14:56:54 2010
New Revision: 45555
URL:
http://svn.reactos.org/svn/reactos?rev=45555&view=rev
Log:
Do not crash, use valid kernel PTE.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c
trunk/reactos/ntoskrnl/mm/ARM3/iosup.c
trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
trunk/reactos/ntoskrnl/mm/ARM3/miarm.h
trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
trunk/reactos/ntoskrnl/mm/ARM3/ncache.c
trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
trunk/reactos/ntoskrnl/mm/ARM3/pool.c
trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
trunk/reactos/ntoskrnl/mm/i386/page.c
trunk/reactos/ntoskrnl/mm/mmdbg.c
trunk/reactos/ntoskrnl/mm/mminit.c
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] Wed Feb 10 14:56:54 2010
@@ -45,7 +45,7 @@
//
// Build the PTE
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
TempPte.u.Hard.PageFrameNumber = Page;
MI_MAKE_LOCAL_PAGE(&TempPte); // Hyperspace is local!
@@ -157,7 +157,7 @@
// Write the current PTE
//
PointerPte += (Offset + 1);
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
MI_MAKE_LOCAL_PAGE(&TempPte); // Hyperspace is local!
do
{
Modified: trunk/reactos/ntoskrnl/mm/ARM3/iosup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/iosup.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -122,7 +122,7 @@
//
// Get the template and configure caching
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
switch (CacheAttribute)
{
case MiNonCached:
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -372,7 +372,7 @@
//
// Get the template
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
switch (CacheAttribute)
{
case MiNonCached:
Modified: trunk/reactos/ntoskrnl/mm/ARM3/miarm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/miarm.h?r…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -127,6 +127,8 @@
} PHYSICAL_MEMORY_DESCRIPTOR, *PPHYSICAL_MEMORY_DESCRIPTOR;
extern MMPTE HyperTemplatePte;
+extern MMPTE ValidKernelPde;
+extern MMPTE ValidKernelPte;
extern ULONG MmSizeOfNonPagedPoolInBytes;
extern ULONG MmMaximumNonPagedPoolInBytes;
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -442,7 +442,7 @@
MiBuildPagedPool(VOID)
{
PMMPTE PointerPte, PointerPde;
- MMPTE TempPte = HyperTemplatePte;
+ MMPTE TempPte = ValidKernelPte;
PFN_NUMBER PageFrameIndex;
KIRQL OldIrql;
ULONG Size, BitMapSize;
@@ -467,7 +467,7 @@
// page directory array in the old ReactOS Mm is used (but in a less hacky
// way).
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
TempPte.u.Hard.PageFrameNumber = MmSystemPageDirectory;
ASSERT(PointerPte->u.Hard.Valid == 0);
ASSERT(TempPte.u.Hard.Valid == 1);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/ncache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/ncache.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/ncache.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/ncache.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -108,7 +108,7 @@
//
// Setup the template PTE
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
//
// Now check what kind of caching we should use
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -113,7 +113,7 @@
//
// Build the PTE
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
*PointerPte = TempPte;
ASSERT(PointerPte->u.Hard.Valid == 1);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -213,7 +213,7 @@
//
// Get the template PTE we'll use to expand
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
//
// Get the first PTE in expansion space
@@ -493,7 +493,7 @@
//
// Loop the pages
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
do
{
//
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] Wed Feb 10 14:56:54 2010
@@ -134,7 +134,7 @@
//
// Setup the template stack PTE
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
MI_MAKE_LOCAL_PAGE(&TempPte);
MI_MAKE_DIRTY_PAGE(&TempPte);
TempPte.u.Hard.PageFrameNumber = 0;
@@ -234,7 +234,7 @@
//
// Setup the template stack PTE
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
MI_MAKE_LOCAL_PAGE(&TempPte);
MI_MAKE_DIRTY_PAGE(&TempPte);
TempPte.u.Hard.PageFrameNumber = 0;
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -1000,8 +1000,6 @@
}
}
-extern MMPTE HyperTemplatePte;
-
VOID
INIT_FUNCTION
NTAPI
Modified: trunk/reactos/ntoskrnl/mm/mmdbg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmdbg.c?rev=45…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mmdbg.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mmdbg.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -35,6 +35,7 @@
MiDbgTranslatePhysicalAddress(IN ULONG64 PhysicalAddress,
IN ULONG Flags)
{
+ extern MMPTE ValidKernelPte;
PFN_NUMBER Pfn;
MMPTE TempPte;
PVOID MappingBaseAddress;
@@ -77,7 +78,7 @@
//
//
//
- TempPte = HyperTemplatePte;
+ TempPte = ValidKernelPte;
//
// Convert physical address to PFN
Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Wed Feb 10 14:56:54 2010
@@ -354,9 +354,9 @@
MmInitSystem(IN ULONG Phase,
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
- extern MMPTE HyperTemplatePte;
+ extern MMPTE ValidKernelPte;
PMMPTE PointerPte;
- MMPTE TempPte = HyperTemplatePte;
+ MMPTE TempPte = ValidKernelPte;
PFN_NUMBER PageFrameNumber;
if (Phase == 0)