]> git.proxmox.com Git - mirror_qemu.git/commitdiff
x86: Properly reset PAT MSR
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 15 Mar 2011 11:26:21 +0000 (12:26 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 16 Mar 2011 20:11:05 +0000 (17:11 -0300)
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>
target-i386/cpu.h
target-i386/cpuid.c
target-i386/helper.c

index d0eae754ccd149600e13b408f928c44c7526eabf..c7047d5912422c2e9c91be7aaf875674b9b9b8bc 100644 (file)
@@ -685,8 +685,6 @@ typedef struct CPUX86State {
 
     uint64_t tsc;
 
-    uint64_t pat;
-
     uint64_t mcg_status;
 
     /* exception/interrupt handling */
@@ -707,6 +705,8 @@ typedef struct CPUX86State {
 
     CPU_COMMON
 
+    uint64_t pat;
+
     /* processor features (e.g. for CPUID insn) */
     uint32_t cpuid_level;
     uint32_t cpuid_vendor1;
index 5382a283f59c46efebde0acea9eb6b70057b235e..814d13e767250f97f3ea71940d525f9067d9846b 100644 (file)
@@ -847,7 +847,6 @@ int cpu_x86_register (CPUX86State *env, const char *cpu_model)
     env->cpuid_version |= ((def->model & 0xf) << 4) | ((def->model >> 4) << 16);
     env->cpuid_version |= def->stepping;
     env->cpuid_features = def->features;
-    env->pat = 0x0007040600070406ULL;
     env->cpuid_ext_features = def->ext_features;
     env->cpuid_ext2_features = def->ext2_features;
     env->cpuid_ext3_features = def->ext3_features;
index a08309f97a2a5d06a2fff7d07f4bb299145c2188..d15fca591e204e9ac0ff6dc0b5c6c8e46b30a2fe 100644 (file)
@@ -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);
 }