[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 22/38] target/arm: call qemu_plugin_insn_append
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [RFC v2 22/38] target/arm: call qemu_plugin_insn_append |
Date: |
Sun, 9 Dec 2018 14:37:33 -0500 |
I considered using translator_ld* from arm_ldl_code
et al. However, note that there's a helper that also calls
arm_ldl_code, so we'd have to change that caller.
In thumb's case I'm also calling plugin_insn_append directly,
since we can't assume that all instructions are 16 bits long.
Signed-off-by: Emilio G. Cota <address@hidden>
---
target/arm/translate-a64.c | 2 ++
target/arm/translate.c | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 88195ab949..db95161c16 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -38,6 +38,7 @@
#include "trace-tcg.h"
#include "translate-a64.h"
#include "qemu/atomic128.h"
+#include "qemu/plugin.h"
static TCGv_i64 cpu_X[32];
static TCGv_i64 cpu_pc;
@@ -13321,6 +13322,7 @@ static void disas_a64_insn(CPUARMState *env,
DisasContext *s)
uint32_t insn;
insn = arm_ldl_code(env, s->pc, s->sctlr_b);
+ plugin_insn_append(&insn, sizeof(insn));
s->insn = insn;
s->pc += 4;
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 7c4675ffd8..d5171f54f6 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -13234,6 +13234,7 @@ static void arm_tr_translate_insn(DisasContextBase
*dcbase, CPUState *cpu)
}
insn = arm_ldl_code(env, dc->pc, dc->sctlr_b);
+ plugin_insn_append(&insn, sizeof(insn));
dc->insn = insn;
dc->pc += 4;
disas_arm_insn(dc, insn);
@@ -13304,11 +13305,16 @@ static void thumb_tr_translate_insn(DisasContextBase
*dcbase, CPUState *cpu)
insn = arm_lduw_code(env, dc->pc, dc->sctlr_b);
is_16bit = thumb_insn_is_16bit(dc, insn);
dc->pc += 2;
- if (!is_16bit) {
+ if (is_16bit) {
+ uint16_t insn16 = insn;
+
+ plugin_insn_append(&insn16, sizeof(insn16));
+ } else {
uint32_t insn2 = arm_lduw_code(env, dc->pc, dc->sctlr_b);
insn = insn << 16 | insn2;
dc->pc += 2;
+ plugin_insn_append(&insn, sizeof(insn));
}
dc->insn = insn;
--
2.17.1
- [Qemu-devel] [RFC v2 18/38] *-user: plugin syscalls, (continued)
- [Qemu-devel] [RFC v2 18/38] *-user: plugin syscalls, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 15/38] tcg: let plugins instrument memory accesses, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 24/38] target/sh4: fetch code with translator_ld (WIP), Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 21/38] translator: add translator_ld{ub, sw, uw, l, q}, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 10/38] plugin-gen: add module for TCG-related code, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 25/38] target/i386: fetch code with translator_ld, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 38/38] tests/plugin: add sample plugins, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 37/38] linux-user: support -plugin option, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 27/38] target/m68k: fetch code with translator_ld, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 29/38] target/riscv: fetch code with translator_ld, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 22/38] target/arm: call qemu_plugin_insn_append,
Emilio G. Cota <=
- [Qemu-devel] [RFC v2 08/38] tcg: drop nargs from tcg_op_insert_{before, after}, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 19/38] cpu: hook plugin vcpu events, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 20/38] plugin-gen: add plugin_insn_append, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 35/38] configure: add --enable-plugins, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 28/38] target/alpha: fetch code with translator_ld, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 26/38] target/hppa: fetch code with translator_ld, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 36/38] vl: support -plugin option, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 34/38] plugin: add API symbols to qemu-plugins.symbols, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 30/38] target/sparc: fetch code with translator_ld, Emilio G. Cota, 2018/12/09