summaryrefslogtreecommitdiff
path: root/include/asm-x86/uaccess_64.h
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2008-09-10 13:37:17 +0200
committerIngo Molnar <mingo@elte.hu>2008-09-11 09:44:21 +0200
commit3ee1afa308f2a38e5d1e2ad3752ad7abcf480da1 (patch)
tree914e0f3bbd32a387cf6095c6955369fa8da7ebf6 /include/asm-x86/uaccess_64.h
parentc10d38dda1774ed4540380333cabd229eff37094 (diff)
downloadlwn-3ee1afa308f2a38e5d1e2ad3752ad7abcf480da1.tar.gz
lwn-3ee1afa308f2a38e5d1e2ad3752ad7abcf480da1.zip
x86: some lock annotations for user copy paths, v2
- introduce might_fault() - handle the atomic user copy paths correctly [ mingo@elte.hu: move might_sleep() outside of in_atomic(). ] Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/uaccess_64.h')
-rw-r--r--include/asm-x86/uaccess_64.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 40a7205fe576..13fd56fbc3ab 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -29,9 +29,7 @@ int __copy_from_user(void *dst, const void __user *src, unsigned size)
{
int ret = 0;
- might_sleep();
- if (current->mm)
- might_lock_read(&current->mm->mmap_sem);
+ might_fault();
if (!__builtin_constant_p(size))
return copy_user_generic(dst, (__force void *)src, size);
switch (size) {
@@ -75,9 +73,7 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
{
int ret = 0;
- might_sleep();
- if (current->mm)
- might_lock_read(&current->mm->mmap_sem);
+ might_fault();
if (!__builtin_constant_p(size))
return copy_user_generic((__force void *)dst, src, size);
switch (size) {
@@ -121,9 +117,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
{
int ret = 0;
- might_sleep();
- if (current->mm)
- might_lock_read(&current->mm->mmap_sem);
+ might_fault();
if (!__builtin_constant_p(size))
return copy_user_generic((__force void *)dst,
(__force void *)src, size);