Patchwork using get/put_user64 apis on 64bit machine

login
register
mail settings
Submitter Bharat Bhushan
Date July 23, 2012, 10:16 a.m.
Message ID <1343038597-23859-1-git-send-email-Bharat.Bhushan@freescale.com>
Download mbox | patch
Permalink /patch/172620/
State Rejected
Headers show

Comments

Bharat Bhushan - July 23, 2012, 10:16 a.m.
On powerpc64 machine get/put_user64() is same as get/put_user() while
on powerpc32 machine get_user64 is different. With this patch we can
use get_user64() and put_user64() on 32 and 64 bit machines.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
 arch/powerpc/include/asm/uaccess.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
Benjamin Herrenschmidt - Sept. 10, 2012, 4:42 a.m.
On Mon, 2012-07-23 at 15:46 +0530, Bharat Bhushan wrote:
> On powerpc64 machine get/put_user64() is same as get/put_user() while
> on powerpc32 machine get_user64 is different. With this patch we can
> use get_user64() and put_user64() on 32 and 64 bit machines.
> 
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---

There appear to be no user of any of these APIs in the tree. There's
also no get_user64 -> __get_user64() macros either. Why not just remove
the whole lot ?

Cheers,
Ben.

>  arch/powerpc/include/asm/uaccess.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
> index 17bb40c..01743aa 100644
> --- a/arch/powerpc/include/asm/uaccess.h
> +++ b/arch/powerpc/include/asm/uaccess.h
> @@ -114,10 +114,17 @@ struct exception_table_entry {
>  #define __put_user(x, ptr) \
>  	__put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
>  
> +/*
> + * On powerpc64 machine get/put_user64() is same as get/put_user() while
> + * on powerpc32 machine get_user64 is different.
> + */
>  #ifndef __powerpc64__
>  #define __get_user64(x, ptr) \
>  	__get_user64_nocheck((x), (ptr), sizeof(*(ptr)))
>  #define __put_user64(x, ptr) __put_user(x, ptr)
> +#else
> +#define __get_user64(x, ptr) __get_user(x, ptr) 
> +#define __put_user64(x, ptr) __put_user(x, ptr)
>  #endif
>  
>  #define __get_user_inatomic(x, ptr) \
Bharat Bhushan - Sept. 10, 2012, 8:50 a.m.
> -----Original Message-----
> From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]
> Sent: Monday, September 10, 2012 10:12 AM
> To: Bhushan Bharat-R65777
> Cc: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org; agraf@suse.de;
> Wood Scott-B07421; Bhushan Bharat-R65777
> Subject: Re: [PATCH] using get/put_user64 apis on 64bit machine
> 
> On Mon, 2012-07-23 at 15:46 +0530, Bharat Bhushan wrote:
> > On powerpc64 machine get/put_user64() is same as get/put_user() while
> > on powerpc32 machine get_user64 is different. With this patch we can
> > use get_user64() and put_user64() on 32 and 64 bit machines.
> >
> > Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> > ---
> 
> There appear to be no user of any of these APIs in the tree. There's also no
> get_user64 -> __get_user64() macros either. Why not just remove the whole lot ?

When I sent the patch I did not search the users, I agree that we can remove the __get_user64 and __put_user64 altogether.

Thanks
-Bharat 

> 
> Cheers,
> Ben.
> 
> >  arch/powerpc/include/asm/uaccess.h |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/uaccess.h
> > b/arch/powerpc/include/asm/uaccess.h
> > index 17bb40c..01743aa 100644
> > --- a/arch/powerpc/include/asm/uaccess.h
> > +++ b/arch/powerpc/include/asm/uaccess.h
> > @@ -114,10 +114,17 @@ struct exception_table_entry {  #define
> > __put_user(x, ptr) \
> >  	__put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
> >
> > +/*
> > + * On powerpc64 machine get/put_user64() is same as get/put_user()
> > +while
> > + * on powerpc32 machine get_user64 is different.
> > + */
> >  #ifndef __powerpc64__
> >  #define __get_user64(x, ptr) \
> >  	__get_user64_nocheck((x), (ptr), sizeof(*(ptr)))  #define
> > __put_user64(x, ptr) __put_user(x, ptr)
> > +#else
> > +#define __get_user64(x, ptr) __get_user(x, ptr) #define
> > +__put_user64(x, ptr) __put_user(x, ptr)
> >  #endif
> >
> >  #define __get_user_inatomic(x, ptr) \
> 
>
Benjamin Herrenschmidt - Sept. 10, 2012, 10:25 p.m.
On Mon, 2012-09-10 at 08:50 +0000, Bhushan Bharat-R65777 wrote:
> When I sent the patch I did not search the users, I agree that we can
> remove the __get_user64 and __put_user64 altogether.

Care to send a patch ?

Cheers,
Ben.

Patch

diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
index 17bb40c..01743aa 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -114,10 +114,17 @@  struct exception_table_entry {
 #define __put_user(x, ptr) \
 	__put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
 
+/*
+ * On powerpc64 machine get/put_user64() is same as get/put_user() while
+ * on powerpc32 machine get_user64 is different.
+ */
 #ifndef __powerpc64__
 #define __get_user64(x, ptr) \
 	__get_user64_nocheck((x), (ptr), sizeof(*(ptr)))
 #define __put_user64(x, ptr) __put_user(x, ptr)
+#else
+#define __get_user64(x, ptr) __get_user(x, ptr) 
+#define __put_user64(x, ptr) __put_user(x, ptr)
 #endif
 
 #define __get_user_inatomic(x, ptr) \