All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] kvm, x86: ignore SRAO only when MCG_SER_P is available
@ 2010-10-14  8:41 ` Jin Dongming
  0 siblings, 0 replies; 2+ messages in thread
From: Jin Dongming @ 2010-10-14  8:41 UTC (permalink / raw)
  To: KVM list
  Cc: Dean Nelson, Marcelo Tosatti, Huang Ying, Hidetoshi Seto,
	qemu-devel@nongnu.org, Avi Kivity

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>
Tested-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
---
 qemu-kvm.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/qemu-kvm.c b/qemu-kvm.c
index e78d850..6f62973 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -1903,12 +1903,15 @@ 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.1.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-14  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14  8:41 [PATCH 01/11] kvm, x86: ignore SRAO only when MCG_SER_P is available Jin Dongming
2010-10-14  8:41 ` [Qemu-devel] " Jin Dongming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.