android_kernel_samsung_msm8976/arch
Andy Lutomirski 04d98e96a0 x86, vdso: Use asm volatile in __getcpu
commit 1ddf0b1b11aa8a90cef6706e935fc31c75c406ba upstream.

In Linux 3.18 and below, GCC hoists the lsl instructions in the
pvclock code all the way to the beginning of __vdso_clock_gettime,
slowing the non-paravirt case significantly.  For unknown reasons,
presumably related to the removal of a branch, the performance issue
is gone as of

e76b027e6408 x86,vdso: Use LSL unconditionally for vgetcpu

but I don't trust GCC enough to expect the problem to stay fixed.

There should be no correctness issue, because the __getcpu calls in
__vdso_vlock_gettime were never necessary in the first place.

Note to stable maintainers: In 3.18 and below, depending on
configuration, gcc 4.9.2 generates code like this:

     9c3:       44 0f 03 e8             lsl    %ax,%r13d
     9c7:       45 89 eb                mov    %r13d,%r11d
     9ca:       0f 03 d8                lsl    %ax,%ebx

This patch won't apply as is to any released kernel, but I'll send a
trivial backported version if needed.

[
 Backported by Andy Lutomirski.  Should apply to all affected
 versions.  This fixes a functionality bug as well as a performance
 bug: buggy kernels can infinite loop in __vdso_clock_gettime on
 affected compilers.  See, for exammple:

 https://bugzilla.redhat.com/show_bug.cgi?id=1178975
]

Fixes: 51c19b4f59 x86: vdso: pvclock gettime support
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-16 06:59:01 -08:00
..
alpha arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
arc arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
arm ARM: sched_clock: Load cycle count after epoch stabilizes 2014-12-16 09:09:43 -08:00
arm64 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
avr32 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
blackfin blackfin updates for Linux 3.10 2013-05-10 07:21:16 -07:00
c6x arch: c6x: mm: include "asm/uaccess.h" to pass compiling 2013-07-21 18:21:29 -07:00
cris arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
frv arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
h8300
hexagon arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
ia64 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
m32r arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
m68k arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
metag arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
microblaze arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
mips MIPS: Loongson: Make platform serial setup always built-in. 2014-12-06 15:05:46 -08:00
mn10300 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
openrisc arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
parisc arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
powerpc powerpc: 32 bit getcpu VDSO function uses 64 bit instructions 2014-12-16 09:09:43 -08:00
s390 groups: Consolidate the setgroups permission checks 2015-01-08 09:58:16 -08:00
score arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
sh arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
sparc sparc64: Fix constraints on swab helpers. 2014-12-06 15:05:46 -08:00
tile arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
um arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
unicore32 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
x86 x86, vdso: Use asm volatile in __getcpu 2015-01-16 06:59:01 -08:00
xtensa arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
.gitignore
Kconfig microblaze: fix clone syscall 2013-08-20 08:43:02 -07:00