From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aql2x-0005bw-Mu for qemu-devel@nongnu.org; Thu, 14 Apr 2016 13:27:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aql2s-00026A-Mp for qemu-devel@nongnu.org; Thu, 14 Apr 2016 13:27:15 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:35011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aql2s-000264-8Y for qemu-devel@nongnu.org; Thu, 14 Apr 2016 13:27:10 -0400 Received: by mail-pf0-x242.google.com with SMTP id r187so7680295pfr.2 for ; Thu, 14 Apr 2016 10:27:10 -0700 (PDT) Sender: Paolo Bonzini References: <1458222382-6498-1-git-send-email-sergey.fedorov@linaro.org> <1458222382-6498-5-git-send-email-sergey.fedorov@linaro.org> <56EAC8A2.7060700@redhat.com> <56EAC9E3.60000@gmail.com> <56F94B59.80905@gmail.com> <56F9A051.9090907@redhat.com> <56FA52E3.3000900@gmail.com> <56FA5ADB.7030103@redhat.com> <570FACF1.6020009@gmail.com> <570FB396.6040703@redhat.com> <570FB90B.1010209@gmail.com> From: Paolo Bonzini Message-ID: <570FD2EB.5050308@redhat.com> Date: Thu, 14 Apr 2016 19:27:07 +0200 MIME-Version: 1.0 In-Reply-To: <570FB90B.1010209@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] tcg: reorder removal from lists in tb_phys_invalidate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov , sergey.fedorov@linaro.org, qemu-devel@nongnu.org Cc: Peter Crosthwaite , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Richard Henderson On 14/04/2016 17:36, Sergey Fedorov wrote: > IIUC we always modify tb_jmp_cache/tb_phys_hash under tb_lock. We're > just gonna do tb_jmp_cache lookup outside of tb_lock. I think write > memory barrier in tb_phys_invalidate() paired with read memory memory > barrier in tb_find_fast()/tb_find_slow() would be enough to make it > safe. Also we need to use atomic read/set to tb_jmp_cache but cmpxchg is > not necessary. So I'm going to give it a thought then. Sounds good! Paolo