diff mbox series

um: "borrow" atomics from x86 architecture

Message ID 20201112142023.1644-1-anton.ivanov@cambridgegreys.com
State Superseded
Headers show
Series um: "borrow" atomics from x86 architecture | expand

Commit Message

Anton Ivanov Nov. 12, 2020, 2:20 p.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

This moves UML on 64 bit from generic atomics to their x86
equivalents.

Generic atomics bracket most operations by interrupts off/interrupts
on. This is quite expensive on UML - it translates to changing
the signal mask and rerunning the signal loop every time.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/include/asm/atomic-x86.h  |  1 +
 arch/um/include/asm/atomic.h      | 13 +++++++++++++
 arch/um/include/asm/atomic64_64.h |  1 +
 3 files changed, 15 insertions(+)
 create mode 120000 arch/um/include/asm/atomic-x86.h
 create mode 100644 arch/um/include/asm/atomic.h
 create mode 120000 arch/um/include/asm/atomic64_64.h
diff mbox series

Patch

diff --git a/arch/um/include/asm/atomic-x86.h b/arch/um/include/asm/atomic-x86.h
new file mode 120000
index 000000000000..e71a389e112d
--- /dev/null
+++ b/arch/um/include/asm/atomic-x86.h
@@ -0,0 +1 @@ 
+../../../x86/include/asm/atomic.h
\ No newline at end of file
diff --git a/arch/um/include/asm/atomic.h b/arch/um/include/asm/atomic.h
new file mode 100644
index 000000000000..a5105ab67eac
--- /dev/null
+++ b/arch/um/include/asm/atomic.h
@@ -0,0 +1,13 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_ATOMIC_XOR_H
+#define _ASM_ATOMIC_XOR_H
+
+#ifdef CONFIG_64BIT
+#undef CONFIG_X86_32
+#include <asm/atomic-x86.h>
+#else
+#include <asm-generic/atomic.h>
+#endif
+
+
+#endif
diff --git a/arch/um/include/asm/atomic64_64.h b/arch/um/include/asm/atomic64_64.h
new file mode 120000
index 000000000000..f817a1478603
--- /dev/null
+++ b/arch/um/include/asm/atomic64_64.h
@@ -0,0 +1 @@ 
+../../../x86/include/asm/atomic64_64.h
\ No newline at end of file