Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754148AbdCFTAv convert rfc822-to-8bit (ORCPT ); Mon, 6 Mar 2017 14:00:51 -0500 Received: from terminus.zytor.com ([65.50.211.136]:45036 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdCFTAo (ORCPT ); Mon, 6 Mar 2017 14:00:44 -0500 Date: Mon, 06 Mar 2017 10:53:57 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <2ed5cdac-7eb1-5444-c030-94e5504f7235@deltatee.com> References: <20170304224341.zfp4fl37ypt57amg@pd.tnic> <5CCEF10D-5647-4503-A398-0681DF2C8847@zytor.com> <20170305001447.kcxignj3nsq35vci@pd.tnic> <20170305003349.6kgq4ovj7ipezfxu@pd.tnic> <20170305095059.l4od2yjqm5yxx6ln@pd.tnic> <20170305195432.6occvwaujq3l4ejl@pd.tnic> <5be40886-b468-d828-f948-2ad99b95a230@deltatee.com> <471eb23d-40f2-0c66-c9db-c8b0b5204c07@zytor.com> <2ed5cdac-7eb1-5444-c030-94e5504f7235@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: Question Regarding ERMS memcpy To: Logan Gunthorpe , Borislav Petkov , Linus Torvalds CC: Thomas Gleixner , Ingo Molnar , Tony Luck , Al Viro , the arch/x86 maintainers , Linux Kernel Mailing List From: hpa@zytor.com Message-ID: <35205870-97E8-4E8E-B4EF-9961878FB591@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1296 Lines: 30 On March 6, 2017 9:12:41 AM PST, Logan Gunthorpe wrote: > > >On 06/03/17 12:28 AM, H. Peter Anvin wrote: >> On 03/05/17 23:01, Logan Gunthorpe wrote: >>> >>> On 05/03/17 12:54 PM, Borislav Petkov wrote: >>>> Logan, wanna give that a try, see if it takes care of your issue? >>> >>> Well honestly my issue was solved by fixing my kernel config. I have >no >>> idea why I had optimize for size in there in the first place. >>> >> >> Yes, to gcc "optimize for size" means exactly that... intended for >cases >> where saving storage (e.g. ROM) or code download time is paramount. > >I agree and understand, however placing a poorly performing _inline_ >memcpy instead of a single call instruction to a performant memcopy >probably took more code space in the end. So like Linus, I just have to >scratch my head at the -Os optimization option. > >Logan No, it will be smaller: -Os counts bytes. If you think about it, there is no way that replacing a five-byte subroutine call with a two-byte instruction opcode can make it bigger! The only other difference between the two from a size perspective is that the compiler doesn't have to worry about clobbered registers other than the argument registers. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.