aboutsummaryrefslogtreecommitdiff
path: root/target-i386/helper.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-10-11 15:31:18 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2010-10-20 16:15:04 -0500
commite7701825e17d74913b0f1585d523cedaf1d6632a (patch)
treed28a1230cf6cf0ccbc02367f42c84f5585edc98c /target-i386/helper.c
parenta8486bc9c91a10c9190bbd577f6f02b9eb515d90 (diff)
downloadqemu-e7701825e17d74913b0f1585d523cedaf1d6632a.zip
qemu-e7701825e17d74913b0f1585d523cedaf1d6632a.tar.gz
qemu-e7701825e17d74913b0f1585d523cedaf1d6632a.tar.bz2
kvm: x86: add mce support
Port qemu-kvm's MCE support commit c68b2374c9048812f488e00ffb95db66c0bc07a7 Author: Huang Ying <ying.huang@intel.com> Date: Mon Jul 20 10:00:53 2009 +0800 Add MCE simulation support to qemu/kvm KVM ioctls are used to initialize MCE simulation and inject MCE. The real MCE simulation is implemented in Linux kernel. The Kernel part has been merged. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index e134340..4b430dd 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -27,6 +27,7 @@
#include "exec-all.h"
#include "qemu-common.h"
#include "kvm.h"
+#include "kvm_x86.h"
//#define DEBUG_MMU
@@ -1030,6 +1031,11 @@ void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
if (bank >= bank_num || !(status & MCI_STATUS_VAL))
return;
+ if (kvm_enabled()) {
+ kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc);
+ return;
+ }
+
/*
* if MSR_MCG_CTL is not all 1s, the uncorrected error
* reporting is disabled