From patchwork Thu Jul 7 16:44:38 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: 9219187 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 3A8F460574 for ; Thu, 7 Jul 2016 16:52:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A0C028307 for ; Thu, 7 Jul 2016 16:52:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E4BD283E5; Thu, 7 Jul 2016 16:52:45 +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 82ED828307 for ; Thu, 7 Jul 2016 16:52:43 +0000 (UTC) Received: from localhost ([::1]:41267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCXa-0006F8-3b for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Jul 2016 12:52:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCQ0-00040d-7z 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 1bLCPx-0002wy-1o for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:44:51 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:33112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLCPw-0002wl-Pl for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:44:48 -0400 Received: by mail-lf0-x230.google.com with SMTP id f6so15224249lfg.0 for ; Thu, 07 Jul 2016 09:44:48 -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=RIkMx4CqnYilu/hdl1xL3ECff5UltKEDK9vxjAeqLHE=; b=MqFluf10E5+p5b90/qQLQzyxmYKX8d8yB5NvhKPLIdkM/h/z42cSKTx3fn+PQKY+Jh RFETQxZ14xGQKt7Gj6+q8D8UiKIZ2oDy4Y9bXcoJ8iMpB1n3kATPr+OdSH3/DJzesjTh rcT0abtCMjb5vznnMyK7pWMW95p08HX2Nn8jo= 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=RIkMx4CqnYilu/hdl1xL3ECff5UltKEDK9vxjAeqLHE=; b=fBVyqPs4pl2hY4ncPxXiwdkeI5kr//opQLoxr004tA1m2YJDTzb8Ga9ppbm/pNuZ9t zRlYHANNDR+v6Fvvwzb5ZYGycTxJcjqgrjGigjAN8Yg4e5Y57RbxVkMxjglFIal5M4Df xzyv8d0DwCoaDxfEID5lgGhBDB6IJXoOZMqHzVcuMEIYq9Y4K44i+P25NOLLvcyPhLmN Yhh0bjZL9atg6DPlFBhS4cforWayyO74myzIopBbni2s7jziZhhISntDG7LdAho/hxPq RGv9k65IqbNMmIfc0sqq5yP7yqm30iAeOV2EkW/NAdGEdlQuwqFbxHybsg9sKPKk5AVb hCpA== X-Gm-Message-State: ALyK8tJ3RG+D+e2I/zw7tBZAZ44Fqq8nuQimEDATtZux5BeUPT6FA2S54g8JSzKg368v0w+3 X-Received: by 10.46.1.148 with SMTP id f20mr331259lji.52.1467909887967; Thu, 07 Jul 2016 09:44:47 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 09:44:47 -0700 (PDT) From: Sergey Fedorov To: qemu-devel@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 7 Jul 2016 19:44:38 +0300 Message-Id: <1467909880-18834-2-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::230 Subject: [Qemu-devel] [PATCH 1/3] tcg: Introduce mmap_lock_reset() 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, Riku Voipio , 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 --- bsd-user/mmap.c | 7 +++++++ include/exec/exec-all.h | 2 ++ linux-user/mmap.c | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 610f91b28584..b2e5909b03c4 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -42,6 +42,13 @@ void mmap_unlock(void) } } +void mmap_lock_reset(void) +{ + if (mmap_lock_count) { + pthread_mutex_unlock(&mmap_mutex); + } +} + /* Grab lock to make sure things are in a consistent state after fork(). */ void mmap_fork_start(void) { diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index c1f59fa59d2c..0375acb5ab40 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -369,6 +369,7 @@ void tlb_fill(CPUState *cpu, target_ulong addr, int is_write, int mmu_idx, #if defined(CONFIG_USER_ONLY) void mmap_lock(void); void mmap_unlock(void); +void mmap_lock_reset(void); static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr) { @@ -377,6 +378,7 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong #else static inline void mmap_lock(void) {} static inline void mmap_unlock(void) {} +static inline void mmap_lock_reset(void) {} /* cputlb.c */ tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr); diff --git a/linux-user/mmap.c b/linux-user/mmap.c index c4371d943a85..4cd998f96766 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -43,6 +43,13 @@ void mmap_unlock(void) } } +void mmap_lock_reset(void) +{ + if (mmap_lock_count) { + pthread_mutex_unlock(&mmap_mutex); + } +} + /* Grab lock to make sure things are in a consistent state after fork(). */ void mmap_fork_start(void) {