public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Jin Dongming <jin.dongming@np.css.fujitsu.com>,
	KVM list <kvm@vger.kernel.org>, Dean Nelson <dnelson@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Avi Kivity <avi@redhat.com>, Huang Ying <ying.huang@intel.com>
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	[thread overview]
Message-ID: <4CBCFCA4.60307@jp.fujitsu.com> (raw)
In-Reply-To: <4CBCFB71.3070103@jp.fujitsu.com>

And restruct this block to call kvm_mce_in_exception() only when it is
required.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
---
 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



  reply	other threads:[~2010-10-19  2:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14  8:55 [PATCH 11/11] kvm, x86: broadcast mce depending on the cpu version Jin Dongming
2010-10-15  1:06 ` Marcelo Tosatti
2010-10-15  1:52   ` [Qemu-devel] " Hidetoshi Seto
2010-10-15  4:56     ` Huang Ying
2010-10-15 13:30     ` Marcelo Tosatti
2010-10-19  1:59       ` Hidetoshi Seto
2010-10-19  2:04         ` Hidetoshi Seto [this message]
2010-10-19  2:04         ` [PATCH uq/master 2/2] " Hidetoshi Seto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CBCFCA4.60307@jp.fujitsu.com \
    --to=seto.hidetoshi@jp.fujitsu.com \
    --cc=avi@redhat.com \
    --cc=dnelson@redhat.com \
    --cc=jin.dongming@np.css.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox