[kernel] r22272 - in dists/wheezy-backports/linux/debian: . patches patches/bugfix/x86

Ben Hutchings benh at moszumanska.debian.org
Fri Jan 16 05:48:27 UTC 2015


Author: benh
Date: Fri Jan 16 05:48:27 2015
New Revision: 22272

Log:
[x86] vdso: Use asm volatile in __getcpu (workaround for gcc bug)

This patch has not yet made it into 3.16.7-ckt and is not needed in sid
since we have a fixed version of gcc.

Added:
   dists/wheezy-backports/linux/debian/patches/bugfix/x86/x86-vdso-use-asm-volatile-in-__getcpu.patch
Modified:
   dists/wheezy-backports/linux/debian/changelog
   dists/wheezy-backports/linux/debian/patches/series

Modified: dists/wheezy-backports/linux/debian/changelog
==============================================================================
--- dists/wheezy-backports/linux/debian/changelog	Fri Jan 16 03:13:28 2015	(r22271)
+++ dists/wheezy-backports/linux/debian/changelog	Fri Jan 16 05:48:27 2015	(r22272)
@@ -7,6 +7,7 @@
     - [arm] btrfs: Work around bug in gcc-4.6 (fixes FTBFS)
     - linux-image: Add versioned Breaks for dracut so that aptitude will
       not switch from initramfs-tools to dracut (Closes: #771379)
+    - [x86] vdso: Use asm volatile in __getcpu (workaround for gcc bug)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Fri, 16 Jan 2015 03:06:29 +0000
 

Added: dists/wheezy-backports/linux/debian/patches/bugfix/x86/x86-vdso-use-asm-volatile-in-__getcpu.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/wheezy-backports/linux/debian/patches/bugfix/x86/x86-vdso-use-asm-volatile-in-__getcpu.patch	Fri Jan 16 05:48:27 2015	(r22272)
@@ -0,0 +1,62 @@
+From: Andy Lutomirski <luto at amacapital.net>
+Date: Tue, 13 Jan 2015 14:44:09 -0800
+Subject: [PATCH backport] x86, vdso: Use asm volatile in __getcpu
+Origin: http://article.gmane.org/gmane.linux.kernel.stable/120223
+
+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: 51c19b4f5927 x86: vdso: pvclock gettime support
+Cc: stable at vger.kernel.org # 3.8+
+Cc: Marcelo Tosatti <mtosatti at redhat.com>
+Acked-by: Paolo Bonzini <pbonzini at redhat.com>
+Signed-off-by: Andy Lutomirski <luto at amacapital.net>
+
+Conflicts:
+	arch/x86/include/asm/vgtod.h
+---
+ arch/x86/include/asm/vsyscall.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/include/asm/vsyscall.h
++++ b/arch/x86/include/asm/vsyscall.h
+@@ -34,7 +34,7 @@ static inline unsigned int __getcpu(void
+ 		native_read_tscp(&p);
+ 	} else {
+ 		/* Load per CPU data from GDT */
+-		asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
++		asm volatile ("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
+ 	}
+ 
+ 	return p;

Modified: dists/wheezy-backports/linux/debian/patches/series
==============================================================================
--- dists/wheezy-backports/linux/debian/patches/series	Fri Jan 16 03:13:28 2015	(r22271)
+++ dists/wheezy-backports/linux/debian/patches/series	Fri Jan 16 05:48:27 2015	(r22272)
@@ -489,3 +489,4 @@
 debian/userns-fix-abi-change-in-3.16.7-ckt4.patch
 bugfix/all/netfilter-conntrack-disable-generic-tracking-for-kno.patch
 bugfix/x86/x86_64-vdso-fix-the-vdso-address-randomization-algor.patch
+bugfix/x86/x86-vdso-use-asm-volatile-in-__getcpu.patch



More information about the Kernel-svn-changes mailing list