]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
target-i386: fix set of registers zeroed on reset
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 29 Apr 2014 11:10:05 +0000 (13:10 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 26 Jun 2014 19:57:46 +0000 (14:57 -0500)
BND0-3, BNDCFGU, BNDCFGS, BNDSTATUS were not zeroed on reset, but they
should be (Intel Instruction Set Extensions Programming Reference
319433-015, pages 9-4 and 9-6).  Same for YMM.

XCR0 should be reset to 1.

TSC and TSC_RESET were zeroed already by the memset, remove the explicit
assignments.

Cc: Andreas Faerber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 05e7e819d7d159a75a46354aead95e1199b8f168)

Conflicts:
target-i386/cpu.c
target-i386/cpu.h

*removed dependency on 79e9ebeb

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-i386/cpu.c
target-i386/cpu.h

index 47af9a8816334cbb6e1870f29f95fa2e7e6196db..654a04e18706d00ab7d33812f39f361f76197b8d 100644 (file)
@@ -2446,6 +2446,8 @@ static void x86_cpu_reset(CPUState *s)
     cpu_breakpoint_remove_all(env, BP_CPU);
     cpu_watchpoint_remove_all(env, BP_CPU);
 
+    env->xcr0 = 1;
+
 #if !defined(CONFIG_USER_ONLY)
     /* We hard-wire the BSP to the first CPU. */
     if (s->cpu_index == 0) {
index ea373e82dc8cad81177dba7659d5fe7a825dec46..199f4079dc132cda694b5d2af3d8d63dcaa32deb 100644 (file)
@@ -801,6 +801,8 @@ typedef struct CPUX86State {
     XMMReg xmm_t0;
     MMXReg mmx_t0;
 
+    XMMReg ymmh_regs[CPU_NB_REGS];
+
     /* sysenter registers */
     uint32_t sysenter_cs;
     target_ulong sysenter_esp;
@@ -909,9 +911,7 @@ typedef struct CPUX86State {
     uint16_t fpus_vmstate;
     uint16_t fptag_vmstate;
     uint16_t fpregs_format_vmstate;
-
     uint64_t xstate_bv;
-    XMMReg ymmh_regs[CPU_NB_REGS];
 
     uint64_t xcr0;