From: Christoph Egger <chegger@amazon.de>
To: "Aravindh Puthiyaparambil (aravindp)" <aravindp@cisco.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] Disable MCE if MCE banks are not present
Date: Mon, 3 Jun 2013 11:55:45 +0200 [thread overview]
Message-ID: <51AC6821.6070300@amazon.de> (raw)
In-Reply-To: <97A500D504438F4ABC02EBA81613CC6322CEA947@xmb-aln-x02.cisco.com>
On 31.05.13 23:18, Aravindh Puthiyaparambil (aravindp) wrote:
> 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@cisco.com
> <mailto:aravindp@cisco.com>>
Acked-by: Christoph Egger <chegger@amazon.de>
Christoph
>
>
>
> 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
>
prev parent reply other threads:[~2013-06-03 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 21:18 [PATCH] Disable MCE if MCE banks are not present Aravindh Puthiyaparambil (aravindp)
2013-06-03 9:55 ` Christoph Egger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51AC6821.6070300@amazon.de \
--to=chegger@amazon.de \
--cc=aravindp@cisco.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.