From mboxrd@z Thu Jan 1 00:00:00 1970 From: Huang Ying Subject: Re: [BUGFIX] MCE: Fix bug of IA32_MCG_STATUS after system reset Date: Wed, 06 Jan 2010 16:17:42 +0800 Message-ID: <1262765862.17852.16.camel@yhuang-dev.sh.intel.com> References: <1262680448.31401.228.camel@yhuang-dev.sh.intel.com> <4B431968.9030304@redhat.com> <1262761513.17852.4.camel@yhuang-dev.sh.intel.com> <4B4443E2.3000709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , Andi Kleen , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from mga02.intel.com ([134.134.136.20]:22168 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753188Ab0AFIRo (ORCPT ); Wed, 6 Jan 2010 03:17:44 -0500 In-Reply-To: <4B4443E2.3000709@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2010-01-06 at 16:03 +0800, Avi Kivity wrote: > On 01/06/2010 09:05 AM, Huang Ying wrote: > > @@ -1015,6 +1015,7 @@ void kvm_arch_load_regs(CPUState *env) > >>> #endif > >>> set_msr_entry(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_time_msr); > >>> set_msr_entry(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr); > >>> + set_msr_entry(&msrs[n++], MSR_MCG_STATUS, 0); > >>> > >>> > >>> > >> Not sure why you reset this in kvm_arch_load_regs(). Shouldn't this be > >> in the cpu reset code? > >> > > I found kvm_arch_load_regs() is called by kvm_arch_cpu_reset(), which is > > called by qemu_kvm_system_reset(). It is not in cpu reset path? > > > > It is, but it is also called from many other places, which could cause > this msr to be zeroed. > > A better solution is to allocate it a field in CPUState, load and save > it in kvm_arch_*_regs, and zero it during reset. Yes. You are right. I will fix this. Best Regards, Huang Ying