diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2021-09-17 17:23:32 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2021-10-12 08:38:10 +0100 |
commit | 453d50ce75b16d1b00a0783279779471e079f489 (patch) | |
tree | 3da9a5ba85370b0505b971da6db68d4d07d5e0d8 /include | |
parent | 5d23d530235eaf352b1067854ad22681b1ab5584 (diff) |
accel/tcg: re-factor plugin_inject_cb so we can assert insn_idx is valid
Coverity doesn't know enough about how we have arranged our plugin TCG
ops to know we will always have incremented insn_idx before injecting
the callback. Let us assert it for the benefit of Coverity and protect
ourselves from accidentally breaking the assumption and triggering
harder to grok errors deeper in the code if we attempt a negative
indexed array lookup.
However to get to this point we re-factor the code and remove the
second hand instruction boundary detection in favour of scanning the
full set of ops and using the existing INDEX_op_insn_start to cleanly
detect when the instruction has started. As we no longer need the
plugin specific list of ops we delete that.
My initial benchmarks shows no discernible impact of dropping the
plugin specific ops list.
Fixes: Coverity 1459509
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210917162332.3511179-12-alex.bennee@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/tcg/tcg.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index ba13ab1151..9f398b9afe 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -493,9 +493,6 @@ typedef struct TCGOp { /* Next and previous opcodes. */ QTAILQ_ENTRY(TCGOp) link; -#ifdef CONFIG_PLUGIN - QSIMPLEQ_ENTRY(TCGOp) plugin_link; -#endif /* Arguments for the opcode. */ TCGArg args[MAX_OPC_PARAM]; @@ -605,9 +602,6 @@ struct TCGContext { /* descriptor of the instruction being translated */ struct qemu_plugin_insn *plugin_insn; - - /* list to quickly access the injected ops */ - QSIMPLEQ_HEAD(, TCGOp) plugin_ops; #endif GHashTable *const_table[TCG_TYPE_COUNT]; |