From patchwork Mon Feb 27 05:36:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656838 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2183866wrb; Sun, 26 Feb 2023 21:47:55 -0800 (PST) X-Google-Smtp-Source: AK7set9TMkDA1L60gMZ1KJC9uVvOp7xLW0EyWtPM/3jQ2cIdtmQ1+6DQaOTv4L4WdGGWhA3XG8Zi X-Received: by 2002:a05:622a:2608:b0:3bf:db0a:c105 with SMTP id ci8-20020a05622a260800b003bfdb0ac105mr1890420qtb.6.1677476875547; Sun, 26 Feb 2023 21:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476875; cv=none; d=google.com; s=arc-20160816; b=fKMAdognU6BGBood2AnwfQ9c0Gaa9kG5zKucDeL2wZmW40SFvikD8/F+Ap70AX9pxJ 2mgvY/+VRNprvTh6YVozTNdxLhCH5EchoQFntu6cMLApBvOyFTdgcQHhZKRjcSmFw5/Q YFbxqeqy0zqXreEuy8/ZZ6nJPbTBo7zWocMTg+y0lfXhBfhpx/E6pQt1tnLc5wWIXrOE PGVW1W4XWOUNk+VUZbIseBP4FvtGGnrQGMVK2LOafkNUGdiONARSB9n9j8ZVWsdA5LYo VV37vma9o66NbdEVCTvuNYfveMGs6bcKamKQxn4tQtdnKHvTEori6eFypY7sWlmyn0bM Os6A== 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=DKuK62hxv2vXEM1ktPotl0poAfziKcuIlZAl/cEb0MU=; b=AqOHlJYHZdo1HhlA7WWMb4/uKi7l9OqbMOlWDRY2c0Wk5Zcuhkj3Tepn3larvTUdF5 WmO9IRlKj8Saf20ST0dARqnQqjLHYINX7O14mkuixbS2uB1pBCHI5blX1U82M/nS2cfd SSlEC+nlwolIPk168qExphL61AZ8Suj8mVDD0yiB5UHzuES+7hxO5NMFNoUuaxyLez5B B0x9BzQ4sWoPIFOsH135nk5Y0cHnRb2sCsQC0Kn8FSPP03OOORNuUh9kA+Jg3aJ8dL2s 5JqecfQEYORCj4Qx9UmuERjksd2h8r5bAJRNgBFemWKX0br2m+E2jPMfShNC5bFNaw41 2XxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GSgmioxO; 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 i7-20020ac85c07000000b003bfba5b73fesi6075412qti.369.2023.02.26.21.47.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:47:55 -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=GSgmioxO; 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 1pWWE2-0006zA-FJ; Mon, 27 Feb 2023 00:39:02 -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 1pWWCz-0003Me-Pd for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:38:08 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWCr-0002YQ-Ff for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:37:54 -0500 Received: by mail-pl1-x62d.google.com with SMTP id p6so4706770plf.0 for ; Sun, 26 Feb 2023 21:37:48 -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=DKuK62hxv2vXEM1ktPotl0poAfziKcuIlZAl/cEb0MU=; b=GSgmioxOe4H+3ZwiZ21dHhz08vWfL/N7uE/pwLRbBTJ6R0g4//GhKzaiHfjrJ+gCWA /0L48ew6TLVC7qvFN5m27Hs8xDFqNzUivaCNJQ+Z3E+VrUP8XUsdXKpnAA1BpoEmxrcH MezQ5VQu8XY8b0TcLMvjhEUdyB/yDFzp2FEEeY4K5Am5C4rQfnl6ponyS0aSfKKpVHhu HfYP8HfMasegJXP9ruLtQu+1QPlV1W0//NFQc30G5bHVHk5S9G6m4y2UVXencHlGx7RW LS23sHLy+h10B3nAv29b2Zr7pK1Dw4JgveHkYyPPH3qnHtRjvxraynqPdLu2a/e4a+xk 9hrQ== 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=DKuK62hxv2vXEM1ktPotl0poAfziKcuIlZAl/cEb0MU=; b=UlUoU+tQDBYUOi2vOK4x4LpfUNFecwlrnTO5o+SUF7kEnBHZH8nEd/5J8DbIPkwSRF lnxhUUUEbSGAluZCK63T/9JgafOFWlgiGKCQb1dPiLeaDCJEoM88Ti7uKS5kkxOuxIhA 5wrlUWMsoqpPwLdvFtKkifoFaV/kyUA2BeJvhIVjzpc2VfWznNAuEhz+TtPSXYqAcTs9 hSPOPSI2a2uyAKLEK1v2FFCxpd7x99D9cRHGMeY3Ba5mNrdfkZ1CZyiX8et1sKgHHPsb 2Y+ZBjUyBg6uNmr6+jVQQBF757b5neoRthW59//VflL27JtH/AcbbvT4Gao8dpzeYRaq R7mw== X-Gm-Message-State: AO0yUKVSx2i/CNhmW+o0663iyldHm5GHwFT5NwJrr2xjhwV3gXIyaxMt YITWqU8Lk8ryUMeRMZUZW53gwy6v+5V7wlWKi78= X-Received: by 2002:a05:6a20:9383:b0:cb:e8c6:26a0 with SMTP id x3-20020a056a20938300b000cbe8c626a0mr18498050pzh.11.1677476267765; Sun, 26 Feb 2023 21:37:47 -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 k12-20020aa792cc000000b005a7c892b435sm3342137pfa.25.2023.02.26.21.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:37:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, jcmvbkbc@gmail.com, kbastian@mail.uni-paderborn.de, ysato@users.sourceforge.jp, gaosong@loongson.cn, jiaxun.yang@flygoat.com, tsimpson@quicinc.com, ale@rev.ng, mrolnik@gmail.com, edgar.iglesias@gmail.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v4 15/31] accel/tcg/plugin: Use tcg_temp_ebb_* Date: Sun, 26 Feb 2023 19:36:45 -1000 Message-Id: <20230227053701.368744-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227053701.368744-1-richard.henderson@linaro.org> References: <20230227053701.368744-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 All of these uses have quite local scope. Avoid tcg_const_*, because we haven't added a corresponding interface for TEMP_EBB. Use explicit tcg_gen_movi_* instead. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 17a686bd9e..9b793ac62c 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -93,11 +93,13 @@ void HELPER(plugin_vcpu_mem_cb)(unsigned int vcpu_index, static void do_gen_mem_cb(TCGv vaddr, uint32_t info) { - TCGv_i32 cpu_index = tcg_temp_new_i32(); - TCGv_i32 meminfo = tcg_const_i32(info); - TCGv_i64 vaddr64 = tcg_temp_new_i64(); - TCGv_ptr udata = tcg_const_ptr(NULL); + TCGv_i32 cpu_index = tcg_temp_ebb_new_i32(); + TCGv_i32 meminfo = tcg_temp_ebb_new_i32(); + TCGv_i64 vaddr64 = tcg_temp_ebb_new_i64(); + TCGv_ptr udata = tcg_temp_ebb_new_ptr(); + tcg_gen_movi_i32(meminfo, info); + tcg_gen_movi_ptr(udata, 0); tcg_gen_ld_i32(cpu_index, cpu_env, -offsetof(ArchCPU, env) + offsetof(CPUState, cpu_index)); tcg_gen_extu_tl_i64(vaddr64, vaddr); @@ -112,9 +114,10 @@ static void do_gen_mem_cb(TCGv vaddr, uint32_t info) static void gen_empty_udata_cb(void) { - TCGv_i32 cpu_index = tcg_temp_new_i32(); - TCGv_ptr udata = tcg_const_ptr(NULL); /* will be overwritten later */ + TCGv_i32 cpu_index = tcg_temp_ebb_new_i32(); + TCGv_ptr udata = tcg_temp_ebb_new_ptr(); + tcg_gen_movi_ptr(udata, 0); tcg_gen_ld_i32(cpu_index, cpu_env, -offsetof(ArchCPU, env) + offsetof(CPUState, cpu_index)); gen_helper_plugin_vcpu_udata_cb(cpu_index, udata); @@ -129,9 +132,10 @@ static void gen_empty_udata_cb(void) */ static void gen_empty_inline_cb(void) { - TCGv_i64 val = tcg_temp_new_i64(); - TCGv_ptr ptr = tcg_const_ptr(NULL); /* overwritten later */ + TCGv_i64 val = tcg_temp_ebb_new_i64(); + TCGv_ptr ptr = tcg_temp_ebb_new_ptr(); + tcg_gen_movi_ptr(ptr, 0); tcg_gen_ld_i64(val, ptr, 0); /* pass an immediate != 0 so that it doesn't get optimized away */ tcg_gen_addi_i64(val, val, 0xdeadface); @@ -151,9 +155,9 @@ static void gen_empty_mem_cb(TCGv addr, uint32_t info) */ static void gen_empty_mem_helper(void) { - TCGv_ptr ptr; + TCGv_ptr ptr = tcg_temp_ebb_new_ptr(); - ptr = tcg_const_ptr(NULL); + tcg_gen_movi_ptr(ptr, 0); tcg_gen_st_ptr(ptr, cpu_env, offsetof(CPUState, plugin_mem_cbs) - offsetof(ArchCPU, env)); tcg_temp_free_ptr(ptr);