plugins: fix mem callback array size
data was correctly copied, but size of array was not set (g_array_sized_new only reserves memory, but does not set size). As a result, callbacks were not called for code path relying on plugin_register_vcpu_mem_cb(). Found when trying to trigger mem access callbacks for atomic instructions. Reviewed-by: Xingtao Yao <yaoxt.fnst@fujitsu.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240706191335.878142-2-pierrick.bouvier@linaro.org> Message-Id: <20240718094523.1198645-6-alex.bennee@linaro.org>
This commit is contained in:
parent
58fc249d9e
commit
94ae227e15
@ -85,8 +85,7 @@ static void gen_enable_mem_helper(struct qemu_plugin_tb *ptb,
|
|||||||
len = insn->mem_cbs->len;
|
len = insn->mem_cbs->len;
|
||||||
arr = g_array_sized_new(false, false,
|
arr = g_array_sized_new(false, false,
|
||||||
sizeof(struct qemu_plugin_dyn_cb), len);
|
sizeof(struct qemu_plugin_dyn_cb), len);
|
||||||
memcpy(arr->data, insn->mem_cbs->data,
|
g_array_append_vals(arr, insn->mem_cbs->data, len);
|
||||||
len * sizeof(struct qemu_plugin_dyn_cb));
|
|
||||||
qemu_plugin_add_dyn_cb_arr(arr);
|
qemu_plugin_add_dyn_cb_arr(arr);
|
||||||
|
|
||||||
tcg_gen_st_ptr(tcg_constant_ptr((intptr_t)arr), tcg_env,
|
tcg_gen_st_ptr(tcg_constant_ptr((intptr_t)arr), tcg_env,
|
||||||
|
Loading…
Reference in New Issue
Block a user