From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBu7-0006VV-Ha for qemu-devel@nongnu.org; Mon, 18 Jul 2016 13:00:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPBu1-0004vI-Ew for qemu-devel@nongnu.org; Mon, 18 Jul 2016 13:00:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBu1-0004v0-9E for qemu-devel@nongnu.org; Mon, 18 Jul 2016 13:00:21 -0400 References: <1468851450-9863-1-git-send-email-pbonzini@redhat.com> <578D0938.2050004@gmail.com> <578D0A60.4020608@gmail.com> From: Paolo Bonzini Message-ID: <8c52110d-c009-087c-be04-3920d97af323@redhat.com> Date: Mon, 18 Jul 2016 19:00:17 +0200 MIME-Version: 1.0 In-Reply-To: <578D0A60.4020608@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] atomics: add volatile_read/volatile_set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov , qemu-devel@nongnu.org Cc: sergey.fedorov@linaro.org, alex.bennee@linaro.org On 18/07/2016 18:57, Sergey Fedorov wrote: > On 18/07/16 19:53, Paolo Bonzini wrote: > > On 18/07/2016 18:52, Sergey Fedorov wrote: > > > So how are we going to use them? > > Instead of atomic_read/atomic_set when marking invalid TBs. > But shouldn't they be atomic to avoid reading torn writes? A torn write would probably fail to match anyway, but even if it doesn't it is indistinguishable from a race, isn't it? By the way, tb_cmp should also use volatile_read. Paolo