mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
Add "broadcast" option for mce command
When the following test case is injected with mce command, maybe user could not get the expected result. DATA command cpu bank status mcg_status addr misc (qemu) mce 1 1 0xbd00000000000000 0x05 0x1234 0x8c Expected Result panic type: "Fatal Machine check" That is because each mce command can only inject the given cpu and could not inject mce interrupt to other cpus. So user will get the following result: panic type: "Fatal machine check on current CPU" "broadcast" option is used for injecting dummy data into other cpus. Injecting mce with this option the expected result could be gotten. Usage: Broadcast[on] command broadcast cpu bank status mcg_status addr misc (qemu) mce -b 1 1 0xbd00000000000000 0x05 0x1234 0x8c Broadcast[off] command cpu bank status mcg_status addr misc (qemu) mce 1 1 0xbd00000000000000 0x05 0x1234 0x8c Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
b3cd24e04a
commit
31ce5e0c49
6 changed files with 44 additions and 13 deletions
|
@ -2671,12 +2671,15 @@ static void do_inject_mce(Monitor *mon, const QDict *qdict)
|
|||
uint64_t mcg_status = qdict_get_int(qdict, "mcg_status");
|
||||
uint64_t addr = qdict_get_int(qdict, "addr");
|
||||
uint64_t misc = qdict_get_int(qdict, "misc");
|
||||
int broadcast = qdict_get_try_bool(qdict, "broadcast", 0);
|
||||
|
||||
for (cenv = first_cpu; cenv != NULL; cenv = cenv->next_cpu)
|
||||
for (cenv = first_cpu; cenv != NULL; cenv = cenv->next_cpu) {
|
||||
if (cenv->cpu_index == cpu_index && cenv->mcg_cap) {
|
||||
cpu_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc);
|
||||
cpu_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc,
|
||||
broadcast);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue