From: Jiri Slaby <jslaby@suse.cz>
To: mingo@elte.hu
Cc: jirislaby@gmail.com, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Subject: [PATCH 1/1] X86: use explicit register name for get/put_user
Date: Sun, 6 Dec 2009 10:30:08 +0100 [thread overview]
Message-ID: <1260091808-8053-1-git-send-email-jslaby@suse.cz> (raw)
I couldn't find any traces of documentation for the behavior used
in current get/put_user implementation. After the merge of
32/64-bit version there is back register reference ("0") to the
output register ("a"). The output is retval of int type, but
the value in the input may be a long on 64-bit.
I don't know if this could ever cause any problems, but changing
the input to an explicit register ("a") makes it cleaner in my eyes.
There is no need of the back reference.
Change this for both get and put_user.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
---
arch/x86/include/asm/uaccess.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index abd3e0e..35f483b 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -122,7 +122,7 @@ extern int __get_user_bad(void);
#define __get_user_x(size, ret, x, ptr) \
asm volatile("call __get_user_" #size \
: "=a" (ret), "=d" (x) \
- : "0" (ptr)) \
+ : "a" (ptr)) \
/* Careful: we have to cast the result to the type of the pointer
* for sign reasons */
@@ -181,7 +181,7 @@ extern int __get_user_bad(void);
#define __put_user_x(size, x, ptr, __ret_pu) \
asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
- : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
+ : "a" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
--
1.6.5.3
next reply other threads:[~2009-12-06 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 9:30 Jiri Slaby [this message]
2009-12-06 19:11 ` H. Peter Anvin
2009-12-07 12:37 ` Jiri Slaby
2009-12-07 18:35 ` H. Peter Anvin
2009-12-09 20:03 ` Jiri Slaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1260091808-8053-1-git-send-email-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=hpa@zytor.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®