* [PATCH] accel/tcg/plugin: Fix op_rw
@ 2022-11-21 20:39 Richard Henderson
2022-12-18 17:32 ` Richard Henderson
2022-12-18 19:28 ` Alex Bennée
0 siblings, 2 replies; 3+ messages in thread
From: Richard Henderson @ 2022-11-21 20:39 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee
The value of op->args[2] is enum qemu_plugin_mem_rw, which
is already 1-based. Adding 1 produces incorrect results
for QEMU_PLUGIN_MEM_W and QEMU_PLUGIN_MEM_RW.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/plugin-gen.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index c7d6514840..cd9cee1f5d 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -495,10 +495,7 @@ static bool op_ok(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb)
static bool op_rw(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb)
{
- int w;
-
- w = op->args[2];
- return !!(cb->rw & (w + 1));
+ return cb->rw & op->args[2];
}
static void inject_cb_type(const GArray *cbs, TCGOp *begin_op,
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] accel/tcg/plugin: Fix op_rw
2022-11-21 20:39 [PATCH] accel/tcg/plugin: Fix op_rw Richard Henderson
@ 2022-12-18 17:32 ` Richard Henderson
2022-12-18 19:28 ` Alex Bennée
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2022-12-18 17:32 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee
Ping.
r~
On 11/21/22 12:39, Richard Henderson wrote:
> The value of op->args[2] is enum qemu_plugin_mem_rw, which
> is already 1-based. Adding 1 produces incorrect results
> for QEMU_PLUGIN_MEM_W and QEMU_PLUGIN_MEM_RW.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> accel/tcg/plugin-gen.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
> index c7d6514840..cd9cee1f5d 100644
> --- a/accel/tcg/plugin-gen.c
> +++ b/accel/tcg/plugin-gen.c
> @@ -495,10 +495,7 @@ static bool op_ok(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb)
>
> static bool op_rw(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb)
> {
> - int w;
> -
> - w = op->args[2];
> - return !!(cb->rw & (w + 1));
> + return cb->rw & op->args[2];
> }
>
> static void inject_cb_type(const GArray *cbs, TCGOp *begin_op,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] accel/tcg/plugin: Fix op_rw
2022-11-21 20:39 [PATCH] accel/tcg/plugin: Fix op_rw Richard Henderson
2022-12-18 17:32 ` Richard Henderson
@ 2022-12-18 19:28 ` Alex Bennée
1 sibling, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2022-12-18 19:28 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
Richard Henderson <richard.henderson@linaro.org> writes:
> The value of op->args[2] is enum qemu_plugin_mem_rw, which
> is already 1-based. Adding 1 produces incorrect results
> for QEMU_PLUGIN_MEM_W and QEMU_PLUGIN_MEM_RW.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-18 19:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 20:39 [PATCH] accel/tcg/plugin: Fix op_rw Richard Henderson
2022-12-18 17:32 ` Richard Henderson
2022-12-18 19:28 ` Alex Bennée
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).