From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zJGR10J6yzF0XJ for ; Sat, 13 Jan 2018 08:41:32 +1100 (AEDT) Date: Fri, 12 Jan 2018 15:41:11 -0600 From: Segher Boessenkool To: Arnd Bergmann Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , kbuild test robot , linuxppc-dev , Herbert Xu Subject: Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x' Message-ID: <20180112214111.GQ21977@gate.crashing.org> References: <201801122249.RHvvGQJ6%fengguang.wu@intel.com> <20180112163946.GE21977@gate.crashing.org> <20180112204154.GM21977@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Jan 12, 2018 at 10:29:01PM +0100, Arnd Bergmann wrote: > On Fri, Jan 12, 2018 at 9:41 PM, Segher Boessenkool > wrote: > > On Fri, Jan 12, 2018 at 08:43:21PM +0100, Arnd Bergmann wrote: > >> On Fri, Jan 12, 2018 at 5:39 PM, Segher Boessenkool > > >> We could theoretically work around it by turning that into > >> "#if defined(CONFIG_CC_OPTIMIZE_FOR_SIZE) || > >> defined(CONFIG_CRYPTO_AES)", but that seems rather ugly. > >> > >> My earlier patch already tried to be more specific, turning very > >> specific optimizations off rather than moving from -O2 to -Os, > >> but that turned out to lead to significantly worse performance, > >> where -Os improved performance slightly. Is there a way > >> to ask powerpc compilers to use mostly -Os but not the > >> specific thing that makes it link to _restgpr_31_x? > > > > There is no such thing, sorry. Would be very hard to implement, and > > older compilers will never get it, so it won't help you anyway :-( > > We use -Os only for gcc-7.1 and higher, where it produces faster > code for AES and avoids running into > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 > > > Maybe for now just enable it in crtsavres.S always, with a comment? > > That -Os workaround is hopefully not going to live long either... > > It depends on whether or how soon someone comes up with a > better fix for PR83356. > gcc-8.0.0 is currently not affected by it, so we could limit the > workaround (and the hack in crtsavres.S) to gcc-7-only. I guess you could enable the _x routines whenever you use ubsan? Ubsan will cause much bigger code growth than the handful of insns in those routines? Segher