aboutsummaryrefslogtreecommitdiff
path: root/target-i386/helper.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-03-15 12:26:21 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-03-16 17:11:05 -0300
commitebda377f8c6d9a5ec69a0aeb2000aa5ce74f7fa2 (patch)
treebebb3a9b4f319af91ad7d1c70e00f74c6bb4054b /target-i386/helper.c
parentd841b6c4f16c3fc7afe2ce355e7e42813345f053 (diff)
downloadqemu-ebda377f8c6d9a5ec69a0aeb2000aa5ce74f7fa2.zip
qemu-ebda377f8c6d9a5ec69a0aeb2000aa5ce74f7fa2.tar.gz
qemu-ebda377f8c6d9a5ec69a0aeb2000aa5ce74f7fa2.tar.bz2
x86: Properly reset PAT MSR
Conforming to the Intel spec, set the power-on value of PAT also on reset, but save it across INIT. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index a08309f..d15fca5 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -99,6 +99,8 @@ void cpu_reset(CPUX86State *env)
env->mxcsr = 0x1f80;
+ env->pat = 0x0007040600070406ULL;
+
memset(env->dr, 0, sizeof(env->dr));
env->dr[6] = DR6_FIXED_1;
env->dr[7] = DR7_FIXED_1;
@@ -1280,8 +1282,11 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
void do_cpu_init(CPUState *env)
{
int sipi = env->interrupt_request & CPU_INTERRUPT_SIPI;
+ uint64_t pat = env->pat;
+
cpu_reset(env);
env->interrupt_request = sipi;
+ env->pat = pat;
apic_init_reset(env->apic_state);
env->halted = !cpu_is_bsp(env);
}