2 * User address space access functions.
4 * For licencing details see kernel-base/COPYING
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.
17 copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
21 if (__range_not_ok(from, n, TASK_SIZE))
24 if (!nmi_uaccess_okay())
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.
33 ret = __copy_from_user_inatomic(to, from, n);
38 EXPORT_SYMBOL_GPL(copy_from_user_nmi);