mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
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>
This commit is contained in:
1 parent
b14fed7151
commit
5cffb77c40
1 file changed
+8
-1
@@ -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%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;
|
||||
|
||||