From patchwork Mon Oct 16 17:25:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115960 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3954672qgn; Mon, 16 Oct 2017 10:50:49 -0700 (PDT) X-Received: by 10.55.150.195 with SMTP id y186mr15099638qkd.228.1508176249266; Mon, 16 Oct 2017 10:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508176249; cv=none; d=google.com; s=arc-20160816; b=Qj7btWw2LGfeYi3hdohRCgUpNgUPMbeDk4l+OzSVahCpZNknhCqpA5V+g+bkKwlzwu pI3DZUWRX4LNUqtbp4juPVADj60snpdYyUPPUbr3cepC8LqeSQ4YAJPnnkdeTWFms80B 2AZGWgZQ3kHDLfuIgNB+GSRp0h8J+cTYfmQ/HVYUnTkM70l2usjahSdHYLz62wyAxmJh qpL+JwqwZfrO3aW1bMmbjGgy5PmHZ0TJu392AqKkyKAHN+IKGK57hL1+nDEQ81gA29xk 8/doWFWoPyiF6vZLboc0m6yuAiWNb7dTg+cB15N0HlL9QAx6YQFrpHQNqf4Xik+t2HLI w1HA== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=rKW+KdkvOF9EOXRo7dmyn5uHsd88uC8X4HeG4p5K65U=; b=vpnuIRO374oMmbywnh21MBzkghJCQ3OjXJwveGil0yGawM0s/3a1C64IoTSLMInqpq It9dzPUDAc7m3pT9sgtrvNUInCS2PlIN8c72eMx9eCtct8Q9k/RETzwex96xHRPVD2MV /qorPPSVwwqixrbMrSVTnA77DNkbkHPp1nuTZnBq5f6F5PKkTp+ihodmlJnuSckIzPrj 9cw/OdwHotAiVHX+bslqtaGts1lJ63QzsinILB8IOmK6Ie7ISLr/uqeQXXWr4skV41Ao 0gH1niA1ycDF2wKIDAIi7GT4i/1OURyAIP/xrK0OOJxrjaEyj7/wLyKzmfzxkoCPQGWX 6HWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bQVxkSQ5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n6si7132365qtc.308.2017.10.16.10.50.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 10:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bQVxkSQ5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49XL-0005II-1f for patch@linaro.org; Mon, 16 Oct 2017 13:50:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49AY-0002mN-Bg for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:27:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e49AT-0003uI-CY for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:27:12 -0400 Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:51122) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e49AT-0003tg-88 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:27:09 -0400 Received: by mail-pg0-x22f.google.com with SMTP id y7so7343538pgb.7 for ; Mon, 16 Oct 2017 10:27:09 -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=rKW+KdkvOF9EOXRo7dmyn5uHsd88uC8X4HeG4p5K65U=; b=bQVxkSQ5W+lkHlM6fURtZ9FSAwBbVMjwxofuXMmGOe810itLIC9/ZR7ayMpbJSgYp5 KKhFVapWqSGNKTp85iimCUJoZn0F0FcMZCl/Us/bBQSywabXeqeKWhH5XswW+4/6FtOp wvLx2eOKrRnG/kewNttbCZ0T1EZ0V0E811Q10= 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=rKW+KdkvOF9EOXRo7dmyn5uHsd88uC8X4HeG4p5K65U=; b=JJw93jyo+a8563MXs+2ZpOvnxRkhau+zHPp9uC5inaMvUWb1UZ2vTGJs37RTme4s13 VXXWbNDRYRGJ7r9QIlcv/fjQjUeXFgxuUppkymDJ+N4mcdV2/bVUoBRAIVPtTCKB+TQL qKEVQAmfJGq2gmPuCj7IisM2uDhZlnpydAKZPFwSsU1qSLBPIbPk3Guemd5tdQYccicd gr5tAbEe7+Qtr2J6WIlnIfiI66eiz7yZ3e57Rn5RfDFizhcuQWFdykecCkGMxp0s21ww AlywFWqZmrsZFB64dA/HCsvEhSzBDTpyn59KAAX3BW/7Ygb5zkjuwZ+23a1GktnEREsE n/gw== X-Gm-Message-State: AMCzsaXIPbknFwxBvi6su22NG7Urgfhmw6DSu6aSRqCyYFzAbZIKN/ur Djlz/12tsyno5N/B3BPrtDdWcrHpzYk= X-Google-Smtp-Source: AOwi7QBQT8sMxMIUTxJoDBqmdL36DvXBx3DxTmX8P4O7BQNDBzclBPeU4N8xTB0Yk20V8nb9Y5pkxw== X-Received: by 10.84.171.195 with SMTP id l61mr9417701plb.64.1508174828101; Mon, 16 Oct 2017 10:27:08 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id i187sm5594249pfc.96.2017.10.16.10.27.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 10:27:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 10:25:58 -0700 Message-Id: <20171016172609.23422-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171016172609.23422-1-richard.henderson@linaro.org> References: <20171016172609.23422-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: 2607:f8b0:400e:c05::22f Subject: [Qemu-devel] [PATCH v6 39/50] exec-all: rename tb_free to tb_remove X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" We don't really free anything in this function anymore; we just remove the TB from the binary search tree. Suggested-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 2 +- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.13.6 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 4c4242a1d8..746f4be71e 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -389,7 +389,7 @@ static inline uint32_t curr_cflags(void) | (use_icount ? CF_USE_ICOUNT : 0); } -void tb_free(TranslationBlock *tb); +void tb_remove(TranslationBlock *tb); void tb_flush(CPUState *cpu); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 59fd784436..6a4a33235b 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -220,7 +220,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles, tb_lock(); tb_phys_invalidate(tb, -1); - tb_free(tb); + tb_remove(tb); tb_unlock(); } #endif diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 083e1c7336..76db9c775a 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -375,7 +375,7 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr) if (tb->cflags & CF_NOCACHE) { /* one-shot translation, invalidate it immediately */ tb_phys_invalidate(tb, -1); - tb_free(tb); + tb_remove(tb); } r = true; } @@ -874,7 +874,7 @@ static TranslationBlock *tb_alloc(target_ulong pc) } /* Called with tb_lock held. */ -void tb_free(TranslationBlock *tb) +void tb_remove(TranslationBlock *tb) { assert_tb_locked(); @@ -1816,7 +1816,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) * cpu_exec_nocache() */ tb_phys_invalidate(tb->orig_tb, -1); } - tb_free(tb); + tb_remove(tb); } /* FIXME: In theory this could raise an exception. In practice we have already translated the block once so it's probably ok. */