[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/29] plugins: cleanup codepath for previous inline operation
From: |
Alex Bennée |
Subject: |
[PULL 25/29] plugins: cleanup codepath for previous inline operation |
Date: |
Wed, 6 Mar 2024 14:40:37 +0000 |
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20240304130036.124418-13-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240305121005.3528075-26-alex.bennee@linaro.org>
diff --git a/plugins/plugin.h b/plugins/plugin.h
index f6fa10a0f56..7c34f23cfcb 100644
--- a/plugins/plugin.h
+++ b/plugins/plugin.h
@@ -68,11 +68,6 @@ struct qemu_plugin_ctx {
struct qemu_plugin_ctx *plugin_id_to_ctx_locked(qemu_plugin_id_t id);
-void plugin_register_inline_op(GArray **arr,
- enum qemu_plugin_mem_rw rw,
- enum qemu_plugin_op op, void *ptr,
- uint64_t imm);
-
void plugin_register_inline_op_on_entry(GArray **arr,
enum qemu_plugin_mem_rw rw,
enum qemu_plugin_op op,
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index 47e05ec6347..8028786c7bb 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -440,15 +440,10 @@ static TCGOp *append_inline_cb(const struct
qemu_plugin_dyn_cb *cb,
TCGOp *begin_op, TCGOp *op,
int *unused)
{
- 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;
- }
+ char *ptr = cb->inline_insn.entry.score->data->data;
+ size_t elem_size = g_array_get_element_size(
+ cb->inline_insn.entry.score->data);
+ size_t offset = cb->inline_insn.entry.offset;
op = copy_ld_i32(&begin_op, op);
op = copy_mul_i32(&begin_op, op, elem_size);
diff --git a/plugins/core.c b/plugins/core.c
index 7852590da88..11ca20e6267 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -316,22 +316,6 @@ static struct qemu_plugin_dyn_cb *plugin_get_dyn_cb(GArray
**arr)
return &g_array_index(cbs, struct qemu_plugin_dyn_cb, cbs->len - 1);
}
-void plugin_register_inline_op(GArray **arr,
- enum qemu_plugin_mem_rw rw,
- enum qemu_plugin_op op,
- void *ptr,
- uint64_t imm)
-{
- struct qemu_plugin_dyn_cb *dyn_cb;
-
- dyn_cb = plugin_get_dyn_cb(arr);
- dyn_cb->userp = ptr;
- dyn_cb->type = PLUGIN_CB_INLINE;
- dyn_cb->rw = rw;
- dyn_cb->inline_insn.op = op;
- dyn_cb->inline_insn.imm = imm;
-}
-
void plugin_register_inline_op_on_entry(GArray **arr,
enum qemu_plugin_mem_rw rw,
enum qemu_plugin_op op,
@@ -494,15 +478,10 @@ void qemu_plugin_flush_cb(void)
void exec_inline_op(struct qemu_plugin_dyn_cb *cb, int cpu_index)
{
- 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;
- }
+ char *ptr = cb->inline_insn.entry.score->data->data;
+ size_t elem_size = g_array_get_element_size(
+ cb->inline_insn.entry.score->data);
+ size_t offset = cb->inline_insn.entry.offset;
uint64_t *val = (uint64_t *)(ptr + offset + cpu_index * elem_size);
switch (cb->inline_insn.op) {
--
2.39.2
- [PULL 07/29] {linux,bsd}-user: Pass pid to gdbserver_fork(), (continued)
- [PULL 07/29] {linux,bsd}-user: Pass pid to gdbserver_fork(), Alex Bennée, 2024/03/06
- [PULL 16/29] plugins: implement inline operation relative to cpu_index, Alex Bennée, 2024/03/06
- [PULL 03/29] {linux,bsd}-user: Introduce get_task_state(), Alex Bennée, 2024/03/06
- [PULL 01/29] tests: bump QOS_PATH_MAX_ELEMENT_SIZE again, Alex Bennée, 2024/03/06
- [PULL 18/29] tests/plugin: add test plugin for inline operations, Alex Bennée, 2024/03/06
- [PULL 19/29] tests/plugin/mem: migrate to new per_vcpu API, Alex Bennée, 2024/03/06
- [PULL 14/29] plugins: scoreboard API, Alex Bennée, 2024/03/06
- [PULL 15/29] plugins: define qemu_plugin_u64, Alex Bennée, 2024/03/06
- [PULL 13/29] tests/tcg: Add two follow-fork-mode tests, Alex Bennée, 2024/03/06
- [PULL 17/29] plugins: add inline operation per vcpu, Alex Bennée, 2024/03/06
- [PULL 25/29] plugins: cleanup codepath for previous inline operation,
Alex Bennée <=
- [PULL 24/29] plugins: remove non per_vcpu inline operation from API, Alex Bennée, 2024/03/06
- [PULL 23/29] contrib/plugins/howvec: migrate to new per_vcpu API, Alex Bennée, 2024/03/06
- [PULL 29/29] target/riscv: honour show_opcodes when disassembling, Alex Bennée, 2024/03/06
- [PULL 21/29] tests/plugin/bb: migrate to new per_vcpu API, Alex Bennée, 2024/03/06
- [PULL 20/29] tests/plugin/insn: migrate to new per_vcpu API, Alex Bennée, 2024/03/06
- [PULL 28/29] target/loongarch: honour show_opcodes when disassembling, Alex Bennée, 2024/03/06
- [PULL 22/29] contrib/plugins/hotblocks: migrate to new per_vcpu API, Alex Bennée, 2024/03/06
- [PULL 26/29] disas: introduce show_opcodes, Alex Bennée, 2024/03/06