All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "keith.coleman@n2servers.com" <keith.coleman@n2servers.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: Keir Fraser <keir.xen@gmail.com>
Subject: Xen-3.x fix pagefault in cmci handler
Date: Thu, 1 Mar 2012 12:22:43 +0000	[thread overview]
Message-ID: <4F4F6A13.8020703@citrix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

Hello,

XenServer has just had a support escalation, which resulted in this fix.

It appears that certain Intel CPUs (X56xx series) with hyperthreading
enabled have a race condition between an SMI (from the legacy USB
support in this case) and an AP (the other hyperthread) between
SIPI/INIT and trying to execute the first trampoline instruction.

The race condition results in a CMCI complaining about a parity error in
an instruction cache is delivered to Xen as soon as the SMI handler
returns. On Xen-3.x, the CMCI handler dereferences the dom0 pointer,
resulting in a pagefault at this point in boot.

Intel are working to track down why the CMCI is occurring in the first
place, but as it is apparently benign, Xen should continue to boot
regardless.

This error does not affect Xen-4.x, as it correctly checks that the dom0
pointer is not null before trying to use it.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


[-- Attachment #2: cmci-fix-pagefault.patch --]
[-- Type: text/x-patch, Size: 1020 bytes --]

# HG changeset patch
# Parent ac68ad6fe4b779ca0b894ca3845b66662dd2dd9c
CMCI: Fix pagefault

The CMCI handler blindly dereferences the dom0 pointer.  If a CMCI occurs during
early boot, this results in a page fault and reboot.

Check the dom0 pointer first.  If it is null, then the CMCI information is
dumped onto the Xen console, and booting continues happily.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r ac68ad6fe4b7 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -705,7 +705,7 @@ fastcall void smp_cmci_interrupt(struct 
         MCA_CMCI_HANDLER, __get_cpu_var(mce_banks_owned), &bs);
 
     if (bs.errcnt && mctc != NULL) {
-        if (guest_enabled_event(dom0->vcpu[0], VIRQ_MCA)) {
+        if (dom0 && guest_enabled_event(dom0->vcpu[0], VIRQ_MCA)) {
             mctelem_commit(mctc);
             printk(KERN_DEBUG "CMCI: send CMCI to DOM0 through virq\n");
             send_guest_global_virq(dom0, VIRQ_MCA);

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

                 reply	other threads:[~2012-03-01 12:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4F4F6A13.8020703@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=keir.xen@gmail.com \
    --cc=keith.coleman@n2servers.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.