From patchwork Sat Feb 25 08:59:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656441 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp1351883wrb; Sat, 25 Feb 2023 01:02:06 -0800 (PST) X-Google-Smtp-Source: AK7set8zQcHtErg8lOBiWBaRSvs7xAffb+rRZNxJaWxkr2gEPvvzjBBtG2V0OrKNvZGhlc2KMN6P X-Received: by 2002:ac8:5a15:0:b0:3b9:c074:6e3c with SMTP id n21-20020ac85a15000000b003b9c0746e3cmr18577999qta.43.1677315726290; Sat, 25 Feb 2023 01:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677315726; cv=none; d=google.com; s=arc-20160816; b=UzuQIjBSFzabHogjjwMIBHMWRgMlep+XRaz0C6YC7U7S1rVji9VsrtZHm2hQ9pURFI m+bHxDRaSGj1vN/vb3x6o/d9jJcQ57K9Ef76k62i5StgfZveEDnYitjrhvRYi6ZQtcxU vXTcnnRTSXFNNW/nkaMnlC5dBOIko7ARNOumD2GgKL8BJ6FJH59V2LD+dIZAvpmAYpKn TqE7JxWMFAFbYoebfif2BKghTcjBkTcer3eTDsIsciGP8y926E7faTf4lsFTOd2gYVGj DfMEJGV8RYc+IXIaKcZBXe5HHLgIAUf1DmT0VxCQPlTP7GKFO0VXbTqdpEx3XEJVZ9nG DXCA== 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=hLXX1VL5DOr0Nq/AcHdtvm/rfENcQIYOpTIzId9OycYK3EFVSJJnzFbY9+yoAcYEns w3fZlLR67OE+cERlpakSsm4/UHVstv0Kc9rXMQX85yj2hOUZKe/UqJ6w7Mxc63GUCREP CApIVbjc0doIpVLs7JVQ3oeB5pbUM55gjL+BSSe+IsXMPeU0Ra8Ym/IDfvtFnAZO+IOq ZAa/zLlXm0KI82TvvlKs6Iz5S/K/W5iwLhI+TG2XPCKripXLg0ZYDWxe90gYBzPhZ9OG 4GobgMm7C1Z51+/MreaBjSV/zpAXpUUyMz6VuqLwjwE9FfpR2Bjse8DAhcTe6+l3J+tG O6FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wR/8+JJY"; 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 v16-20020ac85790000000b003ada37b0558si1678115qta.20.2023.02.25.01.02.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2023 01:02:06 -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="wR/8+JJY"; 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 1pVqQ5-00019p-Dq; Sat, 25 Feb 2023 04:00:43 -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 1pVqPg-0000Ra-32 for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:00:18 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVqPe-00054h-A7 for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:00:15 -0500 Received: by mail-pl1-x633.google.com with SMTP id ky4so1878185plb.3 for ; Sat, 25 Feb 2023 01:00:13 -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=wR/8+JJYNmAQNzxK1ZYJPc0AP7lD70l3eMAzMar86M19in5ynlGrmlKGYFEDAJSED6 QwYVJpRxIBva75MvkSGn4J8ko6jAoI6XNw8MZDTD3QaHFzDTJi7f7d3MOXAozZIQBdi9 IS1hU2HFEqF7l7sNbtUJeRl6EFEhT3PHlyCgYG4Wv8X6VV67ekDwc+X52WGVQ/FrBKXN j0Fc/KdQwf3Xf6r1e61ALQiRqBd0AHkm0UHSmJA4lpUVYVSgzYziYuAj4ZyXymA6s9d/ rRTMkCAXKE38buJ/2J7oXMIAyEbSTz9zvuKMkuLszZUT7sJZUS0YoQVMliooO+SyhBh7 qZlA== 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=uPFhB1wGK20G031efYMuMvfwMBHPpiYFb0crLD0OhUX61ynbktTA5mSF4B+nlKG0Dg m5dZGuh/JoWguABqIiDOyCHzXMRzu9B8ghNp7J3Y7EHJFDwdbc41MsE44TXIkf27e1np 73sksJ++3ONEDv1gH5jksKeSvJN8vEPB9caVuUFbi52B2MUsYTkE1E1nwugyi9kamRgL n1gq6xjrzIFtUwd0nbz5o+E07M31hDCg3xs0T1dBE9ce2nmTZQ+Y7GDmcZIoh9Tfn3Fx 6OCDlAo4MsbzAjUHgzNSnIv0zn0l9iCVFXHVjzJzTqb9TnAsh9w+OtM9qlmMvRVpyWrJ 7utA== X-Gm-Message-State: AO0yUKWr9MRwm2L+aS8rojhbPNIW+Kvl5kPlOkjA9vxb6b9JxZ5in3EY ejqfKgoBCDMZo2DzWcpqaBeW+yN8MxFs46y7zTQ= X-Received: by 2002:a17:90a:31c:b0:237:1b6a:dbce with SMTP id 28-20020a17090a031c00b002371b6adbcemr17954255pje.2.1677315613129; Sat, 25 Feb 2023 01:00:13 -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 s17-20020a639251000000b00502ecb91940sm715546pgn.55.2023.02.25.01.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 01:00:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 16/30] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers Date: Fri, 24 Feb 2023 22:59:31 -1000 Message-Id: <20230225085945.1798188-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230225085945.1798188-1-richard.henderson@linaro.org> References: <20230225085945.1798188-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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,