From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0oYp-0000ba-JL for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:37:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0oYk-00076X-6c for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:36:55 -0500 Received: from [2001:41d0:8:2b42::1] (port=57511 helo=greensocs.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0oYj-00076S-Uz for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:36:50 -0500 Message-ID: <548FFD30.8040805@greensocs.com> Date: Tue, 16 Dec 2014 10:36:48 +0100 From: Frederic Konrad MIME-Version: 1.0 References: <1418721234-9588-1-git-send-email-fred.konrad@greensocs.com> <548FFBD5.5080405@redhat.com> In-Reply-To: <548FFBD5.5080405@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH] target-arm: protect cpu_exclusive_*. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mark.burton@greensocs.com, vilanova@ac.upc.edu On 16/12/2014 10:31, Paolo Bonzini wrote: > > On 16/12/2014 10:13, fred.konrad@greensocs.com wrote: >> From: KONRAD Frederic >> >> This adds a lock to avoid multiple exclusive access at the same time in case of >> TCG multithread. >> >> Signed-off-by: KONRAD Frederic >> --- >> target-arm/cpu.c | 15 +++++++++++++++ >> target-arm/cpu.h | 3 +++ >> target-arm/helper.h | 3 +++ >> target-arm/op_helper.c | 10 ++++++++++ >> target-arm/translate.c | 6 ++++++ >> 5 files changed, 37 insertions(+) [..] >> g_hash_table_destroy(cpu->cp_regs); >> + qemu_mutex_destroy(&cpu_exclusive_lock); > No need for this, and for -smp 2 it will cause the same lock to be > destroyed twice. > > Paolo Hi Paolo, Good point for SMP! The mutex doesn't need to be destroyed? Thanks, Fred