diff options
author | Jin Dongming <jin.dongming@np.css.fujitsu.com> | 2010-12-10 17:20:44 +0900 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-01-21 14:05:22 -0200 |
commit | b3cd24e04a2aea342429c09ed93468dd3206fede (patch) | |
tree | b2082358b1bb8323014b26506e7ebb78fff3bee5 | |
parent | 14a095184c6068c78e67f17c200cf00b4170f704 (diff) |
Clean up cpu_inject_x86_mce()
Clean up cpu_inject_x86_mce() for later patch.
Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r-- | target-i386/helper.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c index 25a3e36138..2c94130a15 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1021,21 +1021,12 @@ static void breakpoint_handler(CPUState *env) /* This should come from sysemu.h - if we could include it here... */ void qemu_system_reset_request(void); -void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, +static void qemu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, uint64_t mcg_status, uint64_t addr, uint64_t misc) { uint64_t mcg_cap = cenv->mcg_cap; - unsigned bank_num = mcg_cap & 0xff; uint64_t *banks = cenv->mce_banks; - if (bank >= bank_num || !(status & MCI_STATUS_VAL)) - return; - - if (kvm_enabled()) { - kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc, 0); - return; - } - /* * if MSR_MCG_CTL is not all 1s, the uncorrected error * reporting is disabled @@ -1076,6 +1067,22 @@ void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, } else banks[1] |= MCI_STATUS_OVER; } + +void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, + uint64_t mcg_status, uint64_t addr, uint64_t misc) +{ + unsigned bank_num = cenv->mcg_cap & 0xff; + + if (bank >= bank_num || !(status & MCI_STATUS_VAL)) { + return; + } + + if (kvm_enabled()) { + kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc, 0); + } else { + qemu_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc); + } +} #endif /* !CONFIG_USER_ONLY */ static void mce_init(CPUX86State *cenv) |