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.

Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
Acked-by: Christoph Egger <chegger@amazon.de>
master commit: a07084525c
master date: 2014-05-14 10:54:39 +0200
This commit is contained in:
Kai Huang authored and Jan Beulich committed 2014-05-23 15:30:22 +02:00
1 parent ecc692b21b
commit 84d7bd515e
1 file changed
+4
+4
View File
@@ -357,6 +357,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 ( (is_hvm_domain(d) ||
guest_has_trap_callback(d, v->vcpu_id, TRAP_machine_check)) &&
!test_and_set_bool(v->mce_pending) )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.