Received: from eggs.gnu.org ([2001:4830:134:3::10]:40292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z5N-00046e-Ea for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Z4t-0007yz-Ot for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:21:45 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:54347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z4t-0007yO-Fa for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:21:15 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 11:21:14 -0600 From: Michael Roth Date: Tue, 8 Jul 2014 12:17:30 -0500 Message-Id: <1404839947-1086-60-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 059/156] target-i386: fix set of registers zeroed on reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Paolo Bonzini 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini (cherry picked from commit 05e7e819d7d159a75a46354aead95e1199b8f168) Conflicts: target-i386/cpu.c target-i386/cpu.h *removed dependency on 79e9ebeb Signed-off-by: Michael Roth --- target-i386/cpu.c | 2 ++ target-i386/cpu.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 47af9a8..654a04e 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -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) { diff --git a/target-i386/cpu.h b/target-i386/cpu.h index ea373e8..199f407 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -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; -- 1.9.1