From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932360AbcBJDJx (ORCPT ); Tue, 9 Feb 2016 22:09:53 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33387 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932069AbcBJDJv (ORCPT ); Tue, 9 Feb 2016 22:09:51 -0500 Subject: Re: [RFC] perf: fix building for ARCv1 To: "acme@redhat.com" , Noam Camus References: <20151019095157.GM3816@twins.programming.kicks-ass.net> <20151020101133.GA17308@twins.programming.kicks-ass.net> <1446134296.3203.27.camel@synopsys.com> <1454516455.2811.4.camel__10775.5710989752$1454516490$gmane$org@synopsys.com> <56B2CFF2.4030503@synopsys.com> <20160205161027.GG28242@kernel.org> Cc: "peterz@infradead.org" , Alexey Brodkin , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "andi@firstfloor.org" , "dsahern@gmail.com" , "tglx@linutronix.de" , "linux-snps-arc@lists.infradead.org" , "dvhart@linux.intel.com" , Gilad Ben Yossef From: Vineet Gupta Organization: Synopsys Message-ID: <56BAA9F7.50807@synopsys.com> Date: Wed, 10 Feb 2016 08:39:43 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160205161027.GG28242@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 05 February 2016 09:40 PM, acme@redhat.com wrote: > Em Fri, Feb 05, 2016 at 11:18:52AM +0000, Noam Camus escreveu: >> Well here for EZchip I also see the: >> undefined reference to `__sync_add_and_fetch_4' >> undefined reference to `__sync_sub_and_fetch_4' > > Yeah, because there is no: tools/arch/arc/include/asm/atomic.h, can't > you guys adapt arch/arc/include/asm/atomic.h to use in userspace? Sure - however we need to support 3 variants: LLSC, !LLSC, EZCHIP If needed, latter 2 could be done using a new atomic assist syscall I presume kernel Kconfig items are no go in this header so this diversity management needs to use toolchain defined macros e.g. __ezchip__ > > - Arnaldo > >> This is since at file tools/include/asm/atomic.h we use the generic implementation >> If for ARC I could use just like x86 my own header file then functions like: >> atomic_inc() >> atomic_dec_and_test() >> Are easy to implement and you may see an example for such atomic methods in my patch set for the new platform. >> >> You however wants to use some GCC flag -matomic which I assume somehow will implement the above __sync*. >> I can't find the implementation but if it uses LLSC then it won't work for me since I am not supporting LLSC. > >> So seem that either I have my own header at kernel or that I need to >> change the GCC implementation for __sync* to use my atomic >> instructions. I am personally tend to the x86 solution and not the >> generic one since changing GCC will require to have new compiler >> dependency.