From: "tip-bot for Michael S. Tsirkin" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
a.p.zijlstra@chello.nl, torvalds@linux-foundation.org,
mst@redhat.com, peterz@infradead.org, akpm@linux-foundation.org,
tglx@linutronix.de
Subject: [tip:sched/mm] asm-generic: uaccess s/might_sleep/might_fault/
Date: Tue, 28 May 2013 06:14:23 -0700 [thread overview]
Message-ID: <tip-e0acd0bd0594161be44c054bb6b984972f444beb@git.kernel.org> (raw)
In-Reply-To: <1369577426-26721-1-git-send-email-mst@redhat.com>
Commit-ID: e0acd0bd0594161be44c054bb6b984972f444beb
Gitweb: http://git.kernel.org/tip/e0acd0bd0594161be44c054bb6b984972f444beb
Author: Michael S. Tsirkin <mst@redhat.com>
AuthorDate: Sun, 26 May 2013 17:30:36 +0300
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 28 May 2013 09:41:05 +0200
asm-generic: uaccess s/might_sleep/might_fault/
The only reason uaccess routines might sleep
is if they fault. Make this explicit.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1369577426-26721-1-git-send-email-mst@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/asm-generic/uaccess.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index c184aa8..dc1269c 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to,
#define put_user(x, ptr) \
({ \
- might_sleep(); \
+ might_fault(); \
access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \
__put_user(x, ptr) : \
-EFAULT; \
@@ -225,7 +225,7 @@ extern int __put_user_bad(void) __attribute__((noreturn));
#define get_user(x, ptr) \
({ \
- might_sleep(); \
+ might_fault(); \
access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \
__get_user(x, ptr) : \
-EFAULT; \
@@ -255,7 +255,7 @@ extern int __get_user_bad(void) __attribute__((noreturn));
static inline long copy_from_user(void *to,
const void __user * from, unsigned long n)
{
- might_sleep();
+ might_fault();
if (access_ok(VERIFY_READ, from, n))
return __copy_from_user(to, from, n);
else
@@ -265,7 +265,7 @@ static inline long copy_from_user(void *to,
static inline long copy_to_user(void __user *to,
const void *from, unsigned long n)
{
- might_sleep();
+ might_fault();
if (access_ok(VERIFY_WRITE, to, n))
return __copy_to_user(to, from, n);
else
@@ -336,7 +336,7 @@ __clear_user(void __user *to, unsigned long n)
static inline __must_check unsigned long
clear_user(void __user *to, unsigned long n)
{
- might_sleep();
+ might_fault();
if (!access_ok(VERIFY_WRITE, to, n))
return n;
next prev parent reply other threads:[~2013-05-28 13:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-26 14:21 [PATCH v3-resend 00/11] uaccess: better might_sleep/might_fault behavior Michael S. Tsirkin
2013-05-26 14:30 ` [PATCH v3-resend 01/11] asm-generic: uaccess s/might_sleep/might_fault/ Michael S. Tsirkin
2013-05-28 13:14 ` tip-bot for Michael S. Tsirkin [this message]
2013-05-26 14:30 ` [PATCH v3-resend 02/11] arm64: " Michael S. Tsirkin
2013-05-28 13:15 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:30 ` [PATCH v3-resend 03/11] frv: " Michael S. Tsirkin
2013-05-28 13:16 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:30 ` [PATCH v3-resend 04/11] m32r: " Michael S. Tsirkin
2013-05-28 13:18 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:30 ` [PATCH v3-resend 05/11] microblaze: " Michael S. Tsirkin
2013-05-28 13:19 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:31 ` [PATCH v3-resend 06/11] mn10300: " Michael S. Tsirkin
2013-05-28 13:20 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:31 ` [PATCH v3-resend 07/11] powerpc: " Michael S. Tsirkin
2013-05-27 9:36 ` Benjamin Herrenschmidt
2013-05-28 13:22 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:31 ` [PATCH v3-resend 08/11] tile: " Michael S. Tsirkin
2013-05-28 13:23 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:31 ` [PATCH v3-resend 09/11] x86: " Michael S. Tsirkin
2013-05-28 13:24 ` [tip:sched/mm] " tip-bot for Michael S. Tsirkin
2013-05-26 14:32 ` [PATCH v3-resend 10/11] kernel: drop voluntary schedule from might_fault Michael S. Tsirkin
2013-05-28 13:25 ` [tip:sched/mm] mm, sched: Drop voluntary schedule from might_fault() tip-bot for Michael S. Tsirkin
2013-05-26 14:32 ` [PATCH v3-resend 11/11] kernel: uaccess in atomic with pagefault_disable Michael S. Tsirkin
2013-05-28 13:27 ` [tip:sched/mm] mm, sched: Allow uaccess in atomic with pagefault_disable() tip-bot for Michael S. Tsirkin
2013-05-27 16:35 ` [PATCH v3-resend 00/11] uaccess: better might_sleep/might_fault behavior Peter Zijlstra
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=tip-e0acd0bd0594161be44c054bb6b984972f444beb@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mst@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).