From patchwork Tue Oct 10 19:29:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115458 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4120645qgn; Tue, 10 Oct 2017 12:38:16 -0700 (PDT) X-Received: by 10.237.34.28 with SMTP id n28mr14924764qtc.30.1507664296296; Tue, 10 Oct 2017 12:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507664296; cv=none; d=google.com; s=arc-20160816; b=RHaZcBZEqVdOr70cpdbpgJdD31Y+jrmCq3tyAD763MQnXdZEGvSxvXsO4GqQ4priG0 c2i3T18J29W+HMPgZIaPoKglpQKHclFrW26EXqnfxN8IZoPiFnov0tW6szEz62J9CDmM kovByTSJoQQl0jx4b9qRpnNuO32M5pRSzVM6plQk/Gd0BPTCsfU7AeTTj+VexRQM05sx +Yd6GilylILLLVGWCo33CStp2NW/pqSCay1bcZOUFqPujd4GWGrxQtTNOqNtnP4xx9kp Pytm3cGDeFWFWTSqG77V8wjjulUtEU3n0R7l47qNTqVWyoN4D8SeUOYXIvaJaXTcOm+H 7Reg== 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=PCuvbyB2FsTUoKhQMng8MjeInVva4igATYF3ITazo6xJeurYRmehH7yTxlb4OOcB3S vBj64w8K7wCszvPD41COQhXW+2iUdOJqn//Hk7B1UxxzJYF4d502DduL7KBlEnOIel22 6m0mBlR9xkTEELr2C01ngXXrL/ieazCRM0zUoPRtQq+PkBATLF9/jfEiUBxatE/DdN3C 7Fx0bpqrYLXol8Fccz+yMboQOu5Cih/NgrSFbIlveDsjAD9JoqaKDfA4+aEjYSfMr4VA mT7sBzfyRGPaJTLdob70/fEz0OOEyBRrSaliKRrDM8Zj1yQSXactJYHElxpBLX2HC/Zd 0xcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Q17l8FHg; 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 n16si1730242qtn.115.2017.10.10.12.38.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 10 Oct 2017 12:38:16 -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=Q17l8FHg; 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]:36826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20M2-0006Dj-8x for patch@linaro.org; Tue, 10 Oct 2017 15:38:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20EJ-0000X8-1s for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e20EH-0004za-UA for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:14 -0400 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]:45679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e20EH-0004y9-Oc for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:13 -0400 Received: by mail-pf0-x233.google.com with SMTP id d28so3568998pfe.2 for ; Tue, 10 Oct 2017 12:30:13 -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=Q17l8FHg6TMDqhzXUYHqL2gWewq96NZccc9avk5xLllHMIoPMFQN5xBClPT8e8IHgN uo/y3pBG6KjMCsMujB93QGR0wH1ir+Q6kT9FStVgScNnCnSVvllYr89S7KbJfA1FYeAc ptCBw13KT7y8SFB77yX4gCRkKGexggSYhIZJk= 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=kZp4PaNhCMNDqJK0YdpCuHTm4SgVEo11+FbuN6jff/04KkG+AA1zCQysrjaNu4Gk5A VOp0YTut4i0deNuHKyP4maDu5z2r8loUVrXjFHtqnpDpLxhs7AjNTQGMj66akm8KOBkm PA/3YEPGcZv9nw5FQqyirHXgMyoK/vYgKk2XfsbQuyzOgxAQRroTVno3KxS/mhNsAbJl a3nqisAZkoUJNjRJyvmByaDwnfNAdn6owYC/CBAuWHE8TGrb5A0I9qn336JqA5PEQpaV I/sMiEbw2ig8QuELJBrx1aVm5/vOZieMJum3T0aLJYeCArEjenlz7Eiv33PLEPmiKdyV FL7A== X-Gm-Message-State: AMCzsaXJBC33CsmIga3x6bXuGMQtO+r+PeiV537zyRRQ0VCecLJwwIkt RTJxvqmrGQVgA5Szbn4/XqwyJOWt+dA= X-Google-Smtp-Source: AOwi7QBKZapCaejHVimodMtc+4FE4eatiZ+a42KvopaOLkzZZHC63mVHbVKsV8BdeR/sxSkFvTyvhA== X-Received: by 10.101.65.129 with SMTP id a1mr13373388pgq.203.1507663812550; Tue, 10 Oct 2017 12:30:12 -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 r22sm19859788pfl.15.2017.10.10.12.30.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 12:30:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 10 Oct 2017 12:29:48 -0700 Message-Id: <20171010193003.28857-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010193003.28857-1-richard.henderson@linaro.org> References: <20171010193003.28857-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::233 Subject: [Qemu-devel] [PULL v2 05/20] 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;