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.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31026 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-06-13 11:35:57 +00:00
parent 581708b997
commit 96b24aef3f

View File

@ -101,8 +101,12 @@ generic_init_mtrrs(uint32 count)
// 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);
}