Skip to content

Commit

Permalink
target-i386: fix set of registers zeroed on reset
Browse files Browse the repository at this point in the history
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 05e7e81)

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

*removed dependency on 79e9ebe

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
bonzini authored and mdroth committed Jun 26, 2014
1 parent 73d8965 commit 3c1162e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions target-i386/cpu.c
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions target-i386/cpu.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 3c1162e

Please sign in to comment.