aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorPierrick Bouvier <pierrick.bouvier@linaro.org>2024-03-05 12:09:53 +0000
committerAlex Bennée <alex.bennee@linaro.org>2024-03-06 12:35:29 +0000
commit0bcebaba45c2cc3e671e002f3c15266f0ff03b8c (patch)
treee3f869f28c383f1bbdf34cb5cf55bcfe9341ad30 /accel
parent62f92b8d978aba5de931323c3de788ccb2dbd87c (diff)
plugins: add inline operation per vcpu
Extends API with three new functions: qemu_plugin_register_vcpu_{tb, insn, mem}_exec_inline_per_vcpu(). Those functions takes a qemu_plugin_u64 as input. This allows to have a thread-safe and type-safe version of inline operations. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20240304130036.124418-5-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240305121005.3528075-18-alex.bennee@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/plugin-gen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index 0f8be53d39..47e05ec634 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -443,6 +443,13 @@ static TCGOp *append_inline_cb(const struct qemu_plugin_dyn_cb *cb,
char *ptr = cb->userp;
size_t elem_size = 0;
size_t offset = 0;
+ if (!ptr) {
+ /* use inline entry */
+ ptr = cb->inline_insn.entry.score->data->data;
+ elem_size = g_array_get_element_size(cb->inline_insn.entry.score->data);
+ offset = cb->inline_insn.entry.offset;
+ }
+
op = copy_ld_i32(&begin_op, op);
op = copy_mul_i32(&begin_op, op, elem_size);
op = copy_ext_i32_ptr(&begin_op, op);