qemu-devel
[Top][All Lists]
Advanced

[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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]