diff options
author | Huang Ying <ying.huang@intel.com> | 2009-06-23 10:05:14 +0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-09 16:04:53 -0500 |
commit | 79c4f6b08009a1d23177c2be8bd003253cf3686a (patch) | |
tree | c9a9e72451d20ba2ae8e0f5a14301522281add70 /target-i386/machine.c | |
parent | 2152390dca9975b1aaaa6f0518ebdd359477905b (diff) | |
download | qemu-79c4f6b08009a1d23177c2be8bd003253cf3686a.zip qemu-79c4f6b08009a1d23177c2be8bd003253cf3686a.tar.gz qemu-79c4f6b08009a1d23177c2be8bd003253cf3686a.tar.bz2 |
QEMU: MCE: Add MCE simulation to qemu/tcg
- MCE features are initialized when VCPU is intialized according to CPUID.
- A monitor command "mce" is added to inject a MCE.
- A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE.
aliguori: fix build for linux-user
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r-- | target-i386/machine.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c index 2a72b01..8bf13cc 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -158,7 +158,20 @@ void cpu_save(QEMUFile *f, void *opaque) qemu_put_sbe32s(f, &pending_irq); qemu_put_be32s(f, &env->mp_state); qemu_put_be64s(f, &env->tsc); -} + + /* MCE */ + qemu_put_be64s(f, &env->mcg_cap); + if (env->mcg_cap) { + qemu_put_be64s(f, &env->mcg_status); + qemu_put_be64s(f, &env->mcg_ctl); + for (i = 0; i < (env->mcg_cap & 0xff); i++) { + qemu_put_be64s(f, &env->mce_banks[4*i]); + qemu_put_be64s(f, &env->mce_banks[4*i + 1]); + qemu_put_be64s(f, &env->mce_banks[4*i + 2]); + qemu_put_be64s(f, &env->mce_banks[4*i + 3]); + } + } + } #ifdef USE_X86LDOUBLE /* XXX: add that in a FPU generic layer */ @@ -349,6 +362,20 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) qemu_get_be64s(f, &env->tsc); } + if (version_id >= 10) { + qemu_get_be64s(f, &env->mcg_cap); + if (env->mcg_cap) { + qemu_get_be64s(f, &env->mcg_status); + qemu_get_be64s(f, &env->mcg_ctl); + for (i = 0; i < (env->mcg_cap & 0xff); i++) { + qemu_get_be64s(f, &env->mce_banks[4*i]); + qemu_get_be64s(f, &env->mce_banks[4*i + 1]); + qemu_get_be64s(f, &env->mce_banks[4*i + 2]); + qemu_get_be64s(f, &env->mce_banks[4*i + 3]); + } + } + } + /* XXX: ensure compatiblity for halted bit ? */ /* XXX: compute redundant hflags bits */ env->hflags = hflags; |