[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/16] plugins: fix mem callback array size
From: |
Alex Bennée |
Subject: |
[PULL 05/16] plugins: fix mem callback array size |
Date: |
Mon, 22 Jul 2024 12:04:02 +0100 |
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
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>
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index b6bae32b99..ec89a085b4 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -85,8 +85,7 @@ static void gen_enable_mem_helper(struct qemu_plugin_tb *ptb,
len = insn->mem_cbs->len;
arr = g_array_sized_new(false, false,
sizeof(struct qemu_plugin_dyn_cb), len);
- memcpy(arr->data, insn->mem_cbs->data,
- len * sizeof(struct qemu_plugin_dyn_cb));
+ g_array_append_vals(arr, insn->mem_cbs->data, len);
qemu_plugin_add_dyn_cb_arr(arr);
tcg_gen_st_ptr(tcg_constant_ptr((intptr_t)arr), tcg_env,
--
2.39.2
- [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting), Alex Bennée, 2024/07/22
- [PULL 01/16] testing: bump to latest libvirt-ci, Alex Bennée, 2024/07/22
- [PULL 02/16] tests/avocado: Remove non-working sparc leon3 test, Alex Bennée, 2024/07/22
- [PULL 04/16] plugins/stoptrigger: TCG plugin to stop execution under conditions, Alex Bennée, 2024/07/22
- [PULL 03/16] gdbstub: Re-factor gdb command extensions, Alex Bennée, 2024/07/22
- [PULL 07/16] plugins/execlog.c: correct dump of registers values, Alex Bennée, 2024/07/22
- [PULL 05/16] plugins: fix mem callback array size,
Alex Bennée <=
- [PULL 09/16] target/m68k: Add semihosting stub, Alex Bennée, 2024/07/22
- [PULL 08/16] semihosting: Include missing 'gdbstub/syscalls.h' header, Alex Bennée, 2024/07/22
- [PULL 12/16] target/mips: Restrict semihosting to TCG, Alex Bennée, 2024/07/22
- [PULL 16/16] tests/tcg/aarch64: Fix test-mte.py, Alex Bennée, 2024/07/22
- [PULL 06/16] tests/plugins: use qemu_plugin_outs for inline stats, Alex Bennée, 2024/07/22
- [PULL 10/16] target/mips: Add semihosting stub, Alex Bennée, 2024/07/22
- [PULL 15/16] semihosting: Restrict to TCG, Alex Bennée, 2024/07/22
- [PULL 11/16] target/m68k: Restrict semihosting to TCG, Alex Bennée, 2024/07/22
- [PULL 14/16] target/xtensa: Restrict semihosting to TCG, Alex Bennée, 2024/07/22
- [PULL 13/16] target/riscv: Restrict semihosting to TCG, Alex Bennée, 2024/07/22