diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-11-23 03:04:05 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-11-23 03:04:05 -0500 |
commit | 92907cbbef8625bb3998d1eb385fc88f23c97a3f (patch) | |
tree | 15626ff9287e37c3cb81c7286d6db5a7fd77c854 /include/linux/uaccess.h | |
parent | 15fbfccfe92c62ae8d1ecc647c44157ed01ac02e (diff) | |
parent | 1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff) |
Merge tag 'v4.4-rc2' into drm-intel-next-queued
Linux 4.4-rc2
Backmerge to get at
commit 1b0e3a049efe471c399674fd954500ce97438d30
Author: Imre Deak <imre.deak@intel.com>
Date: Thu Nov 5 23:04:11 2015 +0200
drm/i915/skl: disable display side power well support for now
so that we can proplery re-eanble skl power wells in -next.
Conflicts are just adjacent lines changed, except for intel_fbdev.c
where we need to interleave the changs. Nothing nefarious.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/linux/uaccess.h')
-rw-r--r-- | include/linux/uaccess.h | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index d6f2c2c5b043..558129af828a 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -75,36 +75,6 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
75 | 75 | ||
76 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ | 76 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ |
77 | 77 | ||
78 | /** | ||
79 | * probe_kernel_address(): safely attempt to read from a location | ||
80 | * @addr: address to read from - its type is type typeof(retval)* | ||
81 | * @retval: read into this variable | ||
82 | * | ||
83 | * Safely read from address @addr into variable @revtal. If a kernel fault | ||
84 | * happens, handle that and return -EFAULT. | ||
85 | * We ensure that the __get_user() is executed in atomic context so that | ||
86 | * do_page_fault() doesn't attempt to take mmap_sem. This makes | ||
87 | * probe_kernel_address() suitable for use within regions where the caller | ||
88 | * already holds mmap_sem, or other locks which nest inside mmap_sem. | ||
89 | * This must be a macro because __get_user() needs to know the types of the | ||
90 | * args. | ||
91 | * | ||
92 | * We don't include enough header files to be able to do the set_fs(). We | ||
93 | * require that the probe_kernel_address() caller will do that. | ||
94 | */ | ||
95 | #define probe_kernel_address(addr, retval) \ | ||
96 | ({ \ | ||
97 | long ret; \ | ||
98 | mm_segment_t old_fs = get_fs(); \ | ||
99 | \ | ||
100 | set_fs(KERNEL_DS); \ | ||
101 | pagefault_disable(); \ | ||
102 | ret = __copy_from_user_inatomic(&(retval), (__force typeof(retval) __user *)(addr), sizeof(retval)); \ | ||
103 | pagefault_enable(); \ | ||
104 | set_fs(old_fs); \ | ||
105 | ret; \ | ||
106 | }) | ||
107 | |||
108 | /* | 78 | /* |
109 | * probe_kernel_read(): safely attempt to read from a location | 79 | * probe_kernel_read(): safely attempt to read from a location |
110 | * @dst: pointer to the buffer that shall take the data | 80 | * @dst: pointer to the buffer that shall take the data |
@@ -131,4 +101,14 @@ extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size | |||
131 | 101 | ||
132 | extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count); | 102 | extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count); |
133 | 103 | ||
104 | /** | ||
105 | * probe_kernel_address(): safely attempt to read from a location | ||
106 | * @addr: address to read from | ||
107 | * @retval: read into this variable | ||
108 | * | ||
109 | * Returns 0 on success, or -EFAULT. | ||
110 | */ | ||
111 | #define probe_kernel_address(addr, retval) \ | ||
112 | probe_kernel_read(&retval, addr, sizeof(retval)) | ||
113 | |||
134 | #endif /* __LINUX_UACCESS_H__ */ | 114 | #endif /* __LINUX_UACCESS_H__ */ |