[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/15] x86: Properly reset PAT MSR
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 07/15] x86: Properly reset PAT MSR |
Date: |
Fri, 4 Mar 2011 11:20:04 +0100 |
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 <address@hidden>
---
target-i386/cpu.h | 4 ++--
target-i386/cpuid.c | 1 -
target-i386/helper.c | 5 +++++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index d0eae75..c7047d5 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -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;
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 5382a28..814d13e 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -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;
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);
}
--
1.7.1
- [Qemu-devel] [PATCH 00/15] [uq/master] Patch queue, part V (the rest), Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 08/15] x86: Save/restore PAT MSR, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 15/15] Expose thread_id in info cpus, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 05/15] kvm: x86: Do not leave halt if interrupts are disabled, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 10/15] kvm: Consider EXIT_DEBUG unknown without CAP_SET_GUEST_DEBUG, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 13/15] kvm: x86: Reorder functions in kvm.c, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 14/15] kvm: x86: Push kvm_arch_debug to kvm_arch_handle_exit, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 07/15] x86: Properly reset PAT MSR,
Jan Kiszka <=
- [Qemu-devel] [PATCH 06/15] kvm: Mark VCPU state dirty on creation, Jan Kiszka, 2011/03/04
- [Qemu-devel] [PATCH 03/15] kvm: Install optimized interrupt handlers, Jan Kiszka, 2011/03/04
[Qemu-devel] [PATCH 12/15] kvm: Align kvm_arch_handle_exit to kvm_cpu_exec changes, Jan Kiszka, 2011/03/04