From: Kai Huang <kai.huang@linux.intel.com>
To: xen-devel@lists.xen.org
Cc: Kai Huang <kai.huang@linux.intel.com>,
jinsong.liu@alibaba-inc.com, chegger@amazon.de,
JBeulich@suse.com
Subject: [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection
Date: Fri, 9 May 2014 10:34:33 +0800 [thread overview]
Message-ID: <1399602873-18046-1-git-send-email-kai.huang@linux.intel.com> (raw)
Dom0 may bring up less number of vCPUs than xen hypervisor actually created for
it, and in this case, on Intel platform, vMCE injection to dom0 will fail due to
injecting vMCE to uninitialized vcpu, and cause dom0 crash.
Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
---
xen/arch/x86/cpu/mcheck/vmce.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index c83375e..73733df 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -356,6 +356,10 @@ int inject_vmce(struct domain *d, int vcpu)
if ( vcpu != VMCE_INJECT_BROADCAST && vcpu != v->vcpu_id )
continue;
+ /* Don't inject to uninitialized VCPU. */
+ if ( !v->is_initialised )
+ continue;
+
if ( (has_hvm_container_domain(d) ||
guest_has_trap_callback(d, v->vcpu_id, TRAP_machine_check)) &&
!test_and_set_bool(v->mce_pending) )
--
1.9.1
next reply other threads:[~2014-05-09 2:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 2:34 Kai Huang [this message]
2014-05-12 2:01 ` [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection Kai Huang
2014-05-12 9:00 ` Jan Beulich
2014-05-13 1:30 ` Kai Huang
2014-05-13 8:21 ` Egger, Christoph
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=1399602873-18046-1-git-send-email-kai.huang@linux.intel.com \
--to=kai.huang@linux.intel.com \
--cc=JBeulich@suse.com \
--cc=chegger@amazon.de \
--cc=jinsong.liu@alibaba-inc.com \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).