* [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection
@ 2014-05-09 2:34 Kai Huang
2014-05-12 2:01 ` Kai Huang
2014-05-13 8:21 ` Egger, Christoph
0 siblings, 2 replies; 5+ messages in thread
From: Kai Huang @ 2014-05-09 2:34 UTC (permalink / raw)
To: xen-devel; +Cc: Kai Huang, jinsong.liu, chegger, JBeulich
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
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection
2014-05-09 2:34 [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection Kai Huang
@ 2014-05-12 2:01 ` Kai Huang
2014-05-12 9:00 ` Jan Beulich
2014-05-13 8:21 ` Egger, Christoph
1 sibling, 1 reply; 5+ messages in thread
From: Kai Huang @ 2014-05-12 2:01 UTC (permalink / raw)
To: jinsong.liu, chegger, JBeulich; +Cc: xen-devel
Hi Egger, Jan, Jinsong,
Ping. Would you take a look again?
Thanks,
-Kai
On 05/09/2014 10:34 AM, 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..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) )
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection
2014-05-12 2:01 ` Kai Huang
@ 2014-05-12 9:00 ` Jan Beulich
2014-05-13 1:30 ` Kai Huang
0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2014-05-12 9:00 UTC (permalink / raw)
To: Kai Huang; +Cc: jinsong.liu, chegger, xen-devel
>>> On 12.05.14 at 04:01, <kai.huang@linux.intel.com> wrote:
> Hi Egger, Jan, Jinsong,
>
> Ping. Would you take a look again?
Mind being a little more patient? You sent this on Friday, i.e. taking the
weekend into account, you did give it just about a day before pinging.
If you pinged after a week, that would be acceptable.
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection
2014-05-12 9:00 ` Jan Beulich
@ 2014-05-13 1:30 ` Kai Huang
0 siblings, 0 replies; 5+ messages in thread
From: Kai Huang @ 2014-05-13 1:30 UTC (permalink / raw)
To: Jan Beulich; +Cc: jinsong.liu, chegger, xen-devel
On 05/12/2014 05:00 PM, Jan Beulich wrote:
>>>> On 12.05.14 at 04:01, <kai.huang@linux.intel.com> wrote:
>> Hi Egger, Jan, Jinsong,
>>
>> Ping. Would you take a look again?
> Mind being a little more patient? You sent this on Friday, i.e. taking the
> weekend into account, you did give it just about a day before pinging.
> If you pinged after a week, that would be acceptable.
Sorry that not familiar with this. Will follow in the future.
Thanks,
-Kai
>
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection
2014-05-09 2:34 [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection Kai Huang
2014-05-12 2:01 ` Kai Huang
@ 2014-05-13 8:21 ` Egger, Christoph
1 sibling, 0 replies; 5+ messages in thread
From: Egger, Christoph @ 2014-05-13 8:21 UTC (permalink / raw)
To: Kai Huang, xen-devel; +Cc: jinsong.liu, JBeulich
On 09.05.14 04:34, 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>
Acked-by: Christoph Egger <chegger@amazon.de>
> ---
> 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) )
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-13 8:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09 2:34 [PATCH v2] x86/MCE: bypass uninitialized vcpu in vMCE injection Kai Huang
2014-05-12 2:01 ` Kai Huang
2014-05-12 9:00 ` Jan Beulich
2014-05-13 1:30 ` Kai Huang
2014-05-13 8:21 ` Egger, Christoph
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).