From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751906AbcEKELe (ORCPT ); Wed, 11 May 2016 00:11:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:42037 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751051AbcEKELc (ORCPT ); Wed, 11 May 2016 00:11:32 -0400 Date: Wed, 11 May 2016 06:11:28 +0200 From: Borislav Petkov To: "H. Peter Anvin" Cc: Peter Zijlstra , x86-ml , Denys Vlasenko , Brian Gerst , 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: <20160511041128.GA2180@pd.tnic> References: <20160504194101.GE23257@pd.tnic> <20160504202213.GF23257@pd.tnic> <572B446D.1030000@redhat.com> <20160505140446.GE534@pd.tnic> <20160510165318.GD28520@pd.tnic> <20160510172313.GA3192@twins.programming.kicks-ass.net> <8FE6169B-4F2E-4B7D-A271-14FEC245F663@zytor.com> <20160510191041.GI28520@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Tue, May 10, 2016 at 03:30:48PM -0700, H. Peter Anvin wrote: > I didn't mean inline assembly. How does that matter? The problem is having as less insn bytes as possible and the minimal size we can do is issuing POPCNT everywhere which is 4 or 5 bytes. The alternatives then replace that with a CALL which is also 5 bytes. The way I did it now, it adds 22K more to allyesconfig vmlinux due to the static_cpu_has doubled alternatives sections and the JMPs. The thunks will keep those 5 bytes *and* get rid of the calling convention without the growth. Or? -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --