From 8033c42abdfa7b583b3a42c8877f35164e5f776b Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Tue, 5 Jan 2010 16:32:24 +0800 Subject: MCE: Fix bug of IA32_MCG_STATUS after system reset Now, if we inject a fatal MCE into guest OS, for example Linux, Linux will go panic and then reboot. But if we inject another MCE now, system will reset directly instead of go panic firstly, because MCG_STATUS.MCIP is set to 1 and not cleared after reboot. This is does not follow the behavior in real hardware. This patch fixes this via set env->mcg_status to 0 during system reset. Signed-off-by: Huang Ying Signed-off-by: Anthony Liguori (cherry picked from commit af364b418cc57c53275c76ee5e0e0645908605b9) --- target-i386/helper.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'target-i386') diff --git a/target-i386/helper.c b/target-i386/helper.c index 730e396a6..9d7fec3c7 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -617,6 +617,8 @@ void cpu_reset(CPUX86State *env) env->dr[7] = DR7_FIXED_1; cpu_breakpoint_remove_all(env, BP_CPU); cpu_watchpoint_remove_all(env, BP_CPU); + + env->mcg_status = 0; } void cpu_x86_close(CPUX86State *env) -- cgit v1.2.3-65-gdbad