qemu/target/ppc
Nicholas Piggin 0c9717ff35 target/ppc: Implement new wait variants
ISA v2.06 adds new variations of wait, specified by the WC field. These
are not all compatible with the prior wait implementation, because they
add additional conditions that cause the processor to resume, which can
cause software to hang or run very slowly.

At this moment, with the current wait implementation and a pseries guest
using mainline kernel with new wait upcodes [1], QEMU hangs during boot if
more than one CPU is present:

 qemu-system-ppc64 -M pseries,x-vof=on -cpu POWER10 -smp 2 -nographic
-kernel zImage.pseries -no-reboot

QEMU will exit (as there's no filesystem) if the test "passes", or hang
during boot if it hits the bug.

ISA v3.0 changed the wait opcode and removed the new variants (retaining
the WC field but making non-zero values reserved).

ISA v3.1 added new WC values to the new wait opcode, and added a PL
field.

This patch implements the new wait encoding and supports WC variants
with no-op implementations, which provides basic correctness as
explained in comments.

[1] https://lore.kernel.org/all/20220720132132.903462-1-npiggin@gmail.com/

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Víctor Colombo <victor.colombo@eldorado.org.br>
Tested-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220720133352.904263-1-npiggin@gmail.com>
[danielhb: added information about the bug being fixed]
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-07-28 13:30:41 -03:00
..
translate target/ppc: Implement slbiag 2022-07-18 13:59:43 -03:00
arch_dump.c
compat.c
cpu-models.c target/ppc: Fix MPC8555 and MPC8560 core type to e500v1 2022-07-06 10:30:01 -03:00
cpu-models.h target/ppc: Fix MPC8555 and MPC8560 core type to e500v1 2022-07-06 10:30:01 -03:00
cpu-param.h
cpu-qom.h
cpu.c
cpu.h target/ppc: remove mfdcrux and mtdcrux 2022-07-18 13:59:43 -03:00
cpu_init.c target/ppc: check tb_env != 0 before printing TBU/TBL/DECR 2022-07-18 13:59:43 -03:00
dfp_helper.c target/ppc: implement cdtbcd 2022-07-06 10:22:38 -03:00
excp_helper.c
fpu_helper.c target/ppc: fix unreachable code in fpu_helper.c 2022-06-20 08:38:58 -03:00
gdbstub.c
helper.h target/ppc: Implement slbiag 2022-07-18 13:59:43 -03:00
helper_regs.c
helper_regs.h
insn32.decode target/ppc: Implement slbiag 2022-07-18 13:59:43 -03:00
insn64.decode target/ppc: Implemented [pm]xvbf16ger2* 2022-05-26 17:11:33 -03:00
int_helper.c target/ppc: use int128.h methods in vsubcuq 2022-07-06 10:22:38 -03:00
internal.h target/ppc: Implement new wait variants 2022-07-28 13:30:41 -03:00
Kconfig
kvm-stub.c
kvm.c target/ppc/kvm: Skip current and parent directories in kvmppc_find_cpu_dt 2022-07-18 13:59:43 -03:00
kvm_ppc.h
machine.c target/ppc: Implement lwsync with weaker memory ordering 2022-05-26 17:11:33 -03:00
mem_helper.c
meson.build
misc_helper.c
mmu-book3s-v3.c ppc: Check partition and process table alignment 2022-07-18 13:59:43 -03:00
mmu-book3s-v3.h target/ppc: Implement ISA 3.00 tlbie[l] 2022-07-18 13:59:43 -03:00
mmu-books.h
mmu-hash32.c
mmu-hash32.h
mmu-hash64.c target/ppc: Implement slbiag 2022-07-18 13:59:43 -03:00
mmu-hash64.h
mmu-radix64.c target/ppc: Check page dir/table base alignment 2022-07-18 13:59:43 -03:00
mmu-radix64.h
mmu_common.c
mmu_helper.c target/ppc: Implement ISA 3.00 tlbie[l] 2022-07-18 13:59:43 -03:00
monitor.c target/ppc: check tb_env != 0 before printing TBU/TBL/DECR 2022-07-18 13:59:43 -03:00
power8-pmu-regs.c.inc target/ppc: fix PMU Group A register read/write exceptions 2022-07-18 13:59:43 -03:00
power8-pmu.c
power8-pmu.h
spr_common.h
tcg-stub.c
timebase_helper.c target/ppc: fix exception error code in helper_{load, store}_dcr 2022-07-18 13:59:43 -03:00
trace-events
trace.h
translate.c target/ppc: Implement new wait variants 2022-07-28 13:30:41 -03:00
user_only_helper.c