We also need to get rid of verify_area in entry.S
Hi Chris,
In addition to the patch I sent a few minutes ago, there's one last reference to verify_area left in xtensa. It's in arch/xtensa/kernel/entry.S, and I'm going to need your help to get rid of that one since that code is over my head and I assume that the naive approach below would just break it :
arch/xtensa/kernel/entry.S +1 -1
@@ -1102,7 +1102,7 @@ ENTRY(fast_syscall_sysxtensa) s32i a7, a2, PT_AREG7 movi a7, 4 # sizeof(unsigned int) - verify_area a3, a7, a0, a2, .Leac + access_ok a3, a7, a0, a2, .Leac _beqi a6, SYSXTENSA_ATOMIC_SET, .Lset _beqi a6, SYSXTENSA_ATOMIC_EXG_ADD, .Lexg
So, could you come up with a working patch and push it to Andrew along with the one I sent a little while ago, so I can push my verify_area removal patches? Or you can just sign off on my previous patch if it's OK, and send me one for entry.S and then I'll push the entire thing onwards if you prefer that. Thanks in advance.
Signature · 1 line
Jesper Juhl
Jesper,
Thanks for the patches. I'll take a look at the entry.S one and will pass it along to Andres, and will incorporate the signal.c patch.
I am currently working on the system call interface and am removing the non-rt signal calls, so the signal.c patch probably doesn't apply cleanly anymore.
Thanks,
~Chris
Quoted 3 lines · Jesper Juhl
In addition to the patch I sent a few minutes ago, there's one last reference
toverify_arealeft in xtensa. It's inarch/xtensa/kernel/entry.S, and I'm going to need your help to get rid of that one since that code is over my head and I assume that the naive approach below would just break it :
Quoted 5 lines · Chris Zankel
Jesper,
Thanks for the patches. I'll take a look at the
entry.Sone and will pass it along to Andres, and will incorporate thesignal.cpatch.
Thank you.
I was originally planning to submit a single patch that removes verify_area across the board, but I guess it might be easier if I just hand you the bit of the patch that handles xtensa (instead of waiting for those bits to hit -mm) and then submit the rest along with a note that similar patches for xtensa will arrive later via you.
So, here's the final bit that removes verify_area completely from xtensa :
---
include/asm-xtensa/checksum.h +1 -1
@@ -45,7 +45,7 @@ asmlinkage unsigned int csum_partial_cop* passed in an incorrect kernel address to one of these functions. * * If you use these functions directly please don't forget the -* verify_area(). +* access_ok(). */ extern __inline__ unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
include/asm-xtensa/uaccess.h +0 -34
@@ -154,35 +154,6 @@ .Laccess_ok_\@: .endm -/* -* verify_area determines whether a memory access is allowed. It's -* mostly an unnecessary wrapper for access_ok, but we provide it as a -* duplicate of the verify_area() C inline function below. See the -* equivalent C version below for clarity. -* -* On error, verify_area branches to a label indicated by parameter -* <error>. This implies that the macro falls through to the next -* instruction on success. -* -* Note that we assume success is the common case, and we optimize the -* branch fall-through case on success. -* -* On Entry: -* <aa> register containing memory address -* <as> register containing memory size -* <at> temp register -* <error> label to branch to on error; implies fall-through -* macro on success -* On Exit: -* <aa> preserved -* <as> preserved -* <at> destroyed -*/ - .macro verify_area aa, as, at, sp, error - access_ok \at, \aa, \as, \sp, \error - .endm - -#else /* __ASSEMBLY__ not defined */ #include <linux/sched.h>
@@ -211,11 +182,6 @@#define __access_ok (addr,size) (__kernel_ok || __user_ok((addr),(size)))#define access_ok (type,addr,size) __access_ok((unsigned long)(addr),(size)) -extern inline int verify_area (int type,const void * addr,unsigned long size) -{ -return access_ok (type,addr,size) ?0 : -EFAULT ; -} -/* * These are the main single-value transfer routines. They * automatically use the right size if we just have the right pointer
Quoted 6 lines · Jesper Juhl
Quoted 5 lines · Chris Zankel
Jesper,
Thanks for the patches. I'll take a look at the
entry.Sone and will pass it along to Andres, and will incorporate thesignal.cpatch.
Hi Chris,
Following up on an old mail...
verify_area() is still alive on xtensa in 2.6.17-rc3-git13 :-( Do you have any plans to get rid of it? Are the original patches I send still useful? Should I create new patches?
It would be nice to finally be rid of that function across the board. Xtensa is the only user left and verify_area() comletely relaces it, so let's get rid of the cruft - no?
/Jesper
Quoted 68 lines
Thank you.
I was originally planning to submit a single patch that removes
verify_areaacross the board, but I guess it might be easier if I just hand you the bit of the patch that handles xtensa (instead of waiting for those bits to hit -mm) and then submit the rest along with a note that similar patches for xtensa will arrive later via you.So, here's the final bit that removes
verify_areacompletely from xtensa :Signed-off-by Jesper Juhl <[email protected]>---
diff -upr -X ./linux-2.6.13/Documentation/dontdiff
linux-2.6.13-orig/include/asm-xtensa/checksum.hlinux-2.6.13/include/asm-xtensa/checksum.hinclude/asm-xtensa/checksum.h 2005-08-29 03:46:34.000000000 +0200 renamed from include/asm-xtensa/checksum.h 2005-08-29 01:41:01.000000000 +0200 +1
-1@@ -45,7 +45,7 @@ asmlinkage unsigned int csum_partial_cop * passed in an incorrect kernel address to one of these functions. * * If you use these functions directly please don't forget the - * verify_area(). + * access_ok(). */ extern __inline__ unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,diff -upr -X ./linux-2.6.13/Documentation/dontdiff
linux-2.6.13-orig/include/asm-xtensa/uaccess.hlinux-2.6.13/include/asm-xtensa/uaccess.hinclude/asm-xtensa/uaccess.h 2005-08-29 03:47:18.000000000 +0200 renamed from include/asm-xtensa/uaccess.h 2005-08-29 01:41:01.000000000 +0200 +0
-29@@ -154,35 +154,6 @@ .Laccess_ok_\@: .endm -/* - * verify_area determines whether a memory access is allowed. It's - * mostly an unnecessary wrapper for access_ok, but we provide it as a - * duplicate of the verify_area() C inline function below. See the - * equivalent C version below for clarity. - * - * On error, verify_area branches to a label indicated by parameter - * <error>. This implies that the macro falls through to the next - * instruction on success. - * - * Note that we assume success is the common case, and we optimize the - * branch fall-through case on success. - * - * On Entry: - * <aa> register containing memory address - * <as> register containing memory size - * <at> temp register - * <error> label to branch to on error; implies fall-through - * macro on success - * On Exit: - * <aa> preserved - * <as> preserved - * <at> destroyed - */ - .macro verify_area aa, as, at, sp, error - access_ok \at, \aa, \as, \sp, \error - .endm - - #else /* __ASSEMBLY__ not defined */ #include <linux/sched.h>@@ -211,11 +182,6 @@ #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
include/asm-xtensa/uaccess.h 2005-08-29 03:47:18.000000000 +0200 line 187
Quoted 10 lines
include/asm-xtensa/uaccess.h 2005-08-29 03:47:18.000000000 +0200 renamed from include/asm-xtensa/uaccess.h 2005-08-29 01:41:01.000000000 +0200 +0
-5#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) -extern inline int verify_area(int type, const void * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * These are the main single-value transfer routines. They * automatically use the right size if we just have the right pointer
--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html