In a previous message you said:
Alex Ionescu wrote:
This new hack directly slows down every context
switch instead of every
page fault -- the latter is a less important perf hit.
This slowdown is very small, especially when comparing with other
"Hack of Doom".
I just want to see, is it the only raison d'être of that old hack or not.
Could you explain the reason you add Mm Hack of Doom again if the
slowdown is very small?
Regards,
--
Matthieu Suiche
On Mon, Mar 23, 2009 at 1:56 AM, <dgorbachev(a)svn.reactos.org> wrote:
Author: dgorbachev
Date: Mon Mar 23 03:56:01 2009
New Revision: 40181
URL:
http://svn.reactos.org/svn/reactos?rev=40181&view=rev
Log:
Add "REACTOS Mm Hack of Doom" again (removed in r39723). Bug #4296.
Modified:
trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S
trunk/reactos/ntoskrnl/ke/i386/trap.s
Modified: trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/ctxswitch…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S [iso-8859-1] Mon Mar 23 03:56:01 2009
@@ -389,9 +389,6 @@
/* Checking NPX, disable interrupts now */
mov eax, [esi+KTHREAD_INITIAL_STACK]
-
- /* HACK */
- mov ecx, [eax - 4]
cli
/* Get the NPX State */
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Mon Mar 23 03:56:01 2009
@@ -1924,10 +1924,14 @@
NoFixUp:
mov edi, cr2
+ /* REACTOS Mm Hack of Doom */
+ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_INTERRUPT_MASK
+ je HandlePf
+
/* Enable interrupts and check if we got here with interrupts disabled */
sti
- test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_INTERRUPT_MASK
- jz IllegalState
+ /* test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_INTERRUPT_MASK
+ jz IllegalState */
HandlePf:
/* Send trap frame and check if this is kernel-mode or usermode */