[Haiku-commits] r31026 - haiku/trunk/src/add-ons/kernel/cpu/x86

mmlr at mail.berlios.de mmlr at mail.berlios.de
Sat Jun 13 13:35:58 CEST 2009


Author: mmlr
Date: 2009-06-13 13:35:57 +0200 (Sat, 13 Jun 2009)
New Revision: 31026
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31026&view=rev

Modified:
   haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp
Log:
When clearing the MTRRs also set the default type to uncacheable. Otherwise on
systems where the default is set to a cachable type and MTRRs are used to define
the uncacheable areas, everything would become cacheable after clearing them.


Modified: haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp	2009-06-13 10:42:11 UTC (rev 31025)
+++ haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp	2009-06-13 11:35:57 UTC (rev 31026)
@@ -101,8 +101,12 @@
 
 	// but turn on variable MTRR functionality
 
+	// we need to ensure that the default type is uncacheable, otherwise
+	// clearing the mtrrs could result in ranges that aren't supposed to be
+	// cacheable to become cacheable due to the default type
+
 	x86_write_msr(IA32_MSR_MTRR_DEFAULT_TYPE,
-		x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) | IA32_MTRR_ENABLE);
+		(x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) & ~0xff) | IA32_MTRR_ENABLE);
 }
 
 




More information about the Haiku-commits mailing list