From patchwork Wed Jun 5 22:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 801661 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp8701wro; Wed, 5 Jun 2024 15:26:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVUq1wIdtrakLaPcVt4AP9l3+kLJlTEzjx/qTrZlLfOjPyeji+L8z7aOtAmzUfkoN0DhIW38qesZyGTbOM7PqVw X-Google-Smtp-Source: AGHT+IHlsTZ/+eLq6oplgmaf8QDj2fQBFbV4jBnLAdEteJ32zNazE6ERP3bWrMI0edT0mw7858Ry X-Received: by 2002:a05:6214:488f:b0:6a9:69ce:bd7b with SMTP id 6a1803df08f44-6b02266c864mr45402056d6.4.1717626364309; Wed, 05 Jun 2024 15:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717626364; cv=none; d=google.com; s=arc-20160816; b=lkBX/ErrDwaQo5JYUDC8SNmSfUIMz4R3X7oP6A2KX4uYrQ1aDV5eA9FBc9Pi4pUfEg zjB8701GxEFbV4TWJBLYdipy5oYnp/Xm5tVL4Zv3j5WzguJCw5jzNGTnpQK1KNgENYjg LBPqW9Uy759MEDnu0w6Bp5LhsDwZIWBkMEfViOJlvmAKWAw5hhstME1k0nJtcKtOIR6R iSi2UNAMXcO0zzxdRayRlw+QKzspIA6FbC5uj9BZRg4OrCgrfooky4i6odyTFSXj82ms XR4DYN6TFYeIWxMRoQv3hqSxXh/CeYbFGhAPc5lnqQdqJR9djULRTqvUKRyzrj9HIEBJ wvNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=Y4BXgNd5mbAZzdgvAl/4xSksxb0/U+w+FNHu31ZnnMs=; fh=DfUxOGz7MnM49MBgqH5VPROGi+97fYtPWhcEZCG1Y5Q=; b=KD8ddyY+IjZ6IqDsgw5M6DOgvZMPyDK7frPFK5CTixdtLYLGOhMv2IVeSwVN/ulsPD 6qqR7PGqAnvVXVw7+v9575D7PC2hkj6vU/pUQYwv935mafIV0Z8TcK7bYbFSzXTqe795 h8Ka891v/QkpzGupe/nqVKvVIzJjbkTDM9KNwzxJ5EjWPA6pN97Q3w+v5Gba+hATrQdX vh1KTDEif8wK8exkQgCFM18kuuDEaicAPxuNiZ/InBiMOR0E6W67LWc3sanqzPYkbdwh 50/ZNAsthEXMJ176TCflwd3UEuAb2wimzMf5LW7wLUTjdYQxv2qLhU9Gtl5ui4SAO00C nRRw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="doy5j/Xh"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f6842fbsi743186d6.166.2024.06.05.15.26.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2024 15:26:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="doy5j/Xh"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEz4d-0005cd-Cl; Wed, 05 Jun 2024 18:25:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEz4b-0005be-8W for qemu-devel@nongnu.org; Wed, 05 Jun 2024 18:25:37 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEz4Y-0000a0-Re for qemu-devel@nongnu.org; Wed, 05 Jun 2024 18:25:37 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6f8ec7e054dso227418b3a.2 for ; Wed, 05 Jun 2024 15:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717626333; x=1718231133; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Y4BXgNd5mbAZzdgvAl/4xSksxb0/U+w+FNHu31ZnnMs=; b=doy5j/XhYUX6+9kyK34C20wLUjW3MH+L9OXcmCykHKp9QY0Alo1dFSpHzx4SOleF8+ i5jio2KLIRlq+PGI3ILZAcGzCbPRLeNi7HmCdLwqMJMDB9+YKZAVuy1LAe/YrWAVXc7p B5uK9xQhNSt1nZfS8yBJusRpEfxEYLf4FiPi3+RPf7xvXvwCjT5lh0KAyMt9Z0NcY5bh RtOPypFJqq+k0bY1mUfphE9CnKvM+Onsfrky2m4sXUZ8SzWUJNeAuW29GO0O0hRXbpl6 CmjYBGrQi0fXM+jJZKPt0ZTzj3rMCKAiu40Vgs/z/vUNG6Fm6be9yxynyMD9xQ7bkiTM bLMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717626333; x=1718231133; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y4BXgNd5mbAZzdgvAl/4xSksxb0/U+w+FNHu31ZnnMs=; b=KEdRrAOCmJjB5oejr1Rzvj9sxDRBO8UbsuV/LwmB3nXw10bdCuEB7CWLSUxq0H4MYm h+vXdNZGZtI+Xi+vK7zgpysdA4ENYwM6eRjXv7ckB3HStCFPRAGriNRrFiL2MGaqBrqp ha6qC6FBvjrFP0wdLh3xJftHT59LK5S5G5Mp5Jo3O3CxHRpuPUCF5hcwhPc7iDDb6rX2 lYnKG0V4jpDSejwNbFz3Y8Fo/n6O48YqYp/2olX22Lqn0tegR/OVB5tTwGLMoMwAPf4T G86XtHq/6a5E56HE8x9wlxQyJuf9yvZnBnDImiIWjf+bDMMHtv84QcXPgRdr4Y9B1Ux3 yIhA== X-Gm-Message-State: AOJu0YwljbsLhreRgCuPKds7JohcgAttDGUdkNZPCEODBC/CD5hTOvmH 8GRK2ONGNS34L3OPKprmMEHX4BfrOGA4Am3yCi22CV9n5frJ9ID4o9iL77F0/tmxWhHf6/QP5kF e X-Received: by 2002:a05:6a00:1903:b0:6ea:f351:1df9 with SMTP id d2e1a72fcca58-703e5a1bbf2mr4613217b3a.23.1717626333182; Wed, 05 Jun 2024 15:25:33 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd3721edsm11775b3a.13.2024.06.05.15.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 15:25:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org, alex.bennee@linaro.org Subject: [PATCH] accel/tcg/plugin: Fix inject_mem_cb rw masking Date: Wed, 5 Jun 2024 15:25:31 -0700 Message-Id: <20240605222531.28399-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These are not booleans, but masks. Fixes: f86fd4d8721 ("plugins: distinct types for callbacks") Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/plugin-gen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index cc1634e7a6..b6bae32b99 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -240,13 +240,13 @@ static void inject_mem_cb(struct qemu_plugin_dyn_cb *cb, { switch (cb->type) { case PLUGIN_CB_MEM_REGULAR: - if (rw && cb->regular.rw) { + if (rw & cb->regular.rw) { gen_mem_cb(&cb->regular, meminfo, addr); } break; case PLUGIN_CB_INLINE_ADD_U64: case PLUGIN_CB_INLINE_STORE_U64: - if (rw && cb->inline_insn.rw) { + if (rw & cb->inline_insn.rw) { inject_cb(cb); } break;