From patchwork Mon Oct 28 14:59:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177931 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3503850ill; Mon, 28 Oct 2019 08:00:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPOGyUDQdLrBrL5WDs34f5f4BIUoXw+2VHGef+J1lJU943kpv9EwEfII7nEydKB+mWGljd X-Received: by 2002:a05:620a:3cb:: with SMTP id r11mr15923753qkm.217.1572274846407; Mon, 28 Oct 2019 08:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572274846; cv=none; d=google.com; s=arc-20160816; b=0AxR129oGuf5By3YCcLQDQnzOTwp3400wx18RvRhZ7eJtwLe/RTyfgwkvdyvBc6kTe NvfmRjcNL5OupQmAY/nNAzIQkjJaq1uCrCNfUeoTycBhvJc4c9YYWZ10XjVH53ZroUJz zEr89I2YCXUqVdBJDUjKa2CuC0przwFktIgKrDikK3lG0Y5ygVR4JN72EdASVup8HfPZ fOTOoNujIskKPsk4p5lJv++grYtoCOGXiTg0Wx1wJWQQnaVTysxyL41h4yu8mPO8QcC4 esWpxPLmKzD1Pt/xuWwMgwhS2WgZm0eORIfWUzN+E7NwW9YZW+/67yvd3pDSlrxkuyeX 7Bew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Q9PA/XGaFb/7jgxWdyktquMDL4GhIzWDsxOacBvv2es=; b=kQuR2epSTGDqMg3V6xm5JJs1Dqstq03zQp02/SBq17xsF2XRJriOMXCNaC1VRzwQIp 8MHFUZTofKbBCkAYpnyCAradNiWGsDCdXGzNjbTflZS5k1iA8H9i2S0q/6jPNZf+vPv0 GXv21iRfiXp1kV2WuiEBxPXpRm31l6VcGDOJvlapzXP8IF10xvmyIKncR3Xj/ZXCXOwq xV5gQ7d5HCDUMfIMgTAhRyGDU2zlERqCMq6Iv7sfRdIAYgsMXgav7P6oeZeT3JIA5heM ZRYO5Eb0pQrQGfrSJCy0jmjlu7rYO4qPrSUpDqHLjqD0hdFE+jAobNBBkyyHHTxgxSZK HFvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJsBxjAe; 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 27si9030020qtz.200.2019.10.28.08.00.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Oct 2019 08:00:46 -0700 (PDT) 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=QJsBxjAe; 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]:54752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP6Vg-0007hg-Ju for patch@linaro.org; Mon, 28 Oct 2019 11:00:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44657) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP6Us-0007Zd-AM for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP6Ur-00046d-A4 for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:54 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:40287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iP6Ur-00045z-42 for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:53 -0400 Received: by mail-wm1-x344.google.com with SMTP id w9so9478285wmm.5 for ; Mon, 28 Oct 2019 07:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q9PA/XGaFb/7jgxWdyktquMDL4GhIzWDsxOacBvv2es=; b=QJsBxjAeUya1E38QxU+EpNhYxqKnYUTcQa6vLp0TIjsiEtoH7rif02B86Qv/Vr+Rd1 dBoY9UDqjHxE1OZXxQ+lvD08m6mBDbgFxD5NYiv92XnTQ3le1fcVmwP8LDh1WmX7LKtq i01yirOZZJD4o2kWz5rZV2KCFSeFxkdWa0DjvAJMVOBSuLotX/zPn3Tt79iYuWLLcVdC GOANLSbHgkaw4LZnfen06yrjzdWe3GnPvxiGYcRoqLXb0YsZYdyBU8z5F0GMEsygkvn9 6XmEcY9LAaKlifH7WkbPkx7BUVK17ZBXvSZkNCh+LxXJCi2Kt1Ultxnpd0XxIcoKBFyc UpwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q9PA/XGaFb/7jgxWdyktquMDL4GhIzWDsxOacBvv2es=; b=YCzbBwdDJmM5a0vLaYZ0/6fWaVDHagfHFasDkj6VxDbjO3TilbTC8rDuYuNco7BQM1 +LddUihnCDA0V9lSDJtPWlA2XlUzvW84BZZv8xqO5C4fgLBwxMzVGInHrJb267CRDirC F4Vm8fjUaXX1a42xd/fxVznYocppE9D62GRMRD3/eNMzFFJa0zbSEeIU0wOAZ8EaDurT dUzoJ13uH6+st0mhfJ9DV0V7mmIPAsaRkExFAgi2p4H4iorvE6xKcOpWl+O6y0C8shwA pKlJr961OVz0yoXX5YVPiiRxfzDCtJimTJG8ILIiyc/aDlY/M9dPlIpfnPhFtTD+yGGi 3eHg== X-Gm-Message-State: APjAAAVPETGrtyZqiBl2WYLlXiqOqoGL9B79TzLsqaByl5UwNtGd8vlG lySDPGBJ5klvOlHMU0PnnDLFwIzW371DSg== X-Received: by 2002:a1c:44:: with SMTP id 65mr369743wma.93.1572274791780; Mon, 28 Oct 2019 07:59:51 -0700 (PDT) Received: from localhost.localdomain (230.106.138.88.rev.sfr.net. [88.138.106.230]) by smtp.gmail.com with ESMTPSA id 143sm14842876wmb.33.2019.10.28.07.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 07:59:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 12/12] translate-all: Remove tb_alloc Date: Mon, 28 Oct 2019 15:59:37 +0100 Message-Id: <20191028145937.10914-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028145937.10914-1-richard.henderson@linaro.org> References: <20191028145937.10914-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 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: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Clement Deschamps Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) -- 2.17.1 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 } -/* - * 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 = tcg_tb_alloc(tcg_ctx); - if (unlikely(tb == 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 = &tcg_ctx->prof; int64_t ti; #endif + assert_memory_lock(); phys_pc = get_page_addr_code(env, pc); @@ -1706,7 +1690,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, } buffer_overflow: - tb = tb_alloc(pc); + tb = tcg_tb_alloc(tcg_ctx); if (unlikely(!tb)) { /* flush must be done */ tb_flush(cpu);