From patchwork Thu Jul 7 16:44:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sergey.fedorov@linaro.org X-Patchwork-Id: 9219181 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 332CF60574 for ; Thu, 7 Jul 2016 16:45:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 228772838C for ; Thu, 7 Jul 2016 16:45:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1753928391; Thu, 7 Jul 2016 16:45:28 +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 87A542838C for ; Thu, 7 Jul 2016 16:45:27 +0000 (UTC) Received: from localhost ([::1]:41214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCQY-000444-NZ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Jul 2016 12:45:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCQ0-00040g-8R for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLCPy-0002xI-Bi for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:44:51 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:34970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCPy-0002xE-39 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:44:50 -0400 Received: by mail-lf0-x22b.google.com with SMTP id l188so15202695lfe.2 for ; Thu, 07 Jul 2016 09:44:49 -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=FxjircWfPu9ICd6CPRtTKSSCVUzTfbePgL9nlCIvwtw=; b=jP8H3Okcrrq2NK278DIO57J0AKDMLzyGjLrqeXafG5OItMYvkeLDJazx2L5HV+1F1+ gNXuF7MdC5DLZiqJzFdv1PMJjxPvPtXtUGRxiqx7vISc+CCEDkD65T4Kxj4jIw7IPQ+V a4tAUMRyrQ7GzQanLfdLuhf0zYhnYAISNuT8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FxjircWfPu9ICd6CPRtTKSSCVUzTfbePgL9nlCIvwtw=; b=fKrjkaB3q8crkJ5tKn3wG7iZbIUsrLNovI/Hk8FWepcsJJzGDh8Skx5KVMzDETMVm2 yHeafLfVgNR5opYncRHkN5ZAPLBk4Tt+9DiyQVpYh/IxPy2Su8anlaV4M8MWGzPNnxZM 2KTj3rzGJtvGIKZzfKYAIDojgUp5f4El16cye8oQc5V9W1gQDPD9Lni7Uj6uMuA2AFCs JvEu2LJIGR0IINPs01t7g9O/F3DLX2KrmyBm7kBMKJxm+wnUOJZMLijiigzKq9x7WK6Z VZOr+DVB3KqTirqQzNnvhj2vM+zOy/NptJvxCl8pkqK1PR0Cv270yk0R6Rs273y2MPT3 C74A== X-Gm-Message-State: ALyK8tJ5q58WznTENVjtgN8f0W9v6OWY0MzXMeW4Vdijnk/ita+gk2FB+DXqWB19RlIr4G+I X-Received: by 10.46.71.208 with SMTP id u199mr324087lja.17.1467909889354; Thu, 07 Jul 2016 09:44:49 -0700 (PDT) Received: from sergey-laptop.Dlink (broadband-46-188-120-37.2com.net. [46.188.120.37]) by smtp.gmail.com with ESMTPSA id g62sm620627ljg.40.2016.07.07.09.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 09:44:48 -0700 (PDT) From: Sergey Fedorov To: qemu-devel@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 7 Jul 2016 19:44:39 +0300 Message-Id: <1467909880-18834-3-git-send-email-sergey.fedorov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467909880-18834-1-git-send-email-sergey.fedorov@linaro.org> References: <1467735496-16256-7-git-send-email-alex.bennee@linaro.org> <1467909880-18834-1-git-send-email-sergey.fedorov@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22b Subject: [Qemu-devel] [PATCH 2/3] tcg: Introduce tb_lock_locked() 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: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, Sergey Fedorov , patches@linaro.org, jan.kiszka@siemens.com, Peter Crosthwaite , mark.burton@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, pbonzini@redhat.com, Sergey Fedorov , bobby.prani@gmail.com, rth@twiddle.net, fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- tcg/tcg.h | 1 + translate-all.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/tcg/tcg.h b/tcg/tcg.h index 66d7fc01c53c..ca9329d99f90 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -648,6 +648,7 @@ void tcg_pool_delete(TCGContext *s); void tb_lock(void); void tb_unlock(void); +bool tb_lock_locked(void); void tb_lock_reset(void); static inline void *tcg_malloc(int size) diff --git a/translate-all.c b/translate-all.c index 97e834a84503..0dfcf9bc3430 100644 --- a/translate-all.c +++ b/translate-all.c @@ -143,6 +143,15 @@ void tb_unlock(void) #endif } +bool tb_lock_locked(void) +{ +#ifdef CONFIG_USER_ONLY + return have_tb_lock; +#else + return true; +#endif +} + void tb_lock_reset(void) { #ifdef CONFIG_USER_ONLY