summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorAlex Bennée2022-10-27 20:36:31 +0200
committerAlex Bennée2022-10-31 21:37:59 +0100
commit9fa97e04ae5677cc383b674f8efbf17950b07622 (patch)
treebb9a518a27b785f60ab005c9a8a75ba3fdf76977 /target
parenttarget/s390x: don't probe next pc for EXecuted insns (diff)
downloadqemu-9fa97e04ae5677cc383b674f8efbf17950b07622.tar.gz
qemu-9fa97e04ae5677cc383b674f8efbf17950b07622.tar.xz
qemu-9fa97e04ae5677cc383b674f8efbf17950b07622.zip
target/s390x: fake instruction loading when handling 'ex'
The s390x EXecute instruction is a bit weird as we synthesis the executed instruction from what we have stored in memory. This missed the plugin instrumentation. Work around this with a special helper to inform the rest of the translator about the instruction so things stay consistent. Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20221027183637.2772968-26-alex.bennee@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/s390x/tcg/translate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index f4122db434..03efccdf9f 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -6317,12 +6317,18 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s)
if (unlikely(s->ex_value)) {
/* Drop the EX data now, so that it's clear on exception paths. */
TCGv_i64 zero = tcg_const_i64(0);
+ int i;
tcg_gen_st_i64(zero, cpu_env, offsetof(CPUS390XState, ex_value));
tcg_temp_free_i64(zero);
/* Extract the values saved by EXECUTE. */
insn = s->ex_value & 0xffffffffffff0000ull;
ilen = s->ex_value & 0xf;
+ /* register insn bytes with translator so plugins work */
+ for (i = 0; i < ilen; i++) {
+ uint8_t byte = extract64(insn, 56 - (i * 8), 8);
+ translator_fake_ldb(byte, pc + i);
+ }
op = insn >> 56;
} else {
insn = ld_code2(env, s, pc);