From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752930AbcELNJs (ORCPT ); Thu, 12 May 2016 09:09:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:60924 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbcELNJp (ORCPT ); Thu, 12 May 2016 09:09:45 -0400 Date: Thu, 12 May 2016 15:09:32 +0200 From: Borislav Petkov To: Peter Zijlstra Cc: "H. Peter Anvin" , Brian Gerst , x86-ml , Denys Vlasenko , LKML , Dmitry Vyukov , Andi Kleen , zengzhaoxiu@163.com, Thomas Gleixner , Ingo Molnar , Andrew Morton , Kees Cook , Zhaoxiu Zeng , Andy Lutomirski Subject: Re: [PATCH -v2] x86/hweight: Get rid of the special calling convention Message-ID: <20160512130932.GC10056@pd.tnic> References: <20160510172313.GA3192@twins.programming.kicks-ass.net> <8FE6169B-4F2E-4B7D-A271-14FEC245F663@zytor.com> <20160510191041.GI28520@pd.tnic> <20160511041128.GA2180@pd.tnic> <20160511112409.GE3190@twins.programming.kicks-ass.net> <20160512115738.GB10056@pd.tnic> <20160512121452.GR3192@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160512121452.GR3192@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2016 at 02:14:52PM +0200, Peter Zijlstra wrote: > But this is a C function, with C calling convention. You're now assuming > GCC doesn't clobber anything with its prologue/epilogue. > > I think hpa meant to put it in an .S file and avoid all that. I wanted to have gcc use %[w] and this way not hardcode the reg but the ABI kinda hardcodes it to rAX. And you're right about tracing funkyness adding glue so we're probably better off doing the .S thing directly and making it more robust this way. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --