All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] incorrect asm constraints for ll/sc constructs
@ 2001-05-23 21:52 Daniel Jacobowitz
  2001-05-24 13:42 ` Maciej W. Rozycki
  0 siblings, 1 reply; 20+ messages in thread
From: Daniel Jacobowitz @ 2001-05-23 21:52 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

The ll/sc constructs in the kernel use ".set noat" to inhibit use of $at,
and proceed to use it themselves.  This is fine, except for one problem: the
constraints on memory operands are "o" and "=o", which means offsettable
memory references.  If I'm not mistaken, the assembler will (always?)
turn these into uses of $at if the offset is not 0 - at least, it certainly
seems to do that here (gcc 2.95.3, binutils 2.10.91.0.2).  Just being honest
with the compiler and asking for a real memory reference does the trick. 
Does this patch look right?

-- 
Daniel Jacobowitz                           Debian GNU/Linux Developer
Monta Vista Software                              Debian Security Team

[-- Attachment #2: mips-offset.diff --]
[-- Type: text/plain, Size: 1172 bytes --]

Index: arch/mips/kernel/sysmips.c
===================================================================
RCS file: /cvs/linux/arch/mips/kernel/sysmips.c,v
retrieving revision 1.18
diff -u -r1.18 sysmips.c
--- arch/mips/kernel/sysmips.c	2001/04/08 13:24:27	1.18
+++ arch/mips/kernel/sysmips.c	2001/05/23 21:49:29
@@ -99,8 +99,8 @@
 			".word\t1b, 3b\n\t"
 			".word\t2b, 3b\n\t"
 			".previous\n\t"
-			: "=&r" (tmp), "=o" (* (u32 *) p), "=r" (errno)
-			: "r" (arg2), "o" (* (u32 *) p), "2" (errno)
+			: "=&r" (tmp), "=m" (* (u32 *) p), "=r" (errno)
+			: "r" (arg2), "m" (* (u32 *) p), "2" (errno)
 			: "$1");
 
 		if (errno)
Index: include/asm-mips/system.h
===================================================================
RCS file: /cvs/linux/include/asm-mips/system.h,v
retrieving revision 1.27
diff -u -r1.27 system.h
--- include/asm-mips/system.h	2001/03/28 01:35:12	1.27
+++ include/asm-mips/system.h	2001/05/23 21:49:29
@@ -219,8 +219,8 @@
 		" ll\t%0, %3\n\t"
 		".set\tat\n\t"
 		".set\treorder"
-		: "=r" (val), "=o" (*m), "=r" (dummy)
-		: "o" (*m), "2" (val)
+		: "=r" (val), "=m" (*m), "=r" (dummy)
+		: "m" (*m), "2" (val)
 		: "memory");
 
 	return val;

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2001-05-30  8:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-23 21:52 [PATCH] incorrect asm constraints for ll/sc constructs Daniel Jacobowitz
2001-05-24 13:42 ` Maciej W. Rozycki
2001-05-24 23:44   ` Daniel Jacobowitz
2001-05-25 13:13     ` Maciej W. Rozycki
2001-05-25 21:15       ` Kevin D. Kissell
2001-05-25 21:15         ` Kevin D. Kissell
2001-05-25 21:49         ` Daniel Jacobowitz
2001-05-26 22:14           ` Kevin D. Kissell
2001-05-26 22:14             ` Kevin D. Kissell
2001-05-26 22:23             ` Ralf Baechle
2001-05-28 11:20             ` Maciej W. Rozycki
2001-05-28 13:48               ` Kevin D. Kissell
2001-05-28 13:48                 ` Kevin D. Kissell
2001-05-28 13:59                 ` Maciej W. Rozycki
2001-05-25 20:27   ` Ralf Baechle
2001-05-25 20:49     ` Daniel Jacobowitz
2001-05-28 11:09       ` Maciej W. Rozycki
2001-05-30  0:17       ` Daniel Jacobowitz
2001-05-30  7:02         ` Kevin D. Kissell
2001-05-30  7:02           ` Kevin D. Kissell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.