|
|
9ae3a8 |
From 5f40ed9dd62b914f259c1b6a51298fedb6bb2a24 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 25 Jun 2015 19:31:26 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 06/10] target-i386: fix set of registers zeroed on reset
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1435260689-9556-6-git-send-email-ehabkost@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 66505
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.2 qemu-kvm PATCH 5/8] target-i386: fix set of registers zeroed on reset
|
|
|
9ae3a8 |
Bugzilla: 1233350
|
|
|
9ae3a8 |
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Bandan Das <bsd@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
BND0-3, BNDCFGU, BNDCFGS, BNDSTATUS were not zeroed on reset, but they
|
|
|
9ae3a8 |
should be (Intel Instruction Set Extensions Programming Reference
|
|
|
9ae3a8 |
319433-015, pages 9-4 and 9-6). Same for YMM.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
XCR0 should be reset to 1.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
TSC and TSC_RESET were zeroed already by the memset, remove the explicit
|
|
|
9ae3a8 |
assignments.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 05e7e819d7d159a75a46354aead95e1199b8f168)
|
|
|
9ae3a8 |
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
target-i386/cpu.c
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Backport notes:
|
|
|
9ae3a8 |
* The TSC and TSC_RESET reset lines were never added to the
|
|
|
9ae3a8 |
qemu-kvm-1.5.3 tree
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
target-i386/cpu.c | 2 ++
|
|
|
9ae3a8 |
target-i386/cpu.h | 11 ++++++-----
|
|
|
9ae3a8 |
2 files changed, 8 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
|
|
|
9ae3a8 |
index 2eeff5c..96af1bf 100644
|
|
|
9ae3a8 |
--- a/target-i386/cpu.c
|
|
|
9ae3a8 |
+++ b/target-i386/cpu.c
|
|
|
9ae3a8 |
@@ -2402,6 +2402,8 @@ static void x86_cpu_reset(CPUState *s)
|
|
|
9ae3a8 |
cpu_breakpoint_remove_all(env, BP_CPU);
|
|
|
9ae3a8 |
cpu_watchpoint_remove_all(env, BP_CPU);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ env->xcr0 = 1;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
/*
|
|
|
9ae3a8 |
* SDM 11.11.5 requires:
|
|
|
9ae3a8 |
* - IA32_MTRR_DEF_TYPE MSR.E = 0
|
|
|
9ae3a8 |
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
|
|
|
9ae3a8 |
index 7ebdbb3..715ba63 100644
|
|
|
9ae3a8 |
--- a/target-i386/cpu.h
|
|
|
9ae3a8 |
+++ b/target-i386/cpu.h
|
|
|
9ae3a8 |
@@ -798,6 +798,10 @@ typedef struct CPUX86State {
|
|
|
9ae3a8 |
target_ulong cr[5]; /* NOTE: cr1 is unused */
|
|
|
9ae3a8 |
int32_t a20_mask;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ BNDReg bnd_regs[4];
|
|
|
9ae3a8 |
+ BNDCSReg bndcs_regs;
|
|
|
9ae3a8 |
+ uint64_t msr_bndcfgs;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
/* FPU state */
|
|
|
9ae3a8 |
unsigned int fpstt; /* top of stack index */
|
|
|
9ae3a8 |
uint16_t fpus;
|
|
|
9ae3a8 |
@@ -820,6 +824,8 @@ typedef struct CPUX86State {
|
|
|
9ae3a8 |
XMMReg xmm_t0;
|
|
|
9ae3a8 |
MMXReg mmx_t0;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ XMMReg ymmh_regs[CPU_NB_REGS];
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
/* sysenter registers */
|
|
|
9ae3a8 |
uint32_t sysenter_cs;
|
|
|
9ae3a8 |
target_ulong sysenter_esp;
|
|
|
9ae3a8 |
@@ -931,12 +937,7 @@ typedef struct CPUX86State {
|
|
|
9ae3a8 |
uint16_t fpus_vmstate;
|
|
|
9ae3a8 |
uint16_t fptag_vmstate;
|
|
|
9ae3a8 |
uint16_t fpregs_format_vmstate;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
uint64_t xstate_bv;
|
|
|
9ae3a8 |
- XMMReg ymmh_regs[CPU_NB_REGS];
|
|
|
9ae3a8 |
- BNDReg bnd_regs[4];
|
|
|
9ae3a8 |
- BNDCSReg bndcs_regs;
|
|
|
9ae3a8 |
- uint64_t msr_bndcfgs;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
uint64_t xcr0;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|