From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSFAP-0004Ce-IH for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:34:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSFAK-00048W-Vg for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:34:08 -0500 Received: from [199.232.76.173] (port=60636 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSFAJ-00048N-JZ for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:34:03 -0500 Received: from mx20.gnu.org ([199.232.41.8]:35695) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSFAJ-00050m-7k for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:34:03 -0500 Received: from mga01.intel.com ([192.55.52.88]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NS4r2-00059Y-EU for qemu-devel@nongnu.org; Tue, 05 Jan 2010 03:33:28 -0500 From: Huang Ying Content-Type: text/plain; charset="UTF-8" Date: Tue, 05 Jan 2010 16:32:24 +0800 Message-ID: <1262680344.31401.226.camel@yhuang-dev.sh.intel.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org 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 --- target-i386/helper.c | 2 ++ 1 file changed, 2 insertions(+) --- 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)