From f835a75f3165281a653b891f6bb1a502cc60f65b Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Jun 2009 11:40:05 +0000 Subject: [PATCH] Make two runs of MTRR setting when setting memory ranges to write-back. At the first run only set up uncacheable MTRRs and in the second run set the write-back ones up. If this order is not followed, we could set too large ranges to cacheable first and then limit it back to uncacheable later. On systems with enough physical memory this would lead to a temporary situation in which areas become cacheable that must not be, resulting in system hangs or other unexpected behaviour. Fixes last part of #4018. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31027 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_vm.cpp | 63 ++++++++++++++++---------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_vm.cpp b/src/system/kernel/arch/x86/arch_vm.cpp index f1c42c441b..71058a1efd 100644 --- a/src/system/kernel/arch/x86/arch_vm.cpp +++ b/src/system/kernel/arch/x86/arch_vm.cpp @@ -272,33 +272,48 @@ set_memory_write_back(int32 id, uint64 base, uint64 length) #ifdef TRACE_MTRR dprintf("solutions: "); - for (int i=0; i