x86/MCE: bypass uninitialized vcpu in vMCE injection
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
@@ -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
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.
Signed-off-by Kai Huang <[email protected]>--- xen/arch/x86/cpu/mcheck/vmce.c | 4 ++++ 1 file changed, 4 insertions(+)xen/arch/x86/cpu/mcheck/vmce.c +4
-0@@ -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) )
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
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
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.
Signed-off-by Kai Huang <[email protected]>
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@@ -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) )