From: Sergey Matyukevich <sergey.matyukev...@synopsys.com>

Implement the non-faulting kernel access helpers directly
instead of using uaccess routines under set_fs(KERNEL_DS).

Signed-off-by: Sergey Matyukevich <sergey.matyukev...@synopsys.com>
---
 arch/arc/include/asm/uaccess.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h
index 9d1205bf90f1..c14b692a0a4e 100644
--- a/arch/arc/include/asm/uaccess.h
+++ b/arch/arc/include/asm/uaccess.h
@@ -657,6 +657,28 @@ static inline unsigned long __arc_clear_user(void __user 
*to, unsigned long n)
        return res;
 }
 
+#define HAVE_GET_KERNEL_NOFAULT
+
+#define __get_kernel_nofault(dst, src, type, err_label)                        
\
+       do {                                                            \
+               long __err;                                             \
+                                                                       \
+               __err = __get_user_fn(sizeof(type), (type *)(src),      \
+                                     (type *)(dst));                   \
+               if (unlikely(__err))                                    \
+                       goto err_label;                                 \
+       } while (0)
+
+#define __put_kernel_nofault(dst, src, type, err_label)                        
\
+       do {                                                            \
+               long __err;                                             \
+                                                                       \
+               __err = __put_user_fn(sizeof(type), (type *)(dst),      \
+                                     (type *)(src));                   \
+               if (unlikely(__err))                                    \
+                       goto err_label;                                 \
+       } while (0)
+
 #ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
 
 #define INLINE_COPY_TO_USER
-- 
2.35.0


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Reply via email to