[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Disable MCE if MCE banks are not present


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Aravindh Puthiyaparambil (aravindp)" <aravindp@xxxxxxxxx>
  • Date: Fri, 31 May 2013 21:18:22 +0000
  • Accept-language: en-US
  • Delivery-date: Fri, 31 May 2013 21:19:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac5eRA+rYCzuDL9GTi+s6RqJZUOnuw==
  • Thread-topic: [PATCH] Disable MCE if MCE banks are not present

Do not continue with machine check setup if MCE banks are not present. This fixes Xen boot on VMware hypervisors.

 

When booting Xen on VMware ESX 5.1 and Workstation 9, you hit a GPF during MCE initialization. The culprit is line 631 in set_poll_bankmask():

                bitmap_copy(mb->bank_map, mca_allbanks->bank_map, nr_mce_banks);

 

What is happening is that in mca_cap_init(), nr_mce_banks is being set to 0. This causes the allocation of bank_map to be set to ZERO_BLOCK_PTR which is the return value for zero-size allocation by xzalloc_array()/_xmalloc(). This results in the bitmap_copy() to fail disastrously. The following patch fixes this issue.

 

Signed-off-by: Aravindh Puthiyaparambil <aravindp@xxxxxxxxx>

 

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c

index 6712db1..9cbd4aa 100644

--- a/xen/arch/x86/cpu/mcheck/mce.c

+++ b/xen/arch/x86/cpu/mcheck/mce.c

@@ -652,7 +652,14 @@ int mca_cap_init(void)

     }

     nr_mce_banks = msr_content & MCG_CAP_COUNT;

 

-    /* mcabanks_alloc depends on nr_mcebanks */

+    if (!nr_mce_banks)

+    {

+        printk(XENLOG_INFO "CPU%i: No MCE banks present. "

+               "Machine check support disabled\n", smp_processor_id());

+        return -ENODEV;

+    }

+   

+    /* mcabanks_alloc depends on nr_mce_banks */

     if (!mca_allbanks)

     {

         int i;

 

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.