Author: sir_richard
Date: Fri Feb 19 23:43:34 2010
New Revision: 45627
URL:
http://svn.reactos.org/svn/reactos?rev=45627&view=rev
Log:
[NTOS]: Disable support for global pages since it does not seem to work right on real
hardware. Additionally, the code had been previously enabling global pages before the
variable determining the support for such pages was even enabled, causing non-global pages
to be used initially, followed later by global pages once the variable had been setup. To
fix this mess, remove all global page support for now. Fixes booting on certain real
hardware (or fixes other random memory corruptions).
Thanks to Caemyr.
Modified:
trunk/reactos/ntoskrnl/include/internal/i386/ke.h
trunk/reactos/ntoskrnl/ke/i386/patpge.c
trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
trunk/reactos/ntoskrnl/mm/i386/page.c
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Fri Feb 19 23:43:34
2010
@@ -439,7 +439,6 @@
extern BOOLEAN KeI386VirtualIntExtensions;
extern KIDTENTRY KiIdt[MAXIMUM_IDTVECTOR];
extern KDESCRIPTOR KiIdtDescriptor;
-extern ULONG Ke386GlobalPagesEnabled;
extern BOOLEAN KiI386PentiumLockErrataPresent;
extern ULONG KeI386NpxPresent;
extern ULONG KeI386XMMIPresent;
Modified: trunk/reactos/ntoskrnl/ke/i386/patpge.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/patpge.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/patpge.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/patpge.c [iso-8859-1] Fri Feb 19 23:43:34 2010
@@ -11,10 +11,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
-
-/* GLOBALS *******************************************************************/
-
-ULONG Ke386GlobalPagesEnabled;
/* FUNCTIONS *****************************************************************/
@@ -46,8 +42,8 @@
__writecr3(Cr3);
/* Now enable PGE */
- __writecr4(Cr4 | CR4_PGE);
- Ke386GlobalPagesEnabled = TRUE;
+ DPRINT1("Global page support detected but not yet taken advantage of\n");
+ //__writecr4(Cr4 | CR4_PGE);
/* Restore interrupts */
_enable();
Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Fri Feb 19 23:43:34 2010
@@ -175,13 +175,14 @@
}
/* Check for global bit */
+#if 0
if (KeFeatureBits & KF_GLOBAL_PAGE)
{
/* Set it on the template PTE and PDE */
ValidKernelPte.u.Hard.Global = TRUE;
ValidKernelPde.u.Hard.Global = TRUE;
}
-
+#endif
/* Now templates are ready */
TempPte = ValidKernelPte;
TempPde = ValidKernelPde;
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] Fri Feb 19 23:43:34 2010
@@ -284,10 +284,6 @@
KeBugCheck(MEMORY_MANAGEMENT);
}
Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE;
- if (Ke386GlobalPagesEnabled)
- {
- Entry |= PA_GLOBAL;
- }
if(0 !=
InterlockedCompareExchangePte(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0))
{
MmReleasePageMemoryConsumer(MC_SYSTEM, Pfn);
@@ -758,10 +754,6 @@
if (Address >= MmSystemRangeStart)
{
Attributes &= ~PA_USER;
- if (Ke386GlobalPagesEnabled)
- {
- Attributes |= PA_GLOBAL;
- }
}
else
{
@@ -907,10 +899,6 @@
if (Address >= MmSystemRangeStart)
{
Attributes &= ~PA_USER;
- if (Ke386GlobalPagesEnabled)
- {
- Attributes |= PA_GLOBAL;
- }
}
else
{
@@ -1017,11 +1005,6 @@
0 == MmGlobalKernelPageDirectory[i] && 0 != CurrentPageDirectory[i])
{
MmGlobalKernelPageDirectory[i] = CurrentPageDirectory[i];
- if (Ke386GlobalPagesEnabled)
- {
- MmGlobalKernelPageDirectory[i] |= PA_GLOBAL;
- CurrentPageDirectory[i] |= PA_GLOBAL;
- }
}
}
}