From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH-RESEND] Disable MCE if MCE banks are not present Date: Mon, 3 Jun 2013 12:14:47 +0200 Message-ID: <51AC6C97.5010104@amazon.de> References: <97A500D504438F4ABC02EBA81613CC6322CEAA55@xmb-aln-x02.cisco.com> <51A92C7D.20600@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51A92C7D.20600@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: "xen-devel@lists.xensource.com" , "Aravindh Puthiyaparambil (aravindp)" List-Id: xen-devel@lists.xenproject.org On 01.06.13 01:04, Andrew Cooper wrote: > On 31/05/2013 22:46, Aravindh Puthiyaparambil (aravindp) wrote: >> (My previous email had extra line breaks. Hopefully this one does not. I have also included the patch as an attachement.) Yep. That's better. >> 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 > > Reviewed-by: Andrew Cooper Acked-by: Christoph Egger > >> >> 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@lists.xen.org > http://lists.xen.org/xen-devel >