From: "Jan Beulich" Subject: Re: [PATCH] x86: simplify non-atomic bitops Date: Tue, 20 Jan 2015 08:09:18 +0000 Message-ID: <54BE1B3E0200007800056C8C@mail.emea.novell.com> References: <54BD3639020000780005692B@mail.emea.novell.com> <54BD3CFE.1040200@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDTsH-00049O-Gc for xen-devel@lists.xenproject.org; Tue, 20 Jan 2015 08:09:21 +0000 In-Reply-To: <54BD3CFE.1040200@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 19.01.15 at 18:21, wrote: > On 19/01/15 15:52, Jan Beulich wrote: >> - being non-atomic, their pointer arguments shouldn't be volatile- >> qualified >> - their (half fake) memory operands can be a single "+m" instead of >> being both an output and an input >> >> Signed-off-by: Jan Beulich > > There is a note at the top of the file describing why "+m" is > specifically not used. I have not looked into the reason yet, but a > patch like this at leasts needs an adjustment to the comment if you > believe it to be safe. You mean this: "We don't use "+m" because the gcc manual says that it should be used only when the constraint allows the operand to reside in a register"? It looks wrong anyway, and in the current gcc doc I verified that the respective statement (which indeed was there in older versions) got deleted. I'm convinced that it was there because on architectures where read-modify-write operations on memory operands don't exist, this indeed is necessary. But we're talking about x86-specific code here. Linux changed this in 2006 (commit 92934bcbf9), but later added a workaround for problems with gcc below 4.1 (which we don't care about). Interestingly it was also in 2006 that Keir changed our copy (12280:e10a13f13207). Bottom line - I'll simply remove the comment as being wrong. Jan