From patchwork Sat Feb 25 08:59:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656458 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp1352634wrb; Sat, 25 Feb 2023 01:04:20 -0800 (PST) X-Google-Smtp-Source: AK7set+59nhKUiDMHIp73hHNKVMRjd41yIKgiHixCcWVz1OPOgDTMiLVpAkMiBk8Aws2mmWLNHfK X-Received: by 2002:ac8:58c3:0:b0:3b8:4edd:3932 with SMTP id u3-20020ac858c3000000b003b84edd3932mr31740460qta.22.1677315859871; Sat, 25 Feb 2023 01:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677315859; cv=none; d=google.com; s=arc-20160816; b=VoTSwARQ0jdLJPKWPY3cUZtaAPEkCdjXUXxY8PDiL6HLdfvMLUAZZYW83MHgx5jWlq EYlpesAlH5donCpoJSqA/816NonR9hZ5BvtFvk4NGwKnoUwxkCxKAFWRmxgnQtr5nQF/ NYco7OwEvIYHEVmFbeOGRzJmdN2csCkXAh3ZMPOTInKMWaZa1rjtn37sca73MHsyhr/H 84+m+qVvCwvZLweTkL1eL08jrG1q0isaoGlTFbitGXlFjtjRqQNH1gHlinZBfB3wmWym nwu0enSF3jGU5WUXyhQ8d/OF/oZ/YVN9h/A0h+Ty3dBEl95jnMzGBqKw0cGEZp0wNsJ/ V/rw== 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=To0bb/agV3EkVf6dAZIV3+fprQeWJK2QB87wig4dI2Uqo6nEtgGvdVP0w5IYDS4QCp lopOfbgDTuDs2oGh0QeTYWd8q/AQxBh5zeHcq/sQw7yCQz1ZTn/F7uEcrbQUBZpMpCei gh3PWdYjusin21ujTwTG7XbsgkBKCY8g0wJUMyp7oDk17vx1USgcR3igG83rVtiIoIiN u/TCPUvBJBu1pgCQr1JZ+UxbBfQXpNhMr9eTCEixhMiKOWd73EnqNJ19k7GlgAHWYotG shDtcdHotMf1xnh5+qBuINjvbSS7dMvEORsVt1fp5eWWMVNUklWOksGOMnenoUYn25Wo 5nJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TQ6BT2SA; 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 z18-20020a05622a061200b003b68b6de538si1726740qta.164.2023.02.25.01.04.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2023 01:04:19 -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=TQ6BT2SA; 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 1pVqQ4-00017H-UU; Sat, 25 Feb 2023 04:00:41 -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 1pVqPe-0000RY-Td for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:00:18 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVqPc-0004pY-J2 for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:00:14 -0500 Received: by mail-pl1-x631.google.com with SMTP id bh1so1829149plb.11 for ; Sat, 25 Feb 2023 01:00:12 -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=TQ6BT2SANhKD0lhngD+isYxae6gxRHg7lBA7l7RAsEqeSzXS0d8QGi5zGIiHryrqE0 BjvgDvT09cFT0D6zMRPLExCAC8hoRzRF8ke3sgtXiR9fUbPQUjRAQjqJDNIQbrs2JJck a/WZ3I7nW1S5J+LrxG6DO5zT9otlFsImGFxd4py7EjjdU0NZ+AffUf2gSaP8XzLQAXAD T3wRCHsagdvgqzPEhNPZ4zHrK3y33j4+lRvTSStpn5fJCBVD+wXWOQQMYm0Ea1WzPQHa aIszAsihhV+w0rnydn0OXNMyF4eQI5AR4zZPKoesVM9I4d7gBm5PwG3htNeUNTbNZbOI Dtww== 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=YDiU+oM/TJ7KE8LAzsgy/zN3mVY3f7aV5p6gVls/RPOcyAVBVj9r9eUd/pZZwgMOJS lmCx/1Xb9eMG3ExuaKSPsS5lkX/zv0tjzHLYrEDxSfd5j5ASGhBzhvUdG+0lru2s+B+S +hePVvVSKDXKrA8T4tvI0TeUgq3WJG+mIdLlqEDmz8iyt00xY2+EGIKX2gT5BMRUjn6V DNz0x0y19ohUsSlICY8CuFk2N8bZUDbZxNhIf3flNwxFCn2CbQ6T7GhSfJEb37VZp7Ta D1SilelCx2u21W05S/t+KQPOm3CmBVIxCDUxFm5hSbBz2X2KVoR56TAsAsEnBSp3HVWZ ey5w== X-Gm-Message-State: AO0yUKVlR8yJrLpCM0Z0HMZLEI5YqxnVr6kHh3dA/vSrgSHpYwAm0KFT hgkFyJJEY91MXpezzFfLLArzGPh1RtLKW6XexQk= X-Received: by 2002:a05:6a20:12d2:b0:cb:98e5:de33 with SMTP id v18-20020a056a2012d200b000cb98e5de33mr18777805pzg.3.1677315611699; Sat, 25 Feb 2023 01:00:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 01:00:11 -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 15/30] accel/tcg/plugin: Use tcg_temp_ebb_* Date: Fri, 24 Feb 2023 22:59:30 -1000 Message-Id: <20230225085945.1798188-16-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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);