From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [RFC v3 01/26] asm-generic: atomic64: allow using generic atomic64 on 64bit platforms Date: Wed, 5 Feb 2020 13:49:08 +0100 Message-ID: <20200205124908.GL14879@hirez.programming.kicks-ass.net> References: <39e1313ff3cf3eab6ceb5ae322fcd3e5d4432167.1580882335.git.thehajime@gmail.com> <20200205093454.GG14879@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from bombadil.infradead.org ([198.137.202.133]:43768 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbgBEMtM (ORCPT ); Wed, 5 Feb 2020 07:49:12 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Octavian Purdila Cc: Hajime Tazaki , linux-um , Akira Moroo , linux-kernel-library , linux-arch , Will Deacon , Boqun Feng On Wed, Feb 05, 2020 at 02:24:38PM +0200, Octavian Purdila wrote: > I was not aware that not allowing GENERIC_ATOMIC64 was intentional. I It might not have been, but presented with this patch, I feel like it should've been :-) > understand your point that a 64 bit architecture that can't handle 64 > bit atomic operation is broken. (sadly they actually exist, I shall name no names) > One way to deal with this in LKL would be to use GCC atomic builtins > or if that doesn't work expose them as host operations. This would > keep LKL as a meta-arch that can run on multiple physical > architectures. I'll give it a try. What is this LKL you speak of and how does it do the 32bit atomics? One thing to keep in mind is that the C11 atomics (_Atomic) don't trivially map to the LKMM -- although I keep forgetting the exact details, there is a paper on it somewhere. Also, once you're limited to a specific arch the issue also becomes much easier than C11 vs LKMM in general. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 5 Feb 2020 13:49:08 +0100 From: Peter Zijlstra Subject: Re: [RFC v3 01/26] asm-generic: atomic64: allow using generic atomic64 on 64bit platforms Message-ID: <20200205124908.GL14879@hirez.programming.kicks-ass.net> References: <39e1313ff3cf3eab6ceb5ae322fcd3e5d4432167.1580882335.git.thehajime@gmail.com> <20200205093454.GG14879@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Octavian Purdila Cc: linux-arch , Boqun Feng , linux-um , Akira Moroo , linux-kernel-library , Will Deacon , Hajime Tazaki On Wed, Feb 05, 2020 at 02:24:38PM +0200, Octavian Purdila wrote: > I was not aware that not allowing GENERIC_ATOMIC64 was intentional. I It might not have been, but presented with this patch, I feel like it should've been :-) > understand your point that a 64 bit architecture that can't handle 64 > bit atomic operation is broken. (sadly they actually exist, I shall name no names) > One way to deal with this in LKL would be to use GCC atomic builtins > or if that doesn't work expose them as host operations. This would > keep LKL as a meta-arch that can run on multiple physical > architectures. I'll give it a try. What is this LKL you speak of and how does it do the 32bit atomics? One thing to keep in mind is that the C11 atomics (_Atomic) don't trivially map to the LKMM -- although I keep forgetting the exact details, there is a paper on it somewhere. Also, once you're limited to a specific arch the issue also becomes much easier than C11 vs LKMM in general. _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um