From patchwork Tue Oct 10 00:55:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115312 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3168603qgn; Mon, 9 Oct 2017 18:01:04 -0700 (PDT) X-Received: by 10.55.118.195 with SMTP id r186mr11894830qkc.7.1507597264050; Mon, 09 Oct 2017 18:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507597264; cv=none; d=google.com; s=arc-20160816; b=S5B7bDo0KZbMiGL/O8qar6uVTOLPzgDfWXAwaa0b+gc23531cNsQzOI8HAEplkqACg poLEQjEqu5gA4aG+7lqS5vNPy84MPuY9UW+5IMqY/3jpi6umkmiAA7I306TnM/6pH4bo 8PqhKvNQizCZMcx274l01c93+fc688luhLROQdKCf1jqHnHOV9BH1IZKwLgarvjS2d7P eRAuBB4cQqbSxU447J7cfuiBwIRlIMo9zicQGR9c1Ze6Oj9QvRP+CWk4npIhqAaCsWV+ cvNqfHq8bJqIGjdBpc7ZaUrwIVgUpTTcdD6M60Dif9JEqTUKknhmjg3CyH3j1pVs+C2g GI8g== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=Jmmg93vGlfXYGCWPpMGtBaYKMC23pLLXYbM9fkFhyDY=; b=l1uj9tcjuyb5lD3RBogDLgWDeSzypf6/mA7+xiNsLt5kSvhs64g0PmE0OEWPeJm6AZ aAfdeSmHRVtehU8ONVng+Mz43XWcs9edN0xAMSa7JMeB0AqaO+J50vHUnIj6LgG9tjYi FovvNm4RFhKKqT+rbLX4isvDhNIYZwv86DPtOKZQeyIs4jcEfsKgU4lR3GRwkWWAnSKY AYuwRgefT+rsRdg/xXMKwuoxhscjMLgfx7An250JLlv3GFuP8wPcojckhaI79BgFst5E BSnft7ao8vpn3G1BLt1Ylx2U9lZyu2VBMiY3M/oHwIyZnDUJZ912kfxCkB2OYHoteeRq Qn4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WJErV/y3; 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 t13si400432qki.180.2017.10.09.18.01.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 09 Oct 2017 18:01:04 -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=WJErV/y3; 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]:60501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1ius-0005bl-0Q for patch@linaro.org; Mon, 09 Oct 2017 21:01:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1iqC-0002CO-79 for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1iqB-0004M5-Cx for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:12 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:45292) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1iqB-0004LI-7d for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:11 -0400 Received: by mail-pf0-x22b.google.com with SMTP id d28so768015pfe.2 for ; Mon, 09 Oct 2017 17:56:11 -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; bh=Jmmg93vGlfXYGCWPpMGtBaYKMC23pLLXYbM9fkFhyDY=; b=WJErV/y3XiLb3ZIVTu2bA7pRox6g2ZLd3wu69rf6xYhU3SP0zA03f3u/OF6qlk8vGh s6i5LBEF8E/httiixTM2ZICFYAsIDcZgDGUxzaCSa5mbsEJxgpGK0y5lLTNk2fhRwfaa fpC/NieRAH7cvTF9maSB9Qcw6bbSPW8ZocQbk= 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; bh=Jmmg93vGlfXYGCWPpMGtBaYKMC23pLLXYbM9fkFhyDY=; b=KWOuwTk3vFoDE8MtmpREeRMk6tir50cY8dn2Cbh/CjTgln2QFhnGf2hH88PT0Tjt15 ezkxwrI9L6x0CqtnA/O40Opf7ZGnJuZQjJ31OZS0cKd7BoECGgdie73XpMdRUzO6o5wZ 9OKty1MUNYzZyPcjY5WCuburb3YJgb8dZVvWr+wQAXecE2/dOE8mksENnH0JbIr2igCC 3iYFvFlBnjAq8ujclvYeAaOPOh2fmIZRBoIdYm6VrGMZbKhwoEJnFt+OrF/jukdf8ijk kmoluYAEnbde3Y7iA+NRDuy/6bGX7GhRpThGkj32a00f7KceIgiXPrt8TTxZXY60gnJR Glng== X-Gm-Message-State: AMCzsaUYdBhx+gZ1dyOpVi9yEbmO0dQRDi7bFdpREB/ZYcwlURQok3Sx z+4HwDsTLC8Ut5KZajTAR3qZT3atmbg= X-Google-Smtp-Source: AOwi7QCKrudq+RbkbgaYSI7vjKSDt/Un6efkempRxBBfeUONbHljbOHjz2zHcvvOFJDZiqWTHNl+gQ== X-Received: by 10.84.224.1 with SMTP id r1mr10203207plj.65.1507596969899; Mon, 09 Oct 2017 17:56:09 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id n19sm17121368pfj.52.2017.10.09.17.56.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2017 17:56:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 9 Oct 2017 17:55:42 -0700 Message-Id: <20171010005600.28735-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010005600.28735-1-richard.henderson@linaro.org> References: <20171010005600.28735-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22b Subject: [Qemu-devel] [PULL 05/23] cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reusing the have_tb_lock name, which is also defined in translate-all.c, makes code reviewing unnecessarily harder. Avoid potential confusion by renaming the local have_tb_lock variable to something else. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.13.6 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index ff6866624a..32104b8d8c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -372,7 +372,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, TranslationBlock *tb; target_ulong cs_base, pc; uint32_t flags; - bool have_tb_lock = false; + bool acquired_tb_lock = false; /* we record a subset of the CPU state. It will always be the same before a given translated block @@ -391,7 +391,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, */ mmap_lock(); tb_lock(); - have_tb_lock = true; + acquired_tb_lock = true; /* There's a chance that our desired tb has been translated while * taking the locks so we check again inside the lock. @@ -419,15 +419,15 @@ static inline TranslationBlock *tb_find(CPUState *cpu, #endif /* See if we can patch the calling TB. */ if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { - if (!have_tb_lock) { + if (!acquired_tb_lock) { tb_lock(); - have_tb_lock = true; + acquired_tb_lock = true; } if (!tb->invalid) { tb_add_jump(last_tb, tb_exit, tb); } } - if (have_tb_lock) { + if (acquired_tb_lock) { tb_unlock(); } return tb;