diff mbox

[v2,02/12] x86/mce_intel: refine messages of MCA capabilities

Message ID 20170317064614.23539-3-haozhong.zhang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Haozhong Zhang March 17, 2017, 6:46 a.m. UTC
... to only print available ones.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/mce_intel.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Comments

Jan Beulich March 20, 2017, 1:10 p.m. UTC | #1
>>> On 17.03.17 at 07:46, <haozhong.zhang@intel.com> wrote:
> ... to only print available ones.

Suggested-by: Jan Beulich <jbeulich@suse.com>

> Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox

Patch

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b0d8280..48f41d6 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -724,11 +724,15 @@  static void intel_init_mca(struct cpuinfo_x86 *c)
 
     first = mce_firstbank(c);
 
+#define CAP(enabled, name) ((enabled) ? ", "name : "")
     if (smp_processor_id() == 0)
     {
-        dprintk(XENLOG_INFO, "MCA Capability: BCAST %x SER %x"
-                " CMCI %x firstbank %x extended MCE MSR %x\n",
-                broadcast, ser, cmci, first, ext_num);
+        dprintk(XENLOG_INFO,
+                "MCA Capability: firstbank %d, extended MCE MSR %d%s%s%s\n",
+                first, ext_num,
+                CAP(broadcast, "BCAST"),
+                CAP(ser, "SER"),
+                CAP(cmci, "CMCI"));
 
         mce_broadcast = broadcast;
         cmci_support = cmci;
@@ -739,12 +743,15 @@  static void intel_init_mca(struct cpuinfo_x86 *c)
     else if (cmci != cmci_support || ser != ser_support ||
              broadcast != mce_broadcast ||
              first != firstbank || ext_num != nr_intel_ext_msrs)
-    {
         dprintk(XENLOG_WARNING,
-                "CPU %u has different MCA capability (%x,%x,%x,%x,%x)"
+                "CPU %u has different MCA capability "
+                "(firstbank %d, extended MCE MSR %d%s%s%s)"
                 " than BSP, may cause undetermined result!!!\n",
-                smp_processor_id(), broadcast, ser, cmci, first, ext_num);
-    }
+                smp_processor_id(), first, ext_num,
+                CAP(broadcast, "BCAST"),
+                CAP(ser, "SER"),
+                CAP(cmci, "CMCI"));
+#undef CAP
 }
 
 static void intel_mce_post_reset(void)