kvm: x86: Inject pending MCE events on state writeback
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 2 Mar 2011 07:56:14 +0000 (08:56 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 15 Mar 2011 04:19:05 +0000 (01:19 -0300)
commit6ea2ccf14339a8e118aa176fbf1b70dee1195701
tree773ee3ac440c93a30a76e7a9886af6cf31a8e035
parent5144b22e9c9fda7ada3498fdb8365a40700422a2
kvm: x86: Inject pending MCE events on state writeback

The current way of injecting MCE events without updating of and
synchronizing with the CPUState is broken and causes spurious
corruptions of the MCE-related parts of the CPUState.

As a first step towards a fix, enhance the state writeback code with
support for injecting events that are pending in the CPUState. A pending
exception will then be signaled via cpu_interrupt(CPU_INTERRUPT_MCE).
And, just like for TCG, we need to leave the halt state when
CPU_INTERRUPT_MCE is pending (left broken for the to-be-removed old KVM
code).

This will also allow to unify TCG and KVM injection code.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
CC: Huang Ying <ying.huang@intel.com>
CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
CC: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
target-i386/kvm.c