arm64: dts: Revert "specify console via command line"
[linux/fpc-iii.git] / arch / x86 / lib / usercopy.c
blob3f435d7fca5e62bc999e48c6a4f3e1c0fc86def9
1 /*
2 * User address space access functions.
4 * For licencing details see kernel-base/COPYING
5 */
7 #include <linux/uaccess.h>
8 #include <linux/export.h>
10 #include <asm/tlbflush.h>
13 * We rely on the nested NMI work to allow atomic faults from the NMI path; the
14 * nested NMI paths are careful to preserve CR2.
16 unsigned long
17 copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
19 unsigned long ret;
21 if (__range_not_ok(from, n, TASK_SIZE))
22 return n;
24 if (!nmi_uaccess_okay())
25 return n;
28 * Even though this function is typically called from NMI/IRQ context
29 * disable pagefaults so that its behaviour is consistent even when
30 * called form other contexts.
32 pagefault_disable();
33 ret = __copy_from_user_inatomic(to, from, n);
34 pagefault_enable();
36 return ret;
38 EXPORT_SYMBOL_GPL(copy_from_user_nmi);