[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 24/50] plugin-gen: add plugin_insn_append
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v3 24/50] plugin-gen: add plugin_insn_append |
Date: |
Mon, 17 Jun 2019 14:03:24 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/14/19 10:11 AM, Alex Bennée wrote:
> From: "Emilio G. Cota" <address@hidden>
>
> By adding it to plugin-gen's header file, we can export is as
> an inline, since tcg.h is included in the header (we need tcg_ctx).
>
> Signed-off-by: Emilio G. Cota <address@hidden>
>
> ---
> v3
> - use g_byte_array
> ---
> accel/tcg/plugin-gen.c | 10 +++++++++-
> include/exec/plugin-gen.h | 23 ++++++++++++++---------
> 2 files changed, 23 insertions(+), 10 deletions(-)
>
> diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
> index 9d9ec29765..758fc5d099 100644
> --- a/accel/tcg/plugin-gen.c
> +++ b/accel/tcg/plugin-gen.c
> @@ -60,9 +60,17 @@
> /*
> * plugin_cb_start TCG op args[]:
> * 0: enum plugin_gen_from
> - * 1: enum plugin_gen_cb (defined below)
> + * 1: enum plugin_gen_cb
> * 2: set to 1 if it's a mem callback and it's a write, 0 otherwise.
> */
> +enum plugin_gen_from {
> + PLUGIN_GEN_FROM_TB,
> + PLUGIN_GEN_FROM_INSN,
> + PLUGIN_GEN_FROM_MEM,
> + PLUGIN_GEN_AFTER_INSN,
> + PLUGIN_GEN_N_FROMS,
> +};
> +
> enum plugin_gen_cb {
> PLUGIN_GEN_CB_UDATA,
> PLUGIN_GEN_CB_INLINE,
> diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h
> index 449ea16034..316638c736 100644
> --- a/include/exec/plugin-gen.h
> +++ b/include/exec/plugin-gen.h
> @@ -15,15 +15,6 @@
> #include "qemu/plugin.h"
> #include "tcg/tcg.h"
>
> -/* used by plugin_callback_start and plugin_callback_end TCG ops */
> -enum plugin_gen_from {
> - PLUGIN_GEN_FROM_TB,
> - PLUGIN_GEN_FROM_INSN,
> - PLUGIN_GEN_FROM_MEM,
> - PLUGIN_GEN_AFTER_INSN,
> - PLUGIN_GEN_N_FROMS,
> -};
Why is this movement in here, and can it be folded back?
It doesn't seem to be used from ...
> -
> struct DisasContextBase;
>
> #ifdef CONFIG_PLUGIN
> @@ -36,6 +27,17 @@ void plugin_gen_insn_end(void);
> void plugin_gen_disable_mem_helpers(void);
> void plugin_gen_empty_mem_callback(TCGv addr, uint8_t info);
>
> +static inline void plugin_insn_append(const void *from, size_t size)
> +{
> + struct qemu_plugin_insn *insn = tcg_ctx->plugin_insn;
> +
> + if (insn == NULL) {
> + return;
> + }
> +
> + insn->data = g_byte_array_append(insn->data, from, size);
> +}
> +
> #else /* !CONFIG_PLUGIN */
>
> static inline
> @@ -60,6 +62,9 @@ static inline void plugin_gen_disable_mem_helpers(void)
> static inline void plugin_gen_empty_mem_callback(TCGv addr, uint8_t info)
> { }
>
> +static inline void plugin_insn_append(const void *from, size_t size)
> +{ }
> +
... here.
r~
- [Qemu-devel] [PATCH v3 33/50] target/riscv: fetch code with translator_ld, (continued)
- [Qemu-devel] [PATCH v3 33/50] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 42/50] tests/tcg: enable plugin testing, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 17/50] atomic_template: add inline trace/plugin helpers, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 40/50] linux-user: support -plugin option, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 32/50] target/alpha: fetch code with translator_ld, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 24/50] plugin-gen: add plugin_insn_append, Alex Bennée, 2019/06/14
- Re: [Qemu-devel] [PATCH v3 24/50] plugin-gen: add plugin_insn_append,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 29/50] target/i386: fetch code with translator_ld, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 26/50] target/arm: call qemu_plugin_insn_append, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 16/50] atomic_template: fix indentation in GEN_ATOMIC_HELPER, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 39/50] vl: support -plugin option, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 38/50] plugin: add API symbols to qemu-plugins.symbols, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 47/50] accel/stubs: reduce headers from tcg-stub, Alex Bennée, 2019/06/14