[ros-diffs] [sir_richard] 47161: [NTOS]: We might get page faults before memory areas are setup, since so much ARM3 work now gets done before the memory areas are ready to go. Since obviously these faults cannot be caused by non-ARM3 Mm, we assume them to be ARM3 faults (as long as they happened in KSEG0_BASE). Fixes a bug where early page faults in ARM3 PTEs would get treated as non-ARM3 faults and fail.

sir_richard at svn.reactos.org sir_richard at svn.reactos.org
Wed May 12 02:40:24 CEST 2010


Author: sir_richard
Date: Wed May 12 02:40:23 2010
New Revision: 47161

URL: http://svn.reactos.org/svn/reactos?rev=47161&view=rev
Log:
[NTOS]: We might get page faults before memory areas are setup, since so much ARM3 work now gets done before the memory areas are ready to go. Since obviously these faults cannot be caused by non-ARM3 Mm, we assume them to be ARM3 faults (as long as they happened in KSEG0_BASE). Fixes a bug where early page faults in ARM3 PTEs would get treated as non-ARM3 faults and fail.

Modified:
    trunk/reactos/ntoskrnl/mm/mmfault.c

Modified: trunk/reactos/ntoskrnl/mm/mmfault.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmfault.c?rev=47161&r1=47160&r2=47161&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] Wed May 12 02:40:23 2010
@@ -274,15 +274,23 @@
 #endif
     }
     
-    //
-    // Check if this is an ARM3 memory area
-    //
+    /* 
+     * Check if this is an ARM3 memory area or if there's no memory area at all.
+     * The latter can happen early in the boot cycle when ARM3 paged pool is in
+     * use before having defined the memory areas proper.
+     * A proper fix would be to define memory areas in the ARM3 code, but we want
+     * to avoid adding this ReactOS-specific construct to ARM3 code.
+     * Either way, in the future, as ReactOS-paged pool is eliminated, this hack
+     * can go away.
+     */
     MemoryArea = MmLocateMemoryAreaByAddress(MmGetKernelAddressSpace(), Address);
-    if ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3))
+    if ((!(MemoryArea) && ((ULONG_PTR)Address >= (ULONG_PTR)MmSystemRangeStart)) ||
+        ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3)))
     {
         //
         // Hand it off to more competent hands...
         //
+        DPRINT1("ARM3 fault\n");
         return MmArmAccessFault(StoreInstruction, Address, Mode, TrapInformation);
     }   
 




More information about the Ros-diffs mailing list