Author: tkreuzer
Date: Wed Oct  6 14:39:56 2010
New Revision: 49018

URL: http://svn.reactos.org/svn/reactos?rev=49018&view=rev
Log:
[NTOSKRNL]
Alternative workaround for pentium lock errata: Instead of burdening the page 
fault handler, just mark the IDT page as Write-Through if the bug is present. 
According to http://www.rcollins.org/Errata/Dec97/F00FBug.html it shall prevent 
the lock up. Please test. Dedicated to elhoir.

Modified:
    trunk/reactos/ntoskrnl/ke/amd64/cpu.c
    trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
    trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c

Modified: trunk/reactos/ntoskrnl/ke/amd64/cpu.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/cpu.c?rev=49018&r1=49017&r2=49018&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] Wed Oct  6 14:39:56 2010
@@ -37,7 +37,6 @@
 ULONG KiDmaIoCoherency = 0;
 CHAR KeNumberProcessors = 0;
 KAFFINITY KeActiveProcessors = 1;
-BOOLEAN KiI386PentiumLockErrataPresent;
 BOOLEAN KiSMTProcessorsPresent;
 
 /* Freeze data */

Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.c?rev=49018&r1=49017&r2=49018&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Wed Oct  6 14:39:56 
2010
@@ -1176,14 +1176,6 @@
     /* Save CR2 */
     Cr2 = __readcr2();
     
-    /* Check for Pentium LOCK errata */
-    if (KiI386PentiumLockErrataPresent)
-    {
-        /* Not yet implemented */
-        UNIMPLEMENTED;
-        while (TRUE);
-    }
-    
     /* HACK: Check if interrupts are disabled and enable them */
     if (!(TrapFrame->EFlags & EFLAGS_INTERRUPT_MASK))
     {

Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c?rev=49018&r1=49017&r2=49018&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Wed Oct  6 14:39:56 
2010
@@ -567,6 +567,16 @@
     //
     MiFirstReservedZeroingPte->u.Hard.PageFrameNumber = MI_ZERO_PTES - 1;
     
+    /* Check for Pentium LOCK errata */
+    if (KiI386PentiumLockErrataPresent)
+    {
+        /* Mark the 1st IDT page as Write-Through to prevent a lockup
+           on a FOOF instruction. 
+           See http://www.rcollins.org/Errata/Dec97/F00FBug.html */
+        PointerPte = MiAddressToPte(KeGetPcr()->IDT);
+        PointerPte->u.Hard.WriteThrough = 1;
+    }
+
     return STATUS_SUCCESS;
 }
 


Reply via email to