ia64/xen-unstable

changeset 6327:21d2b0144306

Ensure that 64-bit get_user/put_user only transfer to
a 64-bit local variable. Some gcc versions have bugs
if this restriction isn't observed.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Aug 22 09:52:06 2005 +0000 (2005-08-22)
parents f6aa23148c19
children d8fd24b43080
files xen/include/asm-x86/x86_32/uaccess.h
line diff
     1.1 --- a/xen/include/asm-x86/x86_32/uaccess.h	Mon Aug 22 09:43:58 2005 +0000
     1.2 +++ b/xen/include/asm-x86/x86_32/uaccess.h	Mon Aug 22 09:52:06 2005 +0000
     1.3 @@ -22,7 +22,11 @@
     1.4  #define array_access_ok(addr,count,size) \
     1.5      (likely(count < (~0UL/size)) && access_ok(addr,count*size))
     1.6  
     1.7 +/* Undefined function to catch size mismatches on 64-bit get_user/put_user. */
     1.8 +extern void __uaccess_var_not_u64(void);
     1.9 +
    1.10  #define __put_user_u64(x, addr, retval, errret)			\
    1.11 +	if (sizeof(x) != 8) __uaccess_var_not_u64();		\
    1.12  	__asm__ __volatile__(					\
    1.13  		"1:	movl %%eax,0(%2)\n"			\
    1.14  		"2:	movl %%edx,4(%2)\n"			\
    1.15 @@ -52,6 +56,7 @@ do {									\
    1.16  } while (0)
    1.17  
    1.18  #define __get_user_u64(x, addr, retval, errret)			\
    1.19 +	if (sizeof(x) != 8) __uaccess_var_not_u64();		\
    1.20  	__asm__ __volatile__(					\
    1.21  		"1:	movl 0(%2),%%eax\n"			\
    1.22  		"2:	movl 4(%2),%%edx\n"			\