[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] plugins: fix optimization in plugin_gen_disable_mem_help
From: |
Aaron Lindsay |
Subject: |
Re: [PATCH 1/4] plugins: fix optimization in plugin_gen_disable_mem_helpers |
Date: |
Tue, 10 Jan 2023 10:29:40 -0500 |
On Jan 08 11:47, Emilio Cota wrote:
> We were mistakenly checking tcg_ctx->plugin_insn as a canary to know
> whether the TB had emitted helpers that might have accessed memory.
>
> The problem is that tcg_ctx->plugin_insn gets updated on every
> instruction in the TB, which results in us wrongly performing the
> optimization (i.e. not clearing cpu->plugin_mem_cbs) way too often,
> since it's not rare that the last instruction in the TB doesn't
> use helpers.
>
> Fix it by tracking a per-TB canary.
>
> While at it, expand documentation.
>
> Related: #1381
>
> Signed-off-by: Emilio Cota <cota@braap.org>
> ---
> accel/tcg/plugin-gen.c | 26 ++++++++++++++++++--------
> include/qemu/plugin.h | 7 +++++++
> 2 files changed, 25 insertions(+), 8 deletions(-)
Tested-by: Aaron Lindsay <aaron@os.amperecomputing.com>
- [PATCH 0/4] plugin patches to fix #1381, Emilio Cota, 2023/01/08
- [PATCH 1/4] plugins: fix optimization in plugin_gen_disable_mem_helpers, Emilio Cota, 2023/01/08
- Re: [PATCH 1/4] plugins: fix optimization in plugin_gen_disable_mem_helpers,
Aaron Lindsay <=
- [PATCH 2/4] translator: always pair plugin_gen_insn_{start, end} calls, Emilio Cota, 2023/01/08
- [PATCH 3/4] tcg: exclude lookup_tb_ptr from helper instrumentation, Emilio Cota, 2023/01/08
- [PATCH 4/4] cpu-exec: assert that plugin_mem_cbs is NULL after execution, Emilio Cota, 2023/01/08