From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0opv-0004mU-0R for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:54:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0opp-0005fJ-Po for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:54:34 -0500 Received: from [2001:41d0:8:2b42::1] (port=57685 helo=greensocs.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0opp-0005f7-GL for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:54:29 -0500 Message-ID: <54900153.5060502@greensocs.com> Date: Tue, 16 Dec 2014 10:54:27 +0100 From: Frederic Konrad MIME-Version: 1.0 References: <1418721234-9588-1-git-send-email-fred.konrad@greensocs.com> <548FFBD5.5080405@redhat.com> <548FFD30.8040805@greensocs.com> <5490001C.7090706@redhat.com> In-Reply-To: <5490001C.7090706@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:49, Paolo Bonzini wrote: > > 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 Ok fine :). Thanks, Fred