diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2021-10-26 11:22:26 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2021-11-04 10:32:01 +0000 |
commit | 357af9be5ca47ae8ac2bc439de4bb9a39e186fd4 (patch) | |
tree | 763bcbb19526f9542e9a28568713594ceb1e95ba /accel/tcg/translator.c | |
parent | e83f79b3faee1316a243b05bb768840d21cec6f4 (diff) | |
download | qemu-357af9be5ca47ae8ac2bc439de4bb9a39e186fd4.zip qemu-357af9be5ca47ae8ac2bc439de4bb9a39e186fd4.tar.gz qemu-357af9be5ca47ae8ac2bc439de4bb9a39e186fd4.tar.bz2 |
plugins: try and make plugin_insn_append more ergonomic
Currently we make the assumption that the guest frontend loads all
op code bytes sequentially. This mostly holds up for regular fixed
encodings but some architectures like s390x like to re-read the
instruction which causes weirdness to occur. Rather than changing the
frontends make the plugin API a little more ergonomic and able to
handle the re-read case.
Stuff will still get strange if we read ahead of the opcode but so far
no front ends have done that and this patch asserts the case so we can
catch it early if they do.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211026102234.3961636-21-alex.bennee@linaro.org>
Diffstat (limited to 'accel/tcg/translator.c')
-rw-r--r-- | accel/tcg/translator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 390bd9d..f06c314 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -169,7 +169,7 @@ static inline void translator_maybe_page_protect(DisasContextBase *dcbase, if (do_swap) { \ ret = swap_fn(ret); \ } \ - plugin_insn_append(&ret, sizeof(ret)); \ + plugin_insn_append(pc, &ret, sizeof(ret)); \ return ret; \ } |