aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravindh Puthiyaparambil <aravindp@cisco.com>2013-06-17 11:12:06 +0200
committerJan Beulich <jbeulich@suse.com>2013-06-17 11:12:06 +0200
commit455a677fbfbfca0dcb985f0ae485437483787347 (patch)
tree299ca5b4e30ac95912dd157318c3cec7d8e7b1d3
parentdf751b6da15afff1f87a68f63013dd96e9563047 (diff)
downloadxen-455a677fbfbfca0dcb985f0ae485437483787347.tar.gz
xen-455a677fbfbfca0dcb985f0ae485437483787347.tar.bz2
xen-455a677fbfbfca0dcb985f0ae485437483787347.zip
x86/MCE: disable if MCE banks are not present
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@cisco.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Christoph Egger <chegger@amazon.de> master commit: 5cffb77c4072fa5b46700a2dbb3e46c5a54eba6d master date: 2013-06-03 15:42:46 +0200
-rw-r--r--xen/arch/x86/cpu/mcheck/mce.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 1842e5244d..7704bba557 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -734,7 +734,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%u: 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;