qemu-patch-raspberry4/target/ppc
Ganesh Goudar 211a7784b9 target/ppc: Fix wrong interpretation of the disposition flag.
Bitwise AND with kvm_run->flags to evaluate if we recovered from
MCE or not is not correct, As disposition in kvm_run->flags is a
two-bit integer value and not a bit map, So check for equality
instead of bitwise AND.

Without the fix qemu treats any unrecoverable mce error as recoverable
and ends up in a mce loop inside the guest, Below are the MCE logs before
and after the fix.

Before fix:

[   66.775757] MCE: CPU0: Initiator CPU
[   66.775891] MCE: CPU0: Unknown
[   66.776587] MCE: CPU0: machine check (Harmless) Host UE Indeterminate [Recovered]
[   66.776857] MCE: CPU0: NIP: [c0080000000e00b8] mcetest_tlbie+0xb0/0x128 [mcetest_tlbie]

After fix:

[ 20.650577] CPU: 0 PID: 1415 Comm: insmod Tainted: G M O 5.6.0-fwnmi-arv+ #11
[ 20.650618] NIP: c0080000023a00e8 LR: c0080000023a00d8 CTR: c000000000021fe0
[ 20.650660] REGS: c0000001fffd3d70 TRAP: 0200 Tainted: G M O (5.6.0-fwnmi-arv+)
[ 20.650708] MSR: 8000000002a0b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE> CR: 42000222 XER: 20040000
[ 20.650758] CFAR: c00000000000b940 DAR: c0080000025e00e0 DSISR: 00000200 IRQMASK: 0
[ 20.650758] GPR00: c0080000023a00d8 c0000001fddd79a0 c0080000023a8500 0000000000000039
[ 20.650758] GPR04: 0000000000000001 0000000000000000 0000000000000000 0000000000000007
[ 20.650758] GPR08: 0000000000000007 c0080000025e00e0 0000000000000000 00000000000000f7
[ 20.650758] GPR12: 0000000000000000 c000000001900000 c00000000101f398 c0080000025c052f
[ 20.650758] GPR16: 00000000000003a8 c0080000025c0000 c0000001fddd7d70 c0000000015b7940
[ 20.650758] GPR20: 000000000000fff1 c000000000f72c28 c0080000025a0988 0000000000000000
[ 20.650758] GPR24: 0000000000000100 c0080000023a05d0 c0000000001f1d70 0000000000000000
[ 20.650758] GPR28: c0000001fde20000 c0000001fd02b2e0 c0080000023a0000 c0080000025e0000
[ 20.651178] NIP [c0080000023a00e8] mcetest_tlbie+0xe8/0xf0 [mcetest_tlbie]
[ 20.651220] LR [c0080000023a00d8] mcetest_tlbie+0xd8/0xf0 [mcetest_tlbie]
[ 20.651262] Call Trace:
[ 20.651280] [c0000001fddd79a0] [c0080000023a00d8] mcetest_tlbie+0xd8/0xf0 [mcetest_tlbie] (unreliable)
[ 20.651340] [c0000001fddd7a10] [c00000000001091c] do_one_initcall+0x6c/0x2c0
[ 20.651390] [c0000001fddd7af0] [c0000000001f7998] do_init_module+0x90/0x298
[ 20.651433] [c0000001fddd7b80] [c0000000001f61a8] load_module+0x1f58/0x27a0
[ 20.651476] [c0000001fddd7d40] [c0000000001f6c70] __do_sys_finit_module+0xe0/0x100
[ 20.651526] [c0000001fddd7e20] [c00000000000b9d0] system_call+0x5c/0x68
[ 20.651567] Instruction dump:
[ 20.651594] e8410018 3c620000 e8638020 480000cd e8410018 3c620000 e8638028 480000bd
[ 20.651646] e8410018 7be904e4 39400000 612900e0 <7d434a64> 4bffff74 3c4c0001 38428410
[ 20.651699] ---[ end trace 4c40897f016b4340 ]---
[ 20.653310]
Bus error
[ 20.655575] MCE: CPU0: machine check (Harmless) Host UE Indeterminate [Not recovered]
[ 20.655575] MCE: CPU0: NIP: [c0080000023a00e8] mcetest_tlbie+0xe8/0xf0 [mcetest_tlbie]
[ 20.655576] MCE: CPU0: Initiator CPU
[ 20.655576] MCE: CPU0: Unknown

Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
Message-Id: <20200408170944.16003-1-ganeshgr@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-04-17 10:38:29 +10:00
..
translate target/ppc: Fix typo in comments 2020-02-21 09:15:04 +11:00
arch_dump.c target/ppc: Add helper_mfvscr 2019-02-18 11:00:44 +11:00
compat.c target/ppc: Add POWER10 DD1.0 model information 2019-12-17 10:39:48 +11:00
cpu-models.c target/ppc: Add POWER10 DD1.0 model information 2019-12-17 10:39:48 +11:00
cpu-models.h target/ppc: Add POWER10 DD1.0 model information 2019-12-17 10:39:48 +11:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu-qom.h x86 and machine queue for 5.0 soft freeze 2020-03-19 14:22:46 +00:00
cpu.c target/ppc: support for 32-bit carry and overflow 2017-03-01 11:23:39 +11:00
cpu.h Testing and gdbstub updates: 2020-03-18 20:25:23 +00:00
dfp_helper.c target/ppc: remove unnecessary if() around calls to set_dfp{64,128}() in DFP macros 2019-10-04 19:08:21 +10:00
excp_helper.c target/ppc: allow ppc_cpu_do_system_reset to take an alternate vector 2020-03-17 17:00:22 +11:00
fpu_helper.c target/ppc: Fix typo in comments 2020-02-21 09:15:04 +11:00
gdbstub.c gdbstub: extend GByteArray to read register helpers 2020-03-17 17:38:38 +00:00
helper.h target/ppc: Fix ISA v3.0 (POWER9) slbia implementation 2020-03-24 11:56:14 +11:00
helper_regs.h ppc: Ignore the CPU_INTERRUPT_EXITTB interrupt with KVM 2019-12-17 10:39:48 +11:00
int_helper.c target/ppc: use Vsr macros in BCD helpers 2019-10-04 19:08:21 +10:00
internal.h ppc: Add support for 'mffscrn','mffscrni' instructions 2019-10-04 10:25:23 +10:00
kvm-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
kvm.c target/ppc: Fix wrong interpretation of the disposition flag. 2020-04-17 10:38:29 +10:00
kvm_ppc.h ppc/spapr: KVM FWNMI should not be enabled until guest requests it 2020-04-07 08:55:10 +10:00
machine.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
Makefile.objs build: remove CONFIG_LIBDECNUMBER 2017-10-16 18:03:52 +02:00
mem_helper.c target/ppc: Use probe_write for DCBZ 2020-02-03 11:33:11 +11:00
mfrom_table.inc.c target/ppc: Style fixes for mfrom_table.inc.c & mfrom_table_gen.c 2019-04-26 10:42:38 +10:00
mfrom_table_gen.c target/ppc: Style fixes for mfrom_table.inc.c & mfrom_table_gen.c 2019-04-26 10:42:38 +10:00
misc_helper.c target/ppc: add support for Hypervisor Facility Unavailable Exception 2020-02-02 14:07:57 +11:00
mmu-book3s-v3.c target/ppc: Support for POWER9 native hash 2019-02-26 09:21:25 +11:00
mmu-book3s-v3.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
mmu-hash32.c ppc/hash32: Rework R and C bit updates 2019-04-26 11:37:57 +10:00
mmu-hash32.h target/ppc: Manage external HPT via virtual hypervisor 2017-03-01 11:23:39 +11:00
mmu-hash64.c target/ppc: Fix ISA v3.0 (POWER9) slbia implementation 2020-03-24 11:56:14 +11:00
mmu-hash64.h ppc/hash64: Rework R and C bit updates 2019-04-26 11:37:57 +10:00
mmu-radix64.c ppc/pnv: Add support for HRMOR on Radix host 2020-02-02 14:07:57 +11:00
mmu-radix64.h target/ppc: Rename PATB/PATBE -> PATE 2019-02-26 09:21:25 +11:00
mmu_helper.c target/ppc: Rewrite a fall through comment 2019-08-21 10:57:28 +02:00
monitor.c hmp: Move hmp.h to include/monitor/ 2019-07-02 07:19:45 +02:00
timebase_helper.c hw/ppc: Take QEMU lock when calling ppc_dcr_read/write() 2020-03-24 11:56:37 +11:00
trace-events target/ppc: Handle NMI guest exit 2020-02-03 11:33:10 +11:00
translate.c target/ppc: Fix ISA v3.0 (POWER9) slbia implementation 2020-03-24 11:56:14 +11:00
translate_init.inc.c x86 and machine queue for 5.0 soft freeze 2020-03-19 14:22:46 +00:00
user_only_helper.c target/ppc: Convert to CPUClass::tlb_fill 2019-05-10 11:12:50 -07:00