[kernel] r18643 - in dists/trunk/linux-2.6/debian: . patches/bugfix/m68k patches/series

Ben Hutchings benh at alioth.debian.org
Sat Jan 28 02:18:48 UTC 2012


Author: benh
Date: Sat Jan 28 02:18:46 2012
New Revision: 18643

Log:
[m68k] Fix assembler constraint to prevent overeager gcc optimisation

Added:
   dists/trunk/linux-2.6/debian/patches/bugfix/m68k/m68k-fix-assembler-constraint-to-prevent-overeager-gcc-optimisation.patch
Modified:
   dists/trunk/linux-2.6/debian/changelog
   dists/trunk/linux-2.6/debian/patches/series/base

Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog	Fri Jan 27 05:01:32 2012	(r18642)
+++ dists/trunk/linux-2.6/debian/changelog	Sat Jan 28 02:18:46 2012	(r18643)
@@ -17,6 +17,7 @@
       behind
   * [alpha] Build with gcc-4.5 (Closes: #657112)
   * aufs: Update to aufs3.2-20120109 (fixes FTBFS on m68k)
+  * [m68k] Fix assembler constraint to prevent overeager gcc optimisation
 
   [ Thorsten Glaser ]
   * [m68k] Use gcc-4.6 like (almost) all other architectures

Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/m68k-fix-assembler-constraint-to-prevent-overeager-gcc-optimisation.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/m68k-fix-assembler-constraint-to-prevent-overeager-gcc-optimisation.patch	Sat Jan 28 02:18:46 2012	(r18643)
@@ -0,0 +1,161 @@
+From 2a3535069e33d8b416f406c159ce924427315303 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab at linux-m68k.org>
+Date: Mon, 9 Jan 2012 15:10:15 +0100
+Subject: m68k: Fix assembler constraint to prevent overeager gcc optimisation
+
+From: Andreas Schwab <schwab at linux-m68k.org>
+
+commit 2a3535069e33d8b416f406c159ce924427315303 upstream.
+
+Passing the address of a variable as an operand to an asm statement
+doesn't mark the value of this variable as used, so gcc may optimize its
+initialisation away.  Fix this by using the "m" constraint instead.
+
+Signed-off-by: Andreas Schwab <schwab at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+
+---
+ arch/m68k/atari/config.c      |    8 ++++----
+ arch/m68k/kernel/process_mm.c |    4 ++--
+ arch/m68k/kernel/process_no.c |    4 ++--
+ arch/m68k/kernel/traps.c      |   36 +++++++++++++++++-------------------
+ arch/m68k/mm/cache.c          |    6 +++---
+ 5 files changed, 28 insertions(+), 30 deletions(-)
+
+--- a/arch/m68k/atari/config.c
++++ b/arch/m68k/atari/config.c
+@@ -414,9 +414,9 @@ void __init config_atari(void)
+ 					 * FDC val = 4 -> Supervisor only */
+ 		asm volatile ("\n"
+ 			"	.chip	68030\n"
+-			"	pmove	%0@,%/tt1\n"
++			"	pmove	%0,%/tt1\n"
+ 			"	.chip	68k"
+-			: : "a" (&tt1_val));
++			: : "m" (tt1_val));
+ 	} else {
+ 	        asm volatile ("\n"
+ 			"	.chip	68040\n"
+@@ -569,10 +569,10 @@ static void atari_reset(void)
+ 			: "d0");
+ 	} else
+ 		asm volatile ("\n"
+-			"	pmove	%0@,%%tc\n"
++			"	pmove	%0,%%tc\n"
+ 			"	jmp	%1@"
+ 			: /* no outputs */
+-			: "a" (&tc_val), "a" (reset_addr));
++			: "m" (tc_val), "a" (reset_addr));
+ }
+ 
+ 
+--- a/arch/m68k/kernel/process_mm.c
++++ b/arch/m68k/kernel/process_mm.c
+@@ -189,8 +189,8 @@ void flush_thread(void)
+ 	current->thread.fs = __USER_DS;
+ 	if (!FPU_IS_EMU)
+ 		asm volatile (".chip 68k/68881\n\t"
+-			      "frestore %0@\n\t"
+-			      ".chip 68k" : : "a" (&zero));
++			      "frestore %0\n\t"
++			      ".chip 68k" : : "m" (zero));
+ }
+ 
+ /*
+--- a/arch/m68k/kernel/process_no.c
++++ b/arch/m68k/kernel/process_no.c
+@@ -163,8 +163,8 @@ void flush_thread(void)
+ #ifdef CONFIG_FPU
+ 	if (!FPU_IS_EMU)
+ 		asm volatile (".chip 68k/68881\n\t"
+-			      "frestore %0@\n\t"
+-			      ".chip 68k" : : "a" (&zero));
++			      "frestore %0\n\t"
++			      ".chip 68k" : : "m" (zero));
+ #endif
+ }
+ 
+--- a/arch/m68k/kernel/traps.c
++++ b/arch/m68k/kernel/traps.c
+@@ -552,13 +552,13 @@ static inline void bus_error030 (struct
+ 
+ #ifdef DEBUG
+ 		asm volatile ("ptestr %3,%2@,#7,%0\n\t"
+-			      "pmove %%psr,%1@"
+-			      : "=a&" (desc)
+-			      : "a" (&temp), "a" (addr), "d" (ssw));
++			      "pmove %%psr,%1"
++			      : "=a&" (desc), "=m" (temp)
++			      : "a" (addr), "d" (ssw));
+ #else
+ 		asm volatile ("ptestr %2,%1@,#7\n\t"
+-			      "pmove %%psr,%0@"
+-			      : : "a" (&temp), "a" (addr), "d" (ssw));
++			      "pmove %%psr,%0"
++			      : "=m" (temp) : "a" (addr), "d" (ssw));
+ #endif
+ 		mmusr = temp;
+ 
+@@ -605,20 +605,18 @@ static inline void bus_error030 (struct
+ 			       !(ssw & RW) ? "write" : "read", addr,
+ 			       fp->ptregs.pc, ssw);
+ 			asm volatile ("ptestr #1,%1@,#0\n\t"
+-				      "pmove %%psr,%0@"
+-				      : /* no outputs */
+-				      : "a" (&temp), "a" (addr));
++				      "pmove %%psr,%0"
++				      : "=m" (temp)
++				      : "a" (addr));
+ 			mmusr = temp;
+ 
+ 			printk ("level 0 mmusr is %#x\n", mmusr);
+ #if 0
+-			asm volatile ("pmove %%tt0,%0@"
+-				      : /* no outputs */
+-				      : "a" (&tlong));
++			asm volatile ("pmove %%tt0,%0"
++				      : "=m" (tlong));
+ 			printk("tt0 is %#lx, ", tlong);
+-			asm volatile ("pmove %%tt1,%0@"
+-				      : /* no outputs */
+-				      : "a" (&tlong));
++			asm volatile ("pmove %%tt1,%0"
++				      : "=m" (tlong));
+ 			printk("tt1 is %#lx\n", tlong);
+ #endif
+ #ifdef DEBUG
+@@ -668,13 +666,13 @@ static inline void bus_error030 (struct
+ 
+ #ifdef DEBUG
+ 	asm volatile ("ptestr #1,%2@,#7,%0\n\t"
+-		      "pmove %%psr,%1@"
+-		      : "=a&" (desc)
+-		      : "a" (&temp), "a" (addr));
++		      "pmove %%psr,%1"
++		      : "=a&" (desc), "=m" (temp)
++		      : "a" (addr));
+ #else
+ 	asm volatile ("ptestr #1,%1@,#7\n\t"
+-		      "pmove %%psr,%0@"
+-		      : : "a" (&temp), "a" (addr));
++		      "pmove %%psr,%0"
++		      : "=m" (temp) : "a" (addr));
+ #endif
+ 	mmusr = temp;
+ 
+--- a/arch/m68k/mm/cache.c
++++ b/arch/m68k/mm/cache.c
+@@ -52,9 +52,9 @@ static unsigned long virt_to_phys_slow(u
+ 		unsigned long *descaddr;
+ 
+ 		asm volatile ("ptestr %3,%2@,#7,%0\n\t"
+-			      "pmove %%psr,%1@"
+-			      : "=a&" (descaddr)
+-			      : "a" (&mmusr), "a" (vaddr), "d" (get_fs().seg));
++			      "pmove %%psr,%1"
++			      : "=a&" (descaddr), "=m" (mmusr)
++			      : "a" (vaddr), "d" (get_fs().seg));
+ 		if (mmusr & (MMU_I|MMU_B|MMU_L))
+ 			return 0;
+ 		descaddr = phys_to_virt((unsigned long)descaddr);

Modified: dists/trunk/linux-2.6/debian/patches/series/base
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/base	Fri Jan 27 05:01:32 2012	(r18642)
+++ dists/trunk/linux-2.6/debian/patches/series/base	Sat Jan 28 02:18:46 2012	(r18643)
@@ -72,3 +72,4 @@
 + features/all/Input-ALPS-add-semi-MT-support-for-v3-protocol.patch
 + bugfix/x86/KVM-nVMX-Add-KVM_REQ_IMMEDIATE_EXIT.patch
 + bugfix/x86/KVM-nVMX-Fix-warning-causing-idt-vectoring-info-beha.patch
++ bugfix/m68k/m68k-fix-assembler-constraint-to-prevent-overeager-gcc-optimisation.patch



More information about the Kernel-svn-changes mailing list