All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Huang <kai.huang@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: yang.z.zhang@intel.com, jinsong.liu@alibaba-inc.com,
	dongxiao.xu@intel.com, kevin.tian@intel.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] x86/MCE: bypass uninitialized vcpu in vMCE injection
Date: Wed, 07 May 2014 16:27:50 +0800	[thread overview]
Message-ID: <5369EE86.7080900@linux.intel.com> (raw)
In-Reply-To: <536A09B3020000780000FB5A@mail.emea.novell.com>


On 05/07/2014 04:23 PM, Jan Beulich wrote:
>>>> On 07.05.14 at 09:29, <kai.huang@linux.intel.com> wrote:
>> --- 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;
>> +
> Conceptually fine, but mechanically in need of improvement: Please
> fold the check with the previous one, to avoid checking for
> VMCE_INJECT_BROADCAST twice.
>
> I'd do this as
>
>          if ( vcpu != VMCE_INJECT_BROADCAST ? vcpu != v->vcpu_id
>                                             : !v->is_initialised )
>              continue;
Thanks for comments. In this case, is it OK to you to add below comments 
just before the if statement? I think it's better to keep the comments 
somewhere.

	/* In case of broadcasting, don't inject to uninitialized VCPU */
	if ( vcpu != VMCE_INJECT_BROADCAST ? vcpu != v->vcpu_id
                                            : !v->is_initialised )
             continue;

Thanks,
-Kai
>
> but if you prefer some other style (like nested if/else), that would
> be fine with me too.
>
> Also please don't forget to also Cc the second x86/MCE maintainer.
>
> Jan
>

  reply	other threads:[~2014-05-07  8:27 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 [this message]
2014-05-07  8:38     ` Jan Beulich
2014-05-07  8:37       ` Kai Huang
2014-05-07 13:25 ` Egger, Christoph
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=5369EE86.7080900@linux.intel.com \
    --to=kai.huang@linux.intel.com \
    --cc=JBeulich@suse.com \
    --cc=dongxiao.xu@intel.com \
    --cc=jinsong.liu@alibaba-inc.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.