[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/19] target-i386: seperate MCIP & MCE_MASK error reason
From: |
Paolo Bonzini |
Subject: |
[PULL 15/19] target-i386: seperate MCIP & MCE_MASK error reason |
Date: |
Mon, 5 Oct 2020 10:23:45 +0200 |
From: zhenwei pi <pizhenwei@bytedance.com>
Previously we would only get a simple string "Triple fault" in qemu
log. Add detailed message for the two reasons to describe why qemu
has to reset the guest.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20200930100440.1060708-2-pizhenwei@bytedance.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/helper.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/target/i386/helper.c b/target/i386/helper.c
index 70be53e2c3..17e1684ff9 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -857,6 +857,8 @@ static void do_inject_x86_mce(CPUState *cs, run_on_cpu_data
data)
X86CPU *cpu = X86_CPU(cs);
CPUX86State *cenv = &cpu->env;
uint64_t *banks = cenv->mce_banks + 4 * params->bank;
+ g_autofree char *msg = NULL;
+ bool need_reset = false;
cpu_synchronize_state(cs);
@@ -894,16 +896,25 @@ static void do_inject_x86_mce(CPUState *cs,
run_on_cpu_data data)
return;
}
- if ((cenv->mcg_status & MCG_STATUS_MCIP) ||
- !(cenv->cr[4] & CR4_MCE_MASK)) {
- monitor_printf(params->mon,
- "CPU %d: Previous MCE still in progress, raising"
- " triple fault\n",
- cs->cpu_index);
- qemu_log_mask(CPU_LOG_RESET, "Triple fault\n");
+ if (cenv->mcg_status & MCG_STATUS_MCIP) {
+ need_reset = true;
+ msg = g_strdup_printf("CPU %d: Previous MCE still in progress, "
+ "raising triple fault", cs->cpu_index);
+ }
+
+ if (!(cenv->cr[4] & CR4_MCE_MASK)) {
+ need_reset = true;
+ msg = g_strdup_printf("CPU %d: MCE capability is not enabled, "
+ "raising triple fault", cs->cpu_index);
+ }
+
+ if (need_reset) {
+ monitor_printf(params->mon, "%s", msg);
+ qemu_log_mask(CPU_LOG_RESET, "%s\n", msg);
qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
return;
}
+
if (banks[1] & MCI_STATUS_VAL) {
params->status |= MCI_STATUS_OVER;
}
--
2.26.2
- [PULL 07/19] configure: compute derivatives of target name in meson, (continued)
- [PULL 07/19] configure: compute derivatives of target name in meson, Paolo Bonzini, 2020/10/05
- [PULL 04/19] configure: rewrite accelerator defaults as tests, Paolo Bonzini, 2020/10/05
- [PULL 03/19] configure: convert accelerator variables to meson options, Paolo Bonzini, 2020/10/05
- [PULL 06/19] configure: remove dead variable, Paolo Bonzini, 2020/10/05
- [PULL 08/19] configure: remove useless config-target.mak symbols, Paolo Bonzini, 2020/10/05
- [PULL 05/19] configure: move accelerator logic to meson, Paolo Bonzini, 2020/10/05
- [PULL 11/19] configure: move OpenBSD W^X test to meson, Paolo Bonzini, 2020/10/05
- [PULL 12/19] default-configs: use TARGET_ARCH key, Paolo Bonzini, 2020/10/05
- [PULL 10/19] default-configs: remove default-configs/devices for user-mode targets, Paolo Bonzini, 2020/10/05
- [PULL 13/19] default-configs: remove redundant keys, Paolo Bonzini, 2020/10/05
- [PULL 15/19] target-i386: seperate MCIP & MCE_MASK error reason,
Paolo Bonzini <=
- [PULL 16/19] qapi/run-state.json: introduce memory failure event, Paolo Bonzini, 2020/10/05
- [PULL 09/19] configure: remove target configuration, Paolo Bonzini, 2020/10/05
- [PULL 19/19] dockerfiles: add diffutils to Fedora, Paolo Bonzini, 2020/10/05
- [PULL 14/19] meson: move sparse detection to Meson and rewrite check_sparse.py, Paolo Bonzini, 2020/10/05
- [PULL 17/19] target-i386: post memory failure event to QMP, Paolo Bonzini, 2020/10/05
- [PULL 18/19] tests: tcg: do not use implicit rules, Paolo Bonzini, 2020/10/05
- Re: [PULL 00/19] Build system + MCE patches for 2020-10-05, Peter Maydell, 2020/10/05