From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754778AbcE3MIy (ORCPT ); Mon, 30 May 2016 08:08:54 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47129 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751137AbcE3MIx (ORCPT ); Mon, 30 May 2016 08:08:53 -0400 Date: Mon, 30 May 2016 14:08:49 +0200 From: Peter Zijlstra To: Borislav Petkov Cc: X86 ML , LKML , Andy Lutomirski Subject: Re: [PATCH] x86/hweight: Get rid of the special calling convention Message-ID: <20160530120849.GC3193@twins.programming.kicks-ass.net> References: <1464605787-20603-1-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464605787-20603-1-git-send-email-bp@alien8.de> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 30, 2016 at 12:56:27PM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > People complained about ARCH_HWEIGHT_CFLAGS and how it throws a wrench > into kcov, lto, etc, experimentations. > > Add asm versions for __sw_hweight{32,64}() and do explicit saving and > restoring of clobbered registers. This gets rid of the special calling > convention. We get to call those functions on !X86_FEATURE_POPCNT CPUs. > > We still need to hardcode POPCNT and register operands as some old gas > versions which we support, do not know about POPCNT. > > Btw, remove redundant REX prefix from 32-bit POPCNT because alternatives > can do padding now. > > Suggested-by: "H. Peter Anvin" > Signed-off-by: Borislav Petkov > Cc: Andy Lutomirski Acked-by: Peter Zijlstra (Intel)