Skip to contentSkip to conversation

x86/MCE: bypass uninitialized vcpu in vMCE injection

PATCH In review Kai Huang 3 participants 5 messages May 9, 2014 – May 13, 2014

lore
Share & tools
lore

Kai Huang

author
#0 lore raw

PATCH v2 1/1 x86/MCE: bypass uninitialized vcpu in vMCE injection

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.

---
 xen/arch/x86/cpu/mcheck/vmce.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/arch/x86/cpu/mcheck/vmce.c +4 -0
index c83375e..73733df 100644
@@ -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) )
Signature · 1 line
1.9.1
author
#1 lore raw

Hi Egger, Jan, Jinsong,

Ping. Would you take a look again?

Thanks,
-Kai

Quoted 24 lines · Kai Huang

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.

---
  xen/arch/x86/cpu/mcheck/vmce.c | 4 ++++
  1 file changed, 4 insertions(+)
xen/arch/x86/cpu/mcheck/vmce.c +4 -0
index c83375e..73733df 100644
@@ -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) )
#2 lore raw
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 12.05.14 at 04:01, <[email protected]> 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

author
#3 lore raw
Quoted 7 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 12.05.14 at 04:01, <[email protected]> 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

Quoted 8 lines

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v2 1/1
#4 lore raw
In reply to Kai Huang
Quoted 5 lines · Kai Huang

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.

Quoted 20 lines
---
 xen/arch/x86/cpu/mcheck/vmce.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/arch/x86/cpu/mcheck/vmce.c +4 -0
index c83375e..73733df 100644
@@ -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) )