From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hidetoshi Seto Subject: [PATCH] x86, mce: ignore SRAO only when MCG_SER_P is available Date: Thu, 21 Oct 2010 17:46:49 +0900 Message-ID: <4CBFFDF9.2080200@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , Marcelo Tosatti , Huang Ying , Dean Nelson , Jin Dongming To: qemu-devel@nongnu.org Return-path: Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:37209 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307Ab0JUIrD (ORCPT ); Thu, 21 Oct 2010 04:47:03 -0400 Received: from m3.gw.fujitsu.co.jp ([10.0.50.73]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o9L8l0iW028526 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Thu, 21 Oct 2010 17:47:01 +0900 Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 8989545DE4E for ; Thu, 21 Oct 2010 17:47:00 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 6966745DE4D for ; Thu, 21 Oct 2010 17:47:00 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 51B53E08003 for ; Thu, 21 Oct 2010 17:47:00 +0900 (JST) Received: from ml13.s.css.fujitsu.com (ml13.s.css.fujitsu.com [10.249.87.103]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 0CE1BE08001 for ; Thu, 21 Oct 2010 17:47:00 +0900 (JST) 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 786eeeb..a0d0603 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.6.5.2