]> Git Repo - linux.git/commit - lib/hweight.c
x86/hweight: Get rid of the special calling convention
authorBorislav Petkov <[email protected]>
Mon, 30 May 2016 10:56:27 +0000 (12:56 +0200)
committerIngo Molnar <[email protected]>
Wed, 8 Jun 2016 13:01:02 +0000 (15:01 +0200)
commitf5967101e9de12addcda4510dfbac66d7c5779c3
tree2f01f9e5eb430728ebecd5abff9851fafb5c8c62
parent08dd8cd06ed95625b9e2fac43c78fcb45b7eaf94
x86/hweight: Get rid of the special calling convention

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 <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/Kconfig
arch/x86/include/asm/arch_hweight.h
arch/x86/kernel/i386_ksyms_32.c
arch/x86/kernel/x8664_ksyms_64.c
arch/x86/lib/Makefile
arch/x86/lib/hweight.S [new file with mode: 0644]
lib/Makefile
lib/hweight.c
This page took 0.053801 seconds and 4 git commands to generate.