From patchwork Wed Feb 22 23:27:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655729 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp38725wrb; Wed, 22 Feb 2023 15:34:28 -0800 (PST) X-Google-Smtp-Source: AK7set+DqVWpHHnTlMaNTrz9zGlE0y/5EX6C/22+kn8g6CYpfJ4xJgSqetngLbsYfj8kJ8qZWX/y X-Received: by 2002:ad4:596e:0:b0:56e:9f05:6278 with SMTP id eq14-20020ad4596e000000b0056e9f056278mr21280865qvb.33.1677108868032; Wed, 22 Feb 2023 15:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677108868; cv=none; d=google.com; s=arc-20160816; b=JArnBBcl5O5QW6LGdmIlplD2Aeod6nBA4Cqyn2zPHRvV+jGjGv2u6ysz9BvM2vaQek DnoacruFmwKQDbQNzah2xtbkrzRSewBYoXsiBKpIy8AWA3Iw7gm/qeCzwAcfUG0/gqIL VSrZI87CwJQlvsSeYxCnihxf3n7ZURX9QhREoIJ6Pae4a3p6hfbW87ndjsM3mWqvnW3Z M2prdY4IDaHgEKqePBgIFzhZ3PJxoRdjEx0aNfcwYZLVuGBierTewFwjcOSOLiccT0jx rIiv4g2+a3ht3wOUwuIBdxka75leKX4hMLoJbUfI6eQL4I8yjPJz36Xj5FPqTiQBVHPl Dlgw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c/FsI5n4WgHRv66eevhE+xAIN7J7lkFbjUwPoPOuuXQ=; b=BWZOGPGIueF+iA5HzJx1oiPwMVU1fHUxXWWGaiiVZ0wK6fsArAeovHK6/PwAn0sTEP frjZRLxmJK21aXl+iQ4qm7bL1i2VIJ/2doobR6uTOnY8P+HCB2yKPYFD1F2wfUbnWy4R q/kO6Z2uWMkqBnl9Ozz6AdL9U2Cl9B6P0rxS+ahzMea2dFqRAMCFOJ3tauwhnOMv9OeB b6ZYu1/ONdCfqPQizC5ViyPJ2OkJSSQLkduOrc2pxr5hxTrQEkoawET4zStXYQ0cyo8a QWGuVgqPmfFxfMvbcRaJT1RA9+V+LLudFA3+eYWdQW+BcoW0wV0b29PmousZ6aZR3TC0 nSSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fmB8qqCR; 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 w14-20020a0ce10e000000b0056c06fb18d5si4751293qvk.333.2023.02.22.15.34.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Feb 2023 15:34:28 -0800 (PST) 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=fmB8qqCR; 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 1pUyWR-0000Sa-OQ; Wed, 22 Feb 2023 18:27:39 -0500 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 1pUyWQ-0000S0-Te for qemu-devel@nongnu.org; Wed, 22 Feb 2023 18:27:38 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUyWO-0005JQ-Vp for qemu-devel@nongnu.org; Wed, 22 Feb 2023 18:27:38 -0500 Received: by mail-pl1-x632.google.com with SMTP id ky4so11973771plb.3 for ; Wed, 22 Feb 2023 15:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c/FsI5n4WgHRv66eevhE+xAIN7J7lkFbjUwPoPOuuXQ=; b=fmB8qqCRRkUF4ABe/CI+DfzWOhMgMpNf8R5lU32WMpOURZ9Qgj6qaxMOmhaELREI7C CSf+VotFbk6NpyP2WSSnwTNjVtEnP/hg7T/vmFhHy307voxZnJBhCVmsMCB6BDOF+UoL rp2RA59wt20Qd9xQirrV8u2uxbFutdd4Qbah9R/BE+lflnNfG4gFPp6LUHNTxo0n5MUF 9yal8UnVlv6+dol1y7tnysMB3q/xU9j3K8h9h3dMe7EZs1oSjD0zKIzFVuVy0lzrPwHg dR11mCVzh6UlWTnOHcpyNyTKid/W9vlcU0HsRAItg43nAakGU4hiSEmKVvorfX1Rw3XG VN4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c/FsI5n4WgHRv66eevhE+xAIN7J7lkFbjUwPoPOuuXQ=; b=IyU1xlFG+EYPg3On7Se82MYs2CzFhheYFruzXLj5UF98JxSTZ9EXp7D1FT6V6442Y9 0dOfRpOk7Cgx/fibIYuULPnETyXaUeIpssn8MCaUCyaUxiiDMeagErcPV4Ii8IHVP9kS 4nP+UEcZUJHxKMcyKqDdmMDhCzv5sPPABr+u9aKzW6mS3niX84IAW6qjpUQ7IeKt+NtY N06OfMZYj5UwJ6hywTa4kur5/rURny3FZ5gm+9jGxYt8Jn3biG2coGsLRrQtsyb5twdN pMqSDeMmT0evFryNG9Yn3Rb1CNz/TpXaXqTwroO3xQOYx5LJ425TsINehc9kx3zuOwsi FltA== X-Gm-Message-State: AO0yUKXodFc9WlCnK6ORHsOuzI2SdriB/ASSYnGFBpXwJlruk5YTJ3o2 c3e4VpTiKlXNyZEzE18YeB4k1AMgQq56t5L4ABY= X-Received: by 2002:a17:90b:3890:b0:233:f990:d646 with SMTP id mu16-20020a17090b389000b00233f990d646mr9726144pjb.35.1677108456189; Wed, 22 Feb 2023 15:27:36 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id s16-20020a17090ad49000b00234e6d2de3dsm5008918pju.11.2023.02.22.15.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 15:27:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 13/28] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers Date: Wed, 22 Feb 2023 13:27:00 -1000 Message-Id: <20230222232715.15034-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222232715.15034-1-richard.henderson@linaro.org> References: <20230222232715.15034-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 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 Here we are creating a temp whose value needs to be replaced, but always storing NULL into CPUState.plugin_mem_cbs. Use tcg_constant_ptr(0) explicitly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 9b793ac62c..c42a436c0c 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -630,8 +630,6 @@ static void inject_mem_disable_helper(struct qemu_plugin_insn *plugin_insn, /* called before finishing a TB with exit_tb, goto_tb or goto_ptr */ void plugin_gen_disable_mem_helpers(void) { - TCGv_ptr ptr; - /* * We could emit the clearing unconditionally and be done. However, this can * be wasteful if for instance plugins don't track memory accesses, or if @@ -644,10 +642,8 @@ void plugin_gen_disable_mem_helpers(void) if (!tcg_ctx->plugin_tb->mem_helper) { return; } - ptr = tcg_const_ptr(NULL); - tcg_gen_st_ptr(ptr, cpu_env, offsetof(CPUState, plugin_mem_cbs) - - offsetof(ArchCPU, env)); - tcg_temp_free_ptr(ptr); + tcg_gen_st_ptr(tcg_constant_ptr(NULL), cpu_env, + offsetof(CPUState, plugin_mem_cbs) - offsetof(ArchCPU, env)); } static void plugin_gen_tb_udata(const struct qemu_plugin_tb *ptb,