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: 10009487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBC85601E7 for ; Mon, 16 Oct 2017 17:50:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AECAE28695 for ; Mon, 16 Oct 2017 17:50:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD5B8286A2; Mon, 16 Oct 2017 17:50:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4644B28695 for ; Mon, 16 Oct 2017 17:50:02 +0000 (UTC) Received: from localhost ([::1]:34386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49Wb-0004Ad-GL for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Oct 2017 13:50:01 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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. */