From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Cc: Sheng Yang <sheng@linux.intel.com>
Subject: [PATCH master/stable-0.12/stable-0.13] kvm: reset MSR_IA32_CR_PAT correctly
Date: Tue, 7 Sep 2010 16:21:22 +0300 [thread overview]
Message-ID: <1283865682-30720-1-git-send-email-avi@redhat.com> (raw)
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 <avi@redhat.com>
---
qemu-kvm-x86.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 4c32771..e02e896 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1289,12 +1289,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++) {
- kvm_msr_entry_set(&msrs[n], kvm_msr_list->indices[n], 0);
+ index = kvm_msr_list->indices[n];
+ switch (index) {
+ case MSR_PAT:
+ data = 0x0007040600070406ULL;
+ default:
+ data = 0;
+ }
+ kvm_msr_entry_set(&msrs[n], index, data);
}
msr_data.info.nmsrs = n;
--
1.7.1
next reply other threads:[~2010-09-07 13:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-07 13:21 Avi Kivity [this message]
2010-09-07 13:24 ` [PATCH master/stable-0.12/stable-0.13] kvm: reset MSR_IA32_CR_PAT correctly Avi Kivity
2010-09-08 16:32 ` Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283865682-30720-1-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=sheng@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox