qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org
Subject: [PATCH] accel/tcg/plugin: Fix op_rw
Date: Mon, 21 Nov 2022 12:39:06 -0800	[thread overview]
Message-ID: <20221121203906.64404-1-richard.henderson@linaro.org> (raw)

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



             reply	other threads:[~2022-11-21 20:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 20:39 Richard Henderson [this message]
2022-12-18 17:32 ` [PATCH] accel/tcg/plugin: Fix op_rw Richard Henderson
2022-12-18 19:28 ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221121203906.64404-1-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).