From nobody Thu May 2 09:07:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1571849546; cv=none; d=zoho.com; s=zohoarc; b=Aqshbu65FptxcYTaGcA50OKOyg0xFrCUy6CY6vdFHUEYgysGnsvK3DcQ3bXvOtGbaM/A84dr0cL6GKrmfr2Pv88Wl26xUOp/yXiPGZ0zTN0zok8+vfzPqQQyWWjD9MI51rlYXbteNfDzTznat7/RDIIBHUbrX+HFMfmQ+E4bhdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571849546; h=Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=xuHzog+jgtYpIJtmII9MEywPYX9XQKQHUxgkXOaOldY=; b=akyfAEq1HexsZ/82epjhY42F8ti3TnhTwit0VdV3Li0I6aZhukdZPim7TxYYfgyM/1EVczwmxag1Cu9hkZyddzXUELh+wpC0Tw6rsGQDaTnxPG7t8mhozO9+8GZRJ8wva4pEkMif/M9OPUtWmMVGHV47xOR5L5JkDbN8rVKtCpY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571849546399764.7884014356366; Wed, 23 Oct 2019 09:52:26 -0700 (PDT) Received: from localhost ([::1]:41690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNJrz-0005kO-7N for importer@patchew.org; Wed, 23 Oct 2019 12:52:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52339) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNJmc-0008PS-S1 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 12:46:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNJma-0000Kd-RR for qemu-devel@nongnu.org; Wed, 23 Oct 2019 12:46:50 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:46339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNJma-0000KQ-Na for qemu-devel@nongnu.org; Wed, 23 Oct 2019 12:46:48 -0400 Received: by mail-qt1-x844.google.com with SMTP id u22so33191060qtq.13 for ; Wed, 23 Oct 2019 09:46:48 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id t13sm8380540qtn.18.2019.10.23.09.46.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 09:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=xuHzog+jgtYpIJtmII9MEywPYX9XQKQHUxgkXOaOldY=; b=XmTfV4+RpDdWrj/Y+bFAmZi3uM90+NUbPPhJRztWnNHrvACKhfP+MmjGROfy2Cuj1e Jwhb1T200MI4rKvRXckEqVt7P52Ys0Ix7abj7Cl3fuWIJ4kPaTgdpP04NRm9dRLKcPTi xlkqs+qN9DpLrv8oVnw0Et2LnEb+CLsrbENCoGBuZJu7fqR1y8Iblr+4J/PC1AnD1L23 +bw0t1vis1ObX96l2R3qXIp+5FF2jxY+N0et1Sj68qSnJo4KdJYYNh/sDk0bs1xIAMlK sgkXJDgigXt7bL60tQi8tAjDwXOfR/RvAqU8U6otpd7KEDUxeTDzqXMYsMbWDQGgk1KL 5cZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=xuHzog+jgtYpIJtmII9MEywPYX9XQKQHUxgkXOaOldY=; b=nkWd/cVnsLckUQpDThx8KWB2mUWJBqz1du1qKUtj0t5Gwwkr7ZZmmJvb/+TEi4FIuI oP2Z+2hcj32h1pdZ+shm22cwqGmUWnss6/SVH5PmxIImk+F3WTYlIuvg8PBSXHhAbzTI VrlRNVgraq09DGpjRjg+AJyuDniBzQ53IVmOC1xW+O7T9u5N33IeYZi0Niwv3l9xb5KV djcNdpfuOUEIdJznzCeZN6POqf/72unxM6wJ7tezn/duIYnAV+JI15SMhHAeGw6dTARs vcqp6ekZDeZjZVBX4q49TeBGxkgsLqbUQ4I2S4NxJD8it4Epm+nQA4egU8EndTM18Peo o9gQ== X-Gm-Message-State: APjAAAUlF4IHEughe/dOARpYoSEJUvhWuxuu9F4hdnRny8NOi0P+QFbg 3Wm95XG1Yqu0Se16Wg6LcLYNeNHeUZc= X-Google-Smtp-Source: APXvYqyZQFzrHyvwZq3lQ88tTW7qiPI/SOraMViRgT5G0MLDzZI6MZ1xNTf6jOVhgAxN+nhX3PrmOA== X-Received: by 2002:ac8:4149:: with SMTP id e9mr9731924qtm.321.1571849207332; Wed, 23 Oct 2019 09:46:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH] translate-all: Remove tb_alloc Date: Wed, 23 Oct 2019 12:46:45 -0400 Message-Id: <20191023164645.5518-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since 2ac01d6dafab, this function does only two things: assert a lock is held, and call tcg_tb_alloc. It is used exactly once, and its user has already done the assert. Signed-off-by: Richard Henderson Reviewed-by: Clement Deschamps Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- I noticed that this function was essentially a stub while reviewing Clement's tb->orig_tb fix. Note that the added newline in tb_gen_code both adds the missing break after the variable declaration block and also happens to highlight the assert mentioned above. ;-) r~ --- accel/tcg/translate-all.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index f9b7ba159d..ae063b53f9 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1156,23 +1156,6 @@ void tcg_exec_init(unsigned long tb_size) #endif } =20 -/* - * Allocate a new translation block. Flush the translation buffer if - * too many translation blocks or too much generated code. - */ -static TranslationBlock *tb_alloc(target_ulong pc) -{ - TranslationBlock *tb; - - assert_memory_lock(); - - tb =3D tcg_tb_alloc(tcg_ctx); - if (unlikely(tb =3D=3D NULL)) { - return NULL; - } - return tb; -} - /* call with @p->lock held */ static inline void invalidate_page_bitmap(PageDesc *p) { @@ -1681,6 +1664,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, TCGProfile *prof =3D &tcg_ctx->prof; int64_t ti; #endif + assert_memory_lock(); =20 phys_pc =3D get_page_addr_code(env, pc); @@ -1706,7 +1690,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, } =20 buffer_overflow: - tb =3D tb_alloc(pc); + tb =3D tcg_tb_alloc(tcg_ctx); if (unlikely(!tb)) { /* flush must be done */ tb_flush(cpu); --=20 2.17.1