https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7bffb92099936d1487680efba433f45c3316defa

commit 7bffb92099936d1487680efba433f45c3316defa
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Fri Feb 19 16:57:33 2021 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Thu Apr 8 15:40:37 2021 +0200

    [NTOS:MM] Let ARM3 handle invalid PDE for itself.
---
 ntoskrnl/mm/i386/page.c | 38 ++++++--------------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c
index 4690a9a5d15..e1aac494dcb 100644
--- a/ntoskrnl/mm/i386/page.c
+++ b/ntoskrnl/mm/i386/page.c
@@ -186,17 +186,6 @@ ProtectToPTE(ULONG flProtect)
     return(Attributes);
 }
 
-NTSTATUS
-NTAPI
-MiDispatchFault(IN ULONG FaultCode,
-                IN PVOID Address,
-                IN PMMPTE PointerPte,
-                IN PMMPTE PointerProtoPte,
-                IN BOOLEAN Recursive,
-                IN PEPROCESS Process,
-                IN PVOID TrapInformation,
-                IN PVOID Vad);
-
 NTSTATUS
 NTAPI
 MiFillSystemPageDirectory(IN PVOID Base,
@@ -244,32 +233,17 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID 
Address, BOOLEAN Create, PKIRQ
             }
             return Pt + MiAddressToPteOffset(Address);
         }
+
         /* This is for our process */
         PointerPde = MiAddressToPde(Address);
         Pt = (PULONG)MiAddressToPte(Address);
-        if (PointerPde->u.Hard.Valid == 0)
+
+        if ((PointerPde->u.Hard.Valid == 0) && (Create == FALSE))
         {
-            NTSTATUS Status;
-            if (Create == FALSE)
-            {
-                return NULL;
-            }
-            ASSERT(PointerPde->u.Long == 0);
-
-            MI_WRITE_INVALID_PTE(PointerPde, DemandZeroPde);
-            // Tiny HACK: Parameter 1 is the architecture specific FaultCode 
for an access violation (i.e. page is present)
-            Status = MiDispatchFault(0x1,
-                                     Pt,
-                                     PointerPde,
-                                     NULL,
-                                     FALSE,
-                                     PsGetCurrentProcess(),
-                                     NULL,
-                                     NULL);
-            DBG_UNREFERENCED_LOCAL_VARIABLE(Status);
-            ASSERT(KeAreAllApcsDisabled() == TRUE);
-            ASSERT(PointerPde->u.Hard.Valid == 1);
+            /* Do not fault PDE in if not needed */
+            return NULL;
         }
+
         return (PULONG)MiAddressToPte(Address);
     }
 

Reply via email to