qemu-e2k/target/s390x
David Hildenbrand 1f6493be08 s390x/tcg: MVCL: Exit to main loop if requested
MVCL is interruptible and we should check for interrupts and process
them after writing back the variables to the registers. Let's check
for any exit requests and exit to the main loop. Introduce a new helper
function for that: cpu_loop_exit_requested().

When booting Fedora 30, I can see a handful of these exits and it seems
to work reliable. Also, Richard explained why this works correctly even
when MVCL is called via EXECUTE:

    (1) TB with EXECUTE runs, at address Ae
        - env->psw_addr stored with Ae.
        - helper_ex() runs, memory address Am computed
          from D2a(X2a,B2a) or from psw.addr+RI2.
        - env->ex_value stored with memory value modified by R1a

    (2) TB of executee runs,
        - env->ex_value stored with 0.
        - helper_mvcl() runs, using and updating R1b, R1b+1, R2b, R2b+1.

    (3a) helper_mvcl() completes,
         - TB of executee continues, psw.addr += ilen.
         - Next instruction is the one following EXECUTE.

    (3b) helper_mvcl() exits to main loop,
         - cpu_loop_exit_restore() unwinds psw.addr = Ae.
         - Next instruction is the EXECUTE itself...
         - goto 1.

As the PoP mentiones that an interruptible instruction called via EXECUTE
should avoid modifying storage/registers that are used by EXECUTE itself,
it is fine to retrigger EXECUTE.

Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
2019-10-10 12:27:15 +02:00
..
arch_dump.c
cc_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
cpu_features_def.h
cpu_features_def.inc.h
cpu_features.c
cpu_features.h
cpu_models.c s390x/cpumodel: Add the z15 name to the description of gen15a 2019-09-23 09:15:28 +02:00
cpu_models.h hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cpu-param.h
cpu-qom.h hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cpu.c targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
cpu.h target/s390x: Remove ILEN_UNWIND 2019-10-09 12:49:02 +02:00
crypto_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
diag.c target/s390x: Remove ilen parameter from s390_program_interrupt 2019-10-09 12:49:01 +02:00
excp_helper.c target/s390x: Remove ilen argument from trigger_pgm_exception 2019-10-09 12:49:02 +02:00
fpu_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
gdbstub.c
gen-features.c s390x/cpumodel: Add new TCG features to QEMU cpu model 2019-10-09 12:49:01 +02:00
helper.c target/s390x: Return exception from mmu_translate 2019-10-09 12:49:01 +02:00
helper.h s390x/tcg: MVST: Fix storing back the addresses to registers 2019-09-23 09:28:29 +02:00
insn-data.def s390x/tcg: MVST: Fix storing back the addresses to registers 2019-09-23 09:28:29 +02:00
insn-format.def
int_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
internal.h target/s390x: Remove ilen argument from trigger_pgm_exception 2019-10-09 12:49:02 +02:00
interrupt.c target/s390x: Remove ilen argument from trigger_pgm_exception 2019-10-09 12:49:02 +02:00
ioinst.c target/s390x: Remove ilen parameter from s390_program_interrupt 2019-10-09 12:49:01 +02:00
kvm_s390x.h
kvm-stub.c
kvm.c s390/kvm: split kvm mem slots at 4TB 2019-09-30 13:51:50 +02:00
machine.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
Makefile.objs
mem_helper.c s390x/tcg: MVCL: Exit to main loop if requested 2019-10-10 12:27:15 +02:00
misc_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
mmu_helper.c target/s390x: Remove ilen argument from trigger_pgm_exception 2019-10-09 12:49:02 +02:00
s390-tod.h
sigp.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
tcg_s390x.h target/s390x: Remove ilen parameter from tcg_s390_program_interrupt 2019-10-09 12:49:01 +02:00
tcg-stub.c target/s390x: Remove ilen parameter from tcg_s390_program_interrupt 2019-10-09 12:49:01 +02:00
trace-events
translate_vx.inc.c tcg: TCGMemOp is now accelerator independent MemOp 2019-09-03 08:30:38 -07:00
translate.c target/s390x: Add ilen to unwind data 2019-10-09 12:49:01 +02:00
vec_fpu_helper.c
vec_helper.c
vec_int_helper.c
vec_string_helper.c
vec.h