linux-stable/arch/x86/lib
Borislav Petkov f5967101e9 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 <hpa@zytor.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1464605787-20603-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-06-08 15:01:02 +02:00
..
.gitignore
atomic64_32.c
atomic64_386_32.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
atomic64_cx8_32.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
cache-smp.c
checksum_32.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
clear_page_64.S x86/cpufeature: Carve out X86_FEATURE_* 2016-01-30 11:22:17 +01:00
cmdline.c x86/boot: Pass in size to early cmdline parsing 2016-02-03 12:03:18 +01:00
cmpxchg8b_emu.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
cmpxchg16b_emu.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
copy_page_64.S x86/cpufeature: Carve out X86_FEATURE_* 2016-01-30 11:22:17 +01:00
copy_user_64.S Merge branch 'x86/urgent' into x86/asm, to pick up fixes 2016-02-18 09:28:03 +01:00
cpu.c x86/cpu: Unify CPU family, model, stepping calculation 2015-11-24 09:15:54 +01:00
csum-copy_64.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
csum-partial_64.c
csum-wrappers_64.c ipv6: Pass proto to csum_ipv6_magic as __u8 instead of unsigned short 2016-03-13 23:55:13 -04:00
delay.c x86/delay: Avoid preemptible context checks in delay_mwaitx() 2016-03-10 11:27:12 +01:00
getuser.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
hweight.S x86/hweight: Get rid of the special calling convention 2016-06-08 15:01:02 +02:00
inat.c x86: Fix to decode grouped AVX with VEX pp bits 2012-02-11 15:11:35 +01:00
insn.c x86/asm/decoder: Use explicitly signed chars 2016-03-03 16:13:00 +01:00
iomap_copy_64.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
Makefile x86/hweight: Get rid of the special calling convention 2016-06-08 15:01:02 +02:00
memcpy_32.c asmlinkage, x86: Fix 32bit memcpy for LTO 2014-02-13 18:14:46 -08:00
memcpy_64.S x86/mm, x86/mce: Fix return type/value for memcpy_mcsafe() 2016-03-16 09:02:18 +01:00
memmove_64.S x86/cpufeature: Carve out X86_FEATURE_* 2016-01-30 11:22:17 +01:00
memset_64.S Merge branch 'x86/cleanups' into x86/urgent 2016-03-17 09:44:57 +01:00
misc.c x86/boot: Further compress CPUs bootup message 2013-10-01 10:52:30 +02:00
mmx_32.c x86/fpu: Rename i387.h to fpu/api.h 2015-05-19 15:47:30 +02:00
msr-reg-export.c x86, pvops: Remove hooks for {rd,wr}msr_safe_regs 2012-06-07 11:41:08 -07:00
msr-reg.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
msr-smp.c x86 / msr: add 64bit _on_cpu access functions 2013-10-17 00:36:06 +02:00
msr.c x86, tracing, perf: Add trace point for MSR accesses 2015-12-06 12:56:10 +01:00
putuser.S x86/debug: Remove perpetually broken, unmaintainable dwarf annotations 2015-06-02 07:57:48 +02:00
rwsem.S locking/rwsem: Fix comment on register clobbering 2016-05-16 12:35:40 +02:00
string_32.c
strstr_32.c
usercopy.c perf/x86: Fix copy_from_user_nmi() return if range is not ok 2015-07-06 14:09:27 +02:00
usercopy_32.c x86/cpufeature: Remove cpu_has_xmm2 2016-03-31 13:35:09 +02:00
usercopy_64.c x86: fix special __probe_kernel_write() tail zeroing case 2015-04-24 06:58:27 -07:00
x86-opcode-map.txt x86/insn: perf tools: Add new xsave instructions 2015-09-04 12:01:04 -03:00