From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hidetoshi Seto Subject: [PATCH uq/master 1/2] kvm, x86: ignore SRAO only when MCG_SER_P is available Date: Tue, 19 Oct 2010 11:04:20 +0900 Message-ID: <4CBCFCA4.60307@jp.fujitsu.com> References: <4CB6C580.1090804@np.css.fujitsu.com> <20101015010649.GB32272@amt.cnet> <4CB7B3C5.7070102@jp.fujitsu.com> <20101015133012.GA16246@amt.cnet> <4CBCFB71.3070103@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jin Dongming , KVM list , Dean Nelson , "qemu-devel@nongnu.org" , Avi Kivity , Huang Ying To: Marcelo Tosatti Return-path: Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:50882 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755244Ab0JSCEr (ORCPT ); Mon, 18 Oct 2010 22:04:47 -0400 Received: from m4.gw.fujitsu.co.jp ([10.0.50.74]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o9J24fKM032657 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Tue, 19 Oct 2010 11:04:42 +0900 Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id F29F045DE7A for ; Tue, 19 Oct 2010 11:04:40 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id C903045DE6E for ; Tue, 19 Oct 2010 11:04:40 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id A99741DB803F for ; Tue, 19 Oct 2010 11:04:40 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 61A1D1DB8037 for ; Tue, 19 Oct 2010 11:04:37 +0900 (JST) In-Reply-To: <4CBCFB71.3070103@jp.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: And restruct this block to call kvm_mce_in_exception() only when it is required. Signed-off-by: Hidetoshi Seto --- target-i386/kvm.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index d940175..98a0505 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -239,12 +239,16 @@ static void kvm_do_inject_x86_mce(void *_data) struct kvm_x86_mce_data *data = _data; int r; - /* If there is an MCE excpetion being processed, ignore this SRAO MCE */ - r = kvm_mce_in_exception(data->env); - if (r == -1) - fprintf(stderr, "Failed to get MCE status\n"); - else if (r && !(data->mce->status & MCI_STATUS_AR)) - return; + /* If there is an MCE exception being processed, ignore this SRAO MCE */ + if ((data->env->mcg_cap & MCG_SER_P) && + !(data->mce->status & MCI_STATUS_AR)) { + r = kvm_mce_in_exception(data->env); + if (r == -1) { + fprintf(stderr, "Failed to get MCE status\n"); + } else if (r) { + return; + } + } r = kvm_set_mce(data->env, data->mce); if (r < 0) { -- 1.7.3.1