s390/uaccess: get rid of indirect function calls

There are only two uaccess variants on s390 left: the version that is used
if the mvcos instruction is available, and the page table walk variant.
So there is no need for expensive indirect function calls.

By default the mvcos variant will be called. If the mvcos instruction is not
available it will call the page table walk variant.

For minimal performance impact the "if (mvcos_is_available)" is implemented
with a jump label, which will be a six byte nop on machines with mvcos.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Heiko Carstens 2014-01-23 11:18:36 +01:00 committed by Martin Schwidefsky
commit 4f41c2b456
7 changed files with 152 additions and 149 deletions

View file

@ -6,7 +6,11 @@
#ifndef __ARCH_S390_LIB_UACCESS_H
#define __ARCH_S390_LIB_UACCESS_H
extern int futex_atomic_op_pt(int, u32 __user *, int, int *);
extern int futex_atomic_cmpxchg_pt(u32 *, u32 __user *, u32, u32);
size_t copy_from_user_pt(void *to, const void __user *from, size_t n);
size_t copy_to_user_pt(void __user *to, const void *from, size_t n);
size_t copy_in_user_pt(void __user *to, const void __user *from, size_t n);
size_t clear_user_pt(void __user *to, size_t n);
size_t strnlen_user_pt(const char __user *src, size_t count);
size_t strncpy_from_user_pt(char *dst, const char __user *src, size_t count);
#endif /* __ARCH_S390_LIB_UACCESS_H */