From dd3035a21ba7ccaa883d7107d357ad06320d78fc Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Fri, 12 Mar 2021 15:16:09 +0000 Subject: um: add a UML specific futex implementation The generic asm futex implementation emulates atomic access to memory by doing a get_user followed by put_user. These translate to two mapping operations on UML with paging enabled in the meantime. This, in turn may end up changing interrupts, invoking the signal loop, etc. This replaces the generic implementation by a mapping followed by an operation on the mapped segment. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger --- arch/um/include/asm/futex.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 arch/um/include/asm/futex.h (limited to 'arch/um/include/asm/futex.h') diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h new file mode 100644 index 000000000000..780aa6bfc050 --- /dev/null +++ b/arch/um/include/asm/futex.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_UM_FUTEX_H +#define _ASM_UM_FUTEX_H + +#include +#include +#include + + +int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr); +int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, + u32 oldval, u32 newval); + +#endif -- cgit