xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6] X86/MCE: update vMCE injection for AMD
@ 2012-09-25  5:00 Liu, Jinsong
  2012-09-25  9:06 ` Christoph Egger
  0 siblings, 1 reply; 10+ messages in thread
From: Liu, Jinsong @ 2012-09-25  5:00 UTC (permalink / raw)
  To: Jan Beulich, Christoph Egger, xen-devel@lists.xensource.com
  Cc: keir@xen.org, Ian.Campbell@citrix.com

[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]

X86/MCE: update vMCE injection for AMD

For Intel MCE, it broadcasts vMCE to all vcpus. For AMD MCE, it injects
vMCE only to vcpu0. This patch update inject_vmce for AMD.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Suggested_by: Christoph Egger <Christoph.Egger@amd.com>

diff -r a6d12a1bc758 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Thu Sep 20 00:03:25 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Tue Sep 25 19:52:20 2012 +0800
@@ -168,7 +168,7 @@
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
-int inject_vmce(struct domain *d);
+int inject_vmce(struct domain *d, bool_t vmce_broadcast);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
diff -r a6d12a1bc758 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Sep 20 00:03:25 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Sep 25 19:52:20 2012 +0800
@@ -365,7 +365,7 @@
                 }
 
                 /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d) < 0 )
+                if ( inject_vmce(d, 1) < 0 )
                 {
                     mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
                       " failed\n", d->domain_id);
diff -r a6d12a1bc758 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Thu Sep 20 00:03:25 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Tue Sep 25 19:52:20 2012 +0800
@@ -344,11 +344,14 @@
 HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmce_save_vcpu_ctxt,
                           vmce_load_vcpu_ctxt, 1, HVMSR_PER_VCPU);
 
-int inject_vmce(struct domain *d)
+/* 
+ * for Intel MCE, broadcast vMCE to all vcpus
+ * for AMD MCE, only inject vMCE to vcpu0
+ */
+int inject_vmce(struct domain *d, bool_t vmce_broadcast)
 {
     struct vcpu *v;
 
-    /* inject vMCE to all vcpus */
     for_each_vcpu(d, v)
     {
         if ( !test_and_set_bool(v->mce_pending) &&
@@ -365,6 +368,9 @@
                        d->domain_id, v->vcpu_id);
             return -1;
         }
+
+        if ( !vmce_broadcast )
+            break;
     }
 
     return 0;

[-- Attachment #2: 6_vmce_inject_for_AMD.patch --]
[-- Type: application/octet-stream, Size: 2135 bytes --]

X86/MCE: update vMCE injection for AMD

For Intel MCE, it broadcasts vMCE to all vcpus. For AMD MCE, it injects
vMCE only to vcpu0. This patch update inject_vmce for AMD.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Suggested_by: Christoph Egger <Christoph.Egger@amd.com>

diff -r a6d12a1bc758 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h	Thu Sep 20 00:03:25 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce.h	Tue Sep 25 19:52:20 2012 +0800
@@ -168,7 +168,7 @@
 
 int fill_vmsr_data(struct mcinfo_bank *mc_bank, struct domain *d,
     uint64_t gstatus);
-int inject_vmce(struct domain *d);
+int inject_vmce(struct domain *d, bool_t vmce_broadcast);
 
 static inline int mce_vendor_bank_msr(const struct vcpu *v, uint32_t msr)
 {
diff -r a6d12a1bc758 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Sep 20 00:03:25 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Tue Sep 25 19:52:20 2012 +0800
@@ -365,7 +365,7 @@
                 }
 
                 /* We will inject vMCE to DOMU*/
-                if ( inject_vmce(d) < 0 )
+                if ( inject_vmce(d, 1) < 0 )
                 {
                     mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
                       " failed\n", d->domain_id);
diff -r a6d12a1bc758 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c	Thu Sep 20 00:03:25 2012 +0800
+++ b/xen/arch/x86/cpu/mcheck/vmce.c	Tue Sep 25 19:52:20 2012 +0800
@@ -344,11 +344,14 @@
 HVM_REGISTER_SAVE_RESTORE(VMCE_VCPU, vmce_save_vcpu_ctxt,
                           vmce_load_vcpu_ctxt, 1, HVMSR_PER_VCPU);
 
-int inject_vmce(struct domain *d)
+/* 
+ * for Intel MCE, broadcast vMCE to all vcpus
+ * for AMD MCE, only inject vMCE to vcpu0
+ */
+int inject_vmce(struct domain *d, bool_t vmce_broadcast)
 {
     struct vcpu *v;
 
-    /* inject vMCE to all vcpus */
     for_each_vcpu(d, v)
     {
         if ( !test_and_set_bool(v->mce_pending) &&
@@ -365,6 +368,9 @@
                        d->domain_id, v->vcpu_id);
             return -1;
         }
+
+        if ( !vmce_broadcast )
+            break;
     }
 
     return 0;

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2012-09-27  9:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25  5:00 [PATCH 6] X86/MCE: update vMCE injection for AMD Liu, Jinsong
2012-09-25  9:06 ` Christoph Egger
2012-09-25 10:48   ` Jan Beulich
2012-09-25 11:54     ` Christoph Egger
2012-09-26  3:11       ` Liu, Jinsong
2012-09-26  7:34         ` Jan Beulich
2012-09-27  5:22           ` Liu, Jinsong
2012-09-27  8:54             ` Christoph Egger
2012-09-27  9:45               ` Liu, Jinsong
2012-09-27  9:56                 ` Christoph Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).