2001-12-22 16:57:24

by Frank Cornelis

[permalink] [raw]
Subject: earlyclobber

Hi,

I think that in the file include/asm-i386/uaccess.h in some macro's the
ecx register should be marked as an "earlyclobber" operand since it is
one. Patch follows.

Frank.

--- linux-2.4.17/include/asm-i386/uaccess.h Sat Dec 22 09:35:17 2001
+++ linux/include/asm-i386/uaccess.h Sat Dec 22 17:32:14 2001
@@ -151,7 +151,7 @@
({ \
long __pu_err = -EFAULT; \
__typeof__(*(ptr)) *__pu_addr = (ptr); \
- if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
+ if (access_ok(VERIFY_WRITE,__pu_addr,(size))) \
__put_user_size((x),__pu_addr,(size),__pu_err); \
__pu_err; \
})
@@ -337,7 +337,7 @@
" .align 4\n" \
" .long 0b,2b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -356,7 +356,7 @@
" .long 0b,3b\n" \
" .long 1b,4b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -375,7 +375,7 @@
" .long 0b,3b\n" \
" .long 1b,4b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -397,7 +397,7 @@
" .long 1b,5b\n" \
" .long 2b,6b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -427,7 +427,7 @@
" .align 4\n" \
" .long 0b,2b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -459,7 +459,7 @@
" .long 0b,3b\n" \
" .long 1b,4b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -491,7 +491,7 @@
" .long 0b,3b\n" \
" .long 1b,4b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \
@@ -533,7 +533,7 @@
" .long 1b,5b\n" \
" .long 2b,6b\n" \
".previous" \
- : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
+ : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
break; \


2001-12-23 10:08:45

by Frank Cornelis

[permalink] [raw]
Subject: Re: earlyclobber


> > I think that in the file include/asm-i386/uaccess.h in some macro's the
> > ecx register should be marked as an "earlyclobber" operand since it is
> > one. Patch follows.
>
> How did you notice it?

By simply reading through the source code. It's so much more exciting than
reading a book and it gets me to sleep in no time :)

Frank.

2001-12-23 14:20:29

by Roman Zippel

[permalink] [raw]
Subject: Re: earlyclobber

Hi,

Frank Cornelis wrote:

> I think that in the file include/asm-i386/uaccess.h in some macro's the
> ecx register should be marked as an "earlyclobber" operand since it is
> one. Patch follows.
>
> Frank.
>
> @@ -337,7 +337,7 @@
> " .align 4\n" \
> " .long 0b,2b\n" \
> ".previous" \
> - : "=c"(size), "=&S" (__d0), "=&D" (__d1)\
> + : "=&c"(size), "=&S" (__d0), "=&D" (__d1)\
> : "1"(from), "2"(to), "0"(size/4) \
> : "memory"); \
> break; \

This isn't needed, as there is no input operand to which it could be
assigned to.

bye, Roman