From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0okx-0006tT-C0 for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:49:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0oks-0003sh-4L for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:49:27 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:47405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0okr-0003sU-To for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:49:22 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so11843688wiv.8 for ; Tue, 16 Dec 2014 01:49:21 -0800 (PST) Sender: Paolo Bonzini Message-ID: <5490001C.7090706@redhat.com> Date: Tue, 16 Dec 2014 10:49:16 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1418721234-9588-1-git-send-email-fred.konrad@greensocs.com> <548FFBD5.5080405@redhat.com> <548FFD30.8040805@greensocs.com> In-Reply-To: <548FFD30.8040805@greensocs.com> Content-Type: text/plain; charset=windows-1252 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: Frederic Konrad , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mark.burton@greensocs.com, vilanova@ac.upc.edu On 16/12/2014 10:36, Frederic Konrad wrote: > 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? Not if it's just one for the whole process. Exiting QEMU will take care of it. Paolo