x86/vmce: fill MSR_IA32_MCG_STATUS on all vcpus in broadcast case
authorHaozhong Zhang <haozhong.zhang@intel.com>
Wed, 8 Mar 2017 14:10:29 +0000 (15:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Mar 2017 14:10:29 +0000 (15:10 +0100)
commit795b988e7c3d271c9472d4b9150b57a3e5b5a50b
tree9ef8ad5e77467f0951ea75d78cb1b0844eba8c2a
parent2bb81abf0430cbe9a7d4dd29f32ee1d0b47a16d7
x86/vmce: fill MSR_IA32_MCG_STATUS on all vcpus in broadcast case

The current implementation only fills MC MSRs on vcpu0 and leaves MC
MSRs on other vcpus empty in the broadcast case. When guest reads 0
from MSR_IA32_MCG_STATUS on vcpuN (N > 0), it may think it's not
possible to recover the execution on that vcpu and then get panic,
although MSR_IA32_MCG_STATUS filled on vcpu0 may imply the injected
vMCE is actually recoverable. To avoid such unnecessary guest panic,
set MSR_IA32_MCG_STATUS on vcpuN (N > 0) to MCG_STATUS_MCIP|MCG_STATUS_RIPV.

In addition, fill_vmsr_data(mc_bank, ...) is changed to return -EINVAL
rather than 0, if an invalid domain ID is contained in mc_bank.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/mcheck/mcaction.c
xen/arch/x86/cpu/mcheck/vmce.c
xen/arch/x86/cpu/mcheck/vmce.h