android_kernel_oneplus_msm8998/arch/x86/kernel
Borislav Petkov 2d45dae0af x86/cpufeature: Replace the old static_cpu_has() with safe variant
commit bc696ca05f5a8927329ec276a892341e006b00ba upstream

So the old one didn't work properly before alternatives had run.
And it was supposed to provide an optimized JMP because the
assumption was that the offset it is jumping to is within a
signed byte and thus a two-byte JMP.

So I did an x86_64 allyesconfig build and dumped all possible
sites where static_cpu_has() was used. The optimization amounted
to all in all 12(!) places where static_cpu_has() had generated
a 2-byte JMP. Which has saved us a whopping 36 bytes!

This clearly is not worth the trouble so we can remove it. The
only place where the optimization might count - in __switch_to()
- we will handle differently. But that's not subject of this
patch.

Signed-off-by: Borislav Petkov <bp@suse.de>
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: H. Peter Anvin <hpa@zytor.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/1453842730-28463-6-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu>
Reviewed-by: Matt Helsley (VMware) <matt.helsley@gmail.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
Reviewed-by: Bo Gan <ganb@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-17 11:31:44 +02:00
..
acpi x86/acpi: Reduce code duplication in mp_override_legacy_irq() 2018-01-17 09:35:26 +01:00
apic x86/cpufeature: Replace the old static_cpu_has() with safe variant 2018-07-17 11:31:44 +02:00
cpu x86/cpufeature: Replace the old static_cpu_has() with safe variant 2018-07-17 11:31:44 +02:00
fpu x86/fpu: Fix math emulation in eager fpu mode 2018-06-16 09:54:25 +02:00
kprobes kprobes/x86: Do not modify singlestep buffer while resuming 2018-07-11 16:03:47 +02:00
.gitignore
alternative.c x86/paravirt: Remove 'noreplace-paravirt' cmdline option 2018-02-25 11:03:54 +01:00
amd_gart_64.c
amd_nb.c x86/amd_nb: Fix boot crash on non-AMD systems 2016-07-27 09:47:29 -07:00
apb_timer.c x86/asm/tsc: Rename native_read_tsc() to rdtsc() 2015-07-06 15:23:28 +02:00
aperture_64.c x86/gart: Check for GART support before accessing GART registers 2015-05-06 11:15:53 +02:00
apm_32.c apm32: Fix cputime == jiffies assumption 2015-07-29 15:44:58 +02:00
asm-offsets.c 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
asm-offsets_32.c x86: Remove unused TI_cpu 2015-05-05 20:48:02 +02:00
asm-offsets_64.c x86/asm/entry: (Re-)rename __NR_entry_INT80_compat_max to __NR_syscall_compat_max 2015-06-08 23:43:38 +02:00
audit_64.c
bootflag.c x86: don't use module_init for non-modular core bootflag code 2015-06-16 14:12:34 -04:00
check.c Linux 4.2-rc8 2015-08-25 09:59:19 +02:00
cpuid.c x86: Drop bogus __ref / __refdata annotations 2015-07-20 18:57:20 +02:00
crash.c x86/kexec: Remove obsolete 'in_crash_kexec' flag 2015-10-12 09:43:11 +02:00
crash_dump_32.c
crash_dump_64.c
devicetree.c x86/devicetree: Fix device IRQ settings in DT 2018-05-30 07:49:13 +02:00
doublefault.c
dumpstack.c Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 13:23:34 -07:00
dumpstack_32.c Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 13:23:34 -07:00
dumpstack_64.c x86/kernel: Use kstack_end() in dumpstack_64.c 2015-02-23 18:37:13 +01:00
e820.c x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
early-quirks.c drm/i915: Account for TSEG size when determining 865G stolen base 2016-10-31 04:13:58 -06:00
early_printk.c x86/early_printk: Set __iomem address space for IO 2015-10-13 21:45:56 +02:00
espfix_64.c kaiser: add "nokaiser" boot option, using ALTERNATIVE 2018-01-05 15:44:25 +01:00
ftrace.c ftrace/x86: Fix triple fault with graph tracing and suspend-to-ram 2017-05-02 21:19:56 -07:00
head.c
head32.c
head64.c x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y 2017-03-22 12:04:18 +01:00
head_32.S x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
head_64.S KPTI: Rename to PAGE_TABLE_ISOLATION 2018-01-05 15:44:26 +01:00
hpet.c x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
hw_breakpoint.c x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros 2018-06-16 09:54:24 +02:00
i386_ksyms_32.c x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00
i8237.c
i8253.c clockevents/drivers/i8253: Migrate to new 'set-state' interface 2015-08-10 11:40:30 +02:00
i8259.c x86: i8259: export legacy_pic symbol 2018-03-24 10:58:40 +01:00
io_delay.c
ioport.c x86/iopl: Fix iopl capability check on Xen PV 2016-04-12 09:08:38 -07:00
irq.c x86/irq: Do not substract irq_tlb_count from irq_call_count 2017-12-25 14:22:09 +01:00
irq_32.c x86/retpoline/irq32: Convert assembler indirect jumps 2018-01-23 19:50:13 +01:00
irq_64.c x86/irq: Drop unlikely before IS_ERR_OR_NULL 2015-10-01 11:08:56 +02:00
irq_work.c treewide: Remove old email address 2015-11-23 09:44:58 +01:00
irqinit.c KAISER: Kernel Address Isolation 2018-01-05 15:44:23 +01:00
jump_label.c jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} 2015-08-03 11:34:12 +02:00
kdebugfs.c
kexec-bzimage64.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2015-09-08 12:41:25 -07:00
kgdb.c x86/kgdb: Replace bool_int_array[NR_CPUS] with bitmap 2015-09-28 10:13:31 +02:00
ksysfs.c
kvm.c KVM: async_pf: make rcu irq exit if not triggered from idle task 2017-08-11 09:08:47 -07:00
kvmclock.c x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap 2018-01-05 15:44:27 +01:00
ldt.c kaiser: fix unlikely error in alloc_ldt_struct() 2018-01-05 15:44:25 +01:00
livepatch.c livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX 2015-11-06 11:10:03 +01:00
machine_kexec_32.c x86/kexec: Avoid double free_page() upon do_kexec_load() failure 2018-05-26 08:49:01 +02:00
machine_kexec_64.c x86/kexec: Avoid double free_page() upon do_kexec_load() failure 2018-05-26 08:49:01 +02:00
Makefile kexec: split kexec_load syscall from kexec core code 2015-09-10 13:29:01 -07:00
mcount_64.S x86/retpoline/ftrace: Convert ftrace assembler indirect jumps 2018-01-23 19:50:13 +01:00
mmconf-fam10h_64.c
module.c x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 2018-03-18 11:17:52 +01:00
mpparse.c x86: Cleanup irq_domain ops 2015-04-24 15:36:55 +02:00
msr.c x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
nmi.c Merge branch 'x86/urgent' into x86/asm, before applying dependent patches 2015-07-31 10:23:35 +02:00
nmi_selftest.c
paravirt-spinlocks.c locking/pvqspinlock: Rename QUEUED_SPINLOCK to QUEUED_SPINLOCKS 2015-05-11 09:52:09 +02:00
paravirt.c x86/paravirt: Do not trace _paravirt_ident_*() functions 2016-09-24 10:07:37 +02:00
paravirt_patch_32.c x86/asm/tsc, x86/paravirt: Remove read_tsc() and read_tscp() paravirt hooks 2015-07-06 15:23:26 +02:00
paravirt_patch_64.c x86/paravirt: Dont patch flush_tlb_single 2018-01-05 15:44:26 +01:00
pci-calgary_64.c x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0 2017-05-14 13:32:55 +02:00
pci-dma.c mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
pci-iommu_table.c
pci-nommu.c
pci-swiotlb.c x86/swiotlb: Try coherent allocations with __GFP_NOWARN 2015-06-11 08:28:38 +02:00
pcspeaker.c
perf_regs.c perf/x86/64: Report regs_user->ax too in get_regs_user() 2015-04-11 13:08:53 +02:00
pmem.c libnvdimm, e820: skip module loading when no type-12 2015-11-30 09:10:33 -08:00
probe_roms.c
process.c KAISER: Kernel Address Isolation 2018-01-05 15:44:23 +01:00
process_32.c sched/core, sched/x86: Kill thread_info::saved_preempt_count 2015-10-06 17:08:18 +02:00
process_64.c x86/iopl/64: Properly context-switch IOPL on Xen PV 2016-04-12 09:08:38 -07:00
ptrace.c x86/dumpstack: Fix x86_32 kernel_stack_pointer() previous stack access 2016-10-16 17:36:15 +02:00
pvclock.c pvclock: Add CPU barriers to get correct version value 2016-08-10 11:49:27 +02:00
quirks.c timers/x86/hpet: Type adjustments 2015-10-21 11:17:32 +02:00
reboot.c x86/mm/64: Fix reboot interaction with CR4.PCIDE 2018-01-02 20:33:24 +01:00
reboot_fixups_32.c
relocate_kernel_32.S x86/asm: Optimize unnecessarily wide TEST instructions 2015-03-07 11:12:43 +01:00
relocate_kernel_64.S x86/asm: Replace "MOVQ $imm, %reg" with MOVL 2015-04-01 13:17:39 +02:00
resource.c
rtc.c x86/paravirt: Prevent rtc_cmos platform device init on PV guests 2015-12-19 21:35:13 +01:00
setup.c x86/kaiser: Move feature detection up 2018-01-05 15:44:26 +01:00
setup_percpu.c
signal.c x86/signal: Fix restart_syscall number for x32 tasks 2015-12-05 18:52:14 +01:00
signal_compat.c x86/compat: Move copy_siginfo_*_user32() to signal_compat.c 2015-07-06 15:28:55 +02:00
smp.c x86/mce: Clear Local MCE opt-in before kexec 2015-08-13 10:12:52 +02:00
smpboot.c x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros 2018-06-16 09:54:24 +02:00
stacktrace.c
step.c Merge branch 'x86/urgent' into x86/asm to fix up conflicts and to pick up fixes 2015-08-18 09:39:47 +02:00
sys_x86_64.c mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
sysfb.c
sysfb_efi.c x86/sysfb_efi: Fix valid BAR address range check 2016-05-11 11:21:20 +02:00
sysfb_simplefb.c
tboot.c x86/pti: Make unpoison of pgd for trusted boot work for real 2018-02-03 17:04:25 +01:00
tce_64.c
test_nx.c
test_rodata.c treewide: Fix typo in printk messages 2015-03-06 23:05:39 +01:00
time.c x86/asm/entry: Change all 'user_mode_vm()' calls to 'user_mode()' 2015-03-23 11:14:17 +01:00
tls.c
tls.h
topology.c x86: Drop bogus __ref / __refdata annotations 2015-07-20 18:57:20 +02:00
trace_clock.c x86/asm/tsc: Add rdtsc_ordered() and use it in trivial call sites 2015-07-06 15:23:29 +02:00
tracepoint.c kaiser: merged update 2018-01-05 15:44:23 +01:00
traps.c x86/fpu: Fix math emulation in eager fpu mode 2018-06-16 09:54:25 +02:00
tsc.c x86/tsc: Prevent 32bit truncation in calc_hpet_ref() 2018-04-29 07:50:01 +02:00
tsc_msr.c x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO 2016-05-11 11:21:19 +02:00
tsc_sync.c x86/asm/tsc/sync: Use rdtsc_ordered() in check_tsc_warp() and drop extra barriers 2015-07-06 15:23:29 +02:00
uprobes.c uprobes/x86: Fix RIP-relative handling of EVEX-encoded instructions 2016-09-07 08:32:36 +02:00
verify_cpu.S x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
vm86_32.c x86/cpufeature: Replace the old static_cpu_has() with safe variant 2018-07-17 11:31:44 +02:00
vmlinux.lds.S retpoline: Introduce start/end markers of indirect thunk 2018-01-23 19:50:17 +01:00
vsmp_64.c x86: replace __init_or_module with __init in non-modular vsmp_64.c 2015-06-16 14:12:41 -04:00
x86_init.c PCI changes for the v4.2 merge window: 2015-06-23 13:41:24 -07:00
x8664_ksyms_64.c x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00