aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/lib/uaccess_mvcos.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/lib/uaccess_mvcos.c')
-rw-r--r--arch/s390/lib/uaccess_mvcos.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/arch/s390/lib/uaccess_mvcos.c b/arch/s390/lib/uaccess_mvcos.c
index 121b2935a422..f9a23d57eb79 100644
--- a/arch/s390/lib/uaccess_mvcos.c
+++ b/arch/s390/lib/uaccess_mvcos.c
@@ -27,6 +27,9 @@
27#define SLR "slgr" 27#define SLR "slgr"
28#endif 28#endif
29 29
30extern size_t copy_from_user_std(size_t, const void __user *, void *);
31extern size_t copy_to_user_std(size_t, void __user *, const void *);
32
30size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x) 33size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x)
31{ 34{
32 register unsigned long reg0 asm("0") = 0x81UL; 35 register unsigned long reg0 asm("0") = 0x81UL;
@@ -66,6 +69,13 @@ size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x)
66 return size; 69 return size;
67} 70}
68 71
72size_t copy_from_user_mvcos_check(size_t size, const void __user *ptr, void *x)
73{
74 if (size <= 256)
75 return copy_from_user_std(size, ptr, x);
76 return copy_from_user_mvcos(size, ptr, x);
77}
78
69size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x) 79size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x)
70{ 80{
71 register unsigned long reg0 asm("0") = 0x810000UL; 81 register unsigned long reg0 asm("0") = 0x810000UL;
@@ -95,6 +105,13 @@ size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x)
95 return size; 105 return size;
96} 106}
97 107
108size_t copy_to_user_mvcos_check(size_t size, void __user *ptr, const void *x)
109{
110 if (size <= 256)
111 return copy_to_user_std(size, ptr, x);
112 return copy_to_user_mvcos(size, ptr, x);
113}
114
98size_t copy_in_user_mvcos(size_t size, void __user *to, const void __user *from) 115size_t copy_in_user_mvcos(size_t size, void __user *to, const void __user *from)
99{ 116{
100 register unsigned long reg0 asm("0") = 0x810081UL; 117 register unsigned long reg0 asm("0") = 0x810081UL;
@@ -145,18 +162,16 @@ size_t clear_user_mvcos(size_t size, void __user *to)
145 return size; 162 return size;
146} 163}
147 164
148extern size_t copy_from_user_std_small(size_t, const void __user *, void *);
149extern size_t copy_to_user_std_small(size_t, void __user *, const void *);
150extern size_t strnlen_user_std(size_t, const char __user *); 165extern size_t strnlen_user_std(size_t, const char __user *);
151extern size_t strncpy_from_user_std(size_t, const char __user *, char *); 166extern size_t strncpy_from_user_std(size_t, const char __user *, char *);
152extern int futex_atomic_op(int, int __user *, int, int *); 167extern int futex_atomic_op(int, int __user *, int, int *);
153extern int futex_atomic_cmpxchg(int __user *, int, int); 168extern int futex_atomic_cmpxchg(int __user *, int, int);
154 169
155struct uaccess_ops uaccess_mvcos = { 170struct uaccess_ops uaccess_mvcos = {
156 .copy_from_user = copy_from_user_mvcos, 171 .copy_from_user = copy_from_user_mvcos_check,
157 .copy_from_user_small = copy_from_user_std_small, 172 .copy_from_user_small = copy_from_user_std,
158 .copy_to_user = copy_to_user_mvcos, 173 .copy_to_user = copy_to_user_mvcos_check,
159 .copy_to_user_small = copy_to_user_std_small, 174 .copy_to_user_small = copy_to_user_std,
160 .copy_in_user = copy_in_user_mvcos, 175 .copy_in_user = copy_in_user_mvcos,
161 .clear_user = clear_user_mvcos, 176 .clear_user = clear_user_mvcos,
162 .strnlen_user = strnlen_user_std, 177 .strnlen_user = strnlen_user_std,