From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUMha-00049k-44 for qemu-devel@nongnu.org; Mon, 11 Jan 2010 11:01:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUMhV-00046j-Ka for qemu-devel@nongnu.org; Mon, 11 Jan 2010 11:01:09 -0500 Received: from [199.232.76.173] (port=56647 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUMhV-00046b-8e for qemu-devel@nongnu.org; Mon, 11 Jan 2010 11:01:05 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:56810) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUMhU-0002oc-T9 for qemu-devel@nongnu.org; Mon, 11 Jan 2010 11:01:04 -0500 Received: by yxe26 with SMTP id 26so20730971yxe.4 for ; Mon, 11 Jan 2010 08:01:03 -0800 (PST) Message-ID: <4B4B4B37.9090102@codemonkey.ws> Date: Mon, 11 Jan 2010 10:00:55 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset References: <1262680344.31401.226.camel@yhuang-dev.sh.intel.com> In-Reply-To: <1262680344.31401.226.camel@yhuang-dev.sh.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Huang Ying Cc: qemu-devel@nongnu.org On 01/05/2010 02:32 AM, Huang Ying wrote: > 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 > Applied. Thanks. Regards, Anthony Liguori > --- > 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) > > > > > >