From patchwork Thu Jul 20 03:09:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 791362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="RCT5IUEA"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="qQt/hfmz"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xCfPV2Lczz9sNV for ; Thu, 20 Jul 2017 13:23:42 +1000 (AEST) Received: from localhost ([::1]:35852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY23v-0006EN-Rv for incoming@patchwork.ozlabs.org; Wed, 19 Jul 2017 23:23:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY1qP-00016l-5z for qemu-devel@nongnu.org; Wed, 19 Jul 2017 23:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dY1qL-0005sI-5L for qemu-devel@nongnu.org; Wed, 19 Jul 2017 23:09:41 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55933) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dY1qL-0005rv-1g for qemu-devel@nongnu.org; Wed, 19 Jul 2017 23:09:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9E9F320B61; Wed, 19 Jul 2017 23:09:36 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Wed, 19 Jul 2017 23:09:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Lx575OXlm/fnh8I 8yvFhoOvFJdD+y31o6+ltKwk9yiI=; b=RCT5IUEAw0lhS+OLRp7ul+1glwyDu0f 3o+U25gsanzWvPH3lW7buDFVdY/80uHsZcepqROpojFObzkZlsA0f9i9C/7VfUUD FT8xJkBjKhnJqHlMco4sEBe5ffVkItCA51yRPWbXgV0LarTnW2thQq4NXLbFuYSO aKrOsVy8rVIs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=Lx575OXlm/fnh8I8yvFhoOvFJdD+y31o6+ltKwk9yiI=; b=qQt/hfmz epZAfauCYTnRNjrOgV2YIWlQ9Nmyg+lNhit5jsxhn6HZ6p2fSVch3X8T3QtrJRk3 ixuvuubySbN4SU6+Q9Ak4XTVFAKmet8PxPA+z7uptTUySXvK/pwx1/Y5SMPUlqxO 9Qi84d1Ny2yI59nfmrOtoxzdyCyM8C3/fcYDKabn8nsv6UekStDOl1PVcP9XtYy2 xjLkBM9jzpwwHaW1Yjv++aHXQJ6MyIu9lqJONCCMHg+5C5qvXJA5RMOUGZfF4bVM wii5x+2LHk2sikMZMm9NtW5o+ARi+B9C4z79xsVyUCzyGpH+5yxE042gOxRq2Nni 1j/u1vMT59HCDg== X-ME-Sender: X-Sasl-enc: +6whNcFRnipuhewT1/48FpCAii7Q6h4fskzTg4+ITCOS 1500520176 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 654FD7E057; Wed, 19 Jul 2017 23:09:36 -0400 (EDT) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Wed, 19 Jul 2017 23:09:14 -0400 Message-Id: <1500520169-23367-29-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500520169-23367-1-git-send-email-cota@braap.org> References: <1500520169-23367-1-git-send-email-cota@braap.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v3 28/43] 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: Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 eb3eb7b..7bc2050 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -428,7 +428,7 @@ static inline uint32_t curr_cflags(void) return parallel_cpus ? CF_PARALLEL : 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 cb1e6d3..1963bda 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -218,7 +218,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 cb71aef..448f13b 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(); @@ -1809,7 +1809,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. */