|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] x86/MCE: bypass uninitialized vcpu in vMCE injection
>>> On 07.05.14 at 09:29, <kai.huang@xxxxxxxxxxxxxxx> 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;
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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |