From: Avi Kivity <a...@redhat.com>

The power-on value of MSR_IA32_CR_PAT is not 0 - that disables cacheing and
makes everything dog slow.

Fix to reset MSR_IA32_CR_PAT to the correct value.

Signed-off-by: Avi Kivity <a...@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 46257d6..016dcf1 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1323,12 +1323,21 @@ static int kvm_reset_msrs(CPUState *env)
     } msr_data;
     int n;
     struct kvm_msr_entry *msrs = msr_data.entries;
+    uint32_t index;
+    uint64_t data;
 
     if (!kvm_msr_list) {
         return -1;
     }
 
     for (n = 0; n < kvm_msr_list->nmsrs; n++) {
+        index = kvm_msr_list->indices[n];
+        switch (index) {
+        case MSR_PAT:
+            data = 0x0007040600070406ULL;
+        default:
+            data = 0;
+        }
         kvm_msr_entry_set(&msrs[n], kvm_msr_list->indices[n], 0);
     }
 
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to