All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Egger, Christoph" <chegger@amazon.de>
To: Kai Huang <kai.huang@linux.intel.com>, xen-devel@lists.xen.org
Cc: yang.z.zhang@intel.com, jinsong.liu@alibaba-inc.com,
	kevin.tian@intel.com, dongxiao.xu@intel.com, JBeulich@suse.com
Subject: Re: [PATCH] x86/MCE: bypass uninitialized vcpu in vMCE injection
Date: Wed, 7 May 2014 15:25:04 +0200	[thread overview]
Message-ID: <536A3430.9060408@amazon.de> (raw)
In-Reply-To: <1399447758-11798-1-git-send-email-kai.huang@linux.intel.com>

On 07.05.14 09:29, Kai Huang wrote:
> 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..72fe924 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;
>  
> +        /* In case of broadcasting, don't inject to uninitialized VCPU */
> +        if ( vcpu == VMCE_INJECT_BROADCAST && !v->is_initialised )
> +            continue;
> +

What happens when you inject to exactly one uninitialized VCPU?
I think what you want is this:

           /* 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) )
> 

  parent reply	other threads:[~2014-05-07 13:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07  7:29 [PATCH] x86/MCE: bypass uninitialized vcpu in vMCE injection Kai Huang
2014-05-07  8:23 ` Jan Beulich
2014-05-07  8:27   ` Kai Huang
2014-05-07  8:38     ` Jan Beulich
2014-05-07  8:37       ` Kai Huang
2014-05-07 13:25 ` Egger, Christoph [this message]
2014-05-08  1:12   ` Kai Huang
2014-05-08  1:17     ` Kai Huang

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=536A3430.9060408@amazon.de \
    --to=chegger@amazon.de \
    --cc=JBeulich@suse.com \
    --cc=dongxiao.xu@intel.com \
    --cc=jinsong.liu@alibaba-inc.com \
    --cc=kai.huang@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.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.