qemu-e2k/target/s390x
Ilya Leoshkevich 9701596d82 target/s390x: Fix R[NOX]SBG with T=1
RXSBG usage in the "filetests" test from the wasmtime testsuite makes
tcg_reg_alloc_op() attempt to temp_load() a TEMP_VAL_DEAD temporary,
causing an assertion failure:

    0x01000a70:  ec14 b040 3057  rxsbg    %r1, %r4, 0xb0, 0x40, 0x30

    OP after optimization and liveness analysis:
     ---- 0000000001000a70 0000000000000004 0000000000000006
     rotl_i64 tmp2,r4,$0x30                   dead: 1 2  pref=0xffff
     and_i64 tmp2,tmp2,$0x800000000000ffff    dead: 1  pref=0xffff
    [xor_i64 tmp3,tmp3,tmp2                   dead: 1 2  pref=0xffff]
     and_i64 cc_dst,tmp3,$0x800000000000ffff  sync: 0  dead: 0 1 2  pref=0xffff
     mov_i64 psw_addr,$0x1000a76              sync: 0  dead: 0 1  pref=0xffff
     mov_i32 cc_op,$0x6                       sync: 0  dead: 0 1  pref=0xffff
     call lookup_tb_ptr,$0x6,$1,tmp8,env      dead: 1  pref=none
     goto_ptr tmp8                            dead: 0
     set_label $L0
     exit_tb $0x7fffe809d183

    ../tcg/tcg.c:3865: tcg fatal error

The reason is that tmp3 does not have an initial value, which confuses
the register allocator. This also affects the correctness of the
results.

Fix by assigning R1 to it.

Exposed by commit e2e641fa3d ("tcg: Change default temp lifetime to
TEMP_TB").

Fixes: d6c6372e18 ("target-s390: Implement R[NOX]SBG")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230316172205.281369-2-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-03-20 09:32:50 +01:00
..
kvm dump queue 2022-10-26 10:53:49 -04:00
tcg target/s390x: Fix R[NOX]SBG with T=1 2023-03-20 09:32:50 +01:00
arch_dump.c target/s390x/arch_dump: Simplify memory allocation in s390x_write_elf64_notes() 2023-02-27 09:15:38 +01:00
cpu_features_def.h meson: rename .inc.h files to .h.inc 2020-08-21 06:18:35 -04:00
cpu_features_def.h.inc s390x/cpumodel: add stfl197 processor-activity-instrumentation extension 1 2022-08-25 21:59:04 +02:00
cpu_features.c hw/s390x/pv: Restrict Protected Virtualization to sysemu 2023-01-09 13:50:13 +01:00
cpu_features.h s390x: pv: Fix diag318 PV fencing 2020-10-22 15:47:27 +02:00
cpu_models_sysemu.c qapi machine: Elide redundant has_FOO in generated C 2022-12-14 20:04:47 +01:00
cpu_models_user.c target/s390x: split sysemu part of cpu models 2021-07-07 14:01:59 +02:00
cpu_models.c hw/s390x/pv: Restrict Protected Virtualization to sysemu 2023-01-09 13:50:13 +01:00
cpu_models.h s390x: Fix spelling errors 2022-11-16 10:15:26 +01:00
cpu-dump.c target/s390x: Fix shifting 32-bit values for more than 31 bits 2022-01-17 08:36:33 +01:00
cpu-param.h target/s390x: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
cpu-qom.h target: Introduce and use OBJECT_DECLARE_CPU_TYPE() macro 2022-03-06 22:23:09 +01:00
cpu-sysemu.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
cpu.c target/s390x: Implement Early Exception Recognition 2023-03-20 09:32:50 +01:00
cpu.h target/s390x: Implement Early Exception Recognition 2023-03-20 09:32:50 +01:00
diag.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
gdbstub.c gdbstub: move register helpers into standalone include 2023-03-07 20:44:08 +00:00
gen-features.c target/s390x: support PRNO_TRNG instruction 2022-09-26 17:23:11 +02:00
helper.c gdbstub: move register helpers into standalone include 2023-03-07 20:44:08 +00:00
helper.h target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG 2023-02-04 06:19:43 -10:00
interrupt.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
ioinst.c s390x: Fix spelling errors 2022-11-16 10:15:26 +01:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
machine.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
meson.build target/s390x: split sysemu part of cpu models 2021-07-07 14:01:59 +02:00
mmu_helper.c hw/s390x/s390-skeys: lazy storage key enablement under TCG 2021-09-06 16:24:05 +02:00
s390x-internal.h target/s390x: Convert to tcg_ops restore_state_to_opc 2022-10-26 11:11:28 +10:00
sigp.c s390x: sigp: Reorder the SIGP STOP code 2022-01-18 15:00:57 +01:00
trace-events target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
trace.h