android_kernel_oneplus_msm8998/arch/x86
Borislav Petkov c597f98755 x86/hweight: Get rid of the special calling convention
commit f5967101e9de12addcda4510dfbac66d7c5779c3 upstream.

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>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-24 09:32:04 +02:00
..
boot x86/boot/64: Verify alignment of the LOAD segment 2018-03-28 18:40:16 +02:00
configs kconfig: tinyconfig: provide whole choice blocks to avoid warnings 2016-09-24 10:07:42 +02:00
crypto crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one 2018-04-08 11:52:00 +02:00
entry x86/entry/64: Don't use IST entry for #BP stack 2018-03-28 18:40:16 +02:00
ia32 Merge branch 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-11-03 21:05:40 -08:00
include x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00
kernel x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00
kvm KVM: SVM: do not zero out segment attributes if segment is unusable or not present 2018-04-13 19:50:15 +02:00
lguest x86/paravirt: Prevent rtc_cmos platform device init on PV guests 2015-12-19 21:35:13 +01:00
lib x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00
math-emu x86/fpu/math-emu: Fix possible uninitialized variable use 2018-02-25 11:03:43 +01:00
mm x86/mm: implement free pmd/pte page interfaces 2018-03-28 18:40:14 +02:00
net bpf, x64: increase number of passes 2018-03-28 18:40:17 +02:00
oprofile x86/oprofile: Fix bogus GCC-8 warning in nmi_setup() 2018-02-28 10:17:22 +01:00
pci x86/PCI: Make broadcom_postcore_init() check acpi_disabled 2017-12-16 10:33:48 +01:00
platform x86/platform/olpc: Fix resume handler build warning 2018-02-25 11:03:47 +01:00
power x86/ldt: Make modify_ldt synchronous 2015-07-31 10:23:23 +02:00
purgatory x86/kexec: add -fno-PIE 2016-11-26 09:54:52 +01:00
ras x86/ras/mce_amd_inj: Inject bank 4 errors on the NBC 2015-10-12 16:15:48 +02:00
realmode x86/pti/efi: broken conversion from efi to kernel page table 2018-01-17 09:35:29 +01:00
tools x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 2018-03-18 11:17:52 +01:00
um x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt() 2017-12-09 18:42:40 +01:00
video
xen x86/mm: Enable CR4.PCIDE on supported systems 2018-01-02 20:33:24 +01:00
.gitignore
Kbuild x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ 2015-06-03 18:51:37 +02:00
Kconfig x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00
Kconfig.cpu x86/Kconfig/cpus: Fix/complete CPU type help texts 2015-10-21 11:12:56 +02:00
Kconfig.debug x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG 2018-02-25 11:03:43 +01:00
Makefile x86/build/64: Force the linker to use 2MB page size 2018-03-28 18:40:16 +02:00
Makefile.um kbuild: use relative path more to include Makefile 2015-04-02 16:42:08 +02:00
Makefile_32.cpu