diff mbox series

[v4,3/7] um: "borrow" atomics from x86 architecture

Message ID 20201211174559.26010-4-anton.ivanov@cambridgegreys.com
State Changes Requested
Headers show
Series [v4,1/7] um: allow the use of glibc functions instead of builtins | expand

Commit Message

Anton Ivanov Dec. 11, 2020, 5:45 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      | 7 +++++++
 arch/um/include/asm/atomic64_64.h | 1 +
 3 files changed, 9 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

Comments

Johannes Berg Dec. 11, 2020, 8:08 p.m. UTC | #1
On Fri, 2020-12-11 at 17:45 +0000, anton.ivanov@cambridgegreys.com
wrote:
> 
> +++ b/arch/um/include/asm/atomic.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_ATOMIC_XOR_H

XOR?

And also here - are the symlinks really needed?

Not that I mind them too much, but it's a bit strange ... and would be a
lot harder to port to other arches, if anyone should be inclined, if
there are hard symlinks to x86.

johannes
Anton Ivanov Dec. 11, 2020, 9:31 p.m. UTC | #2
On 11/12/2020 20:08, Johannes Berg wrote:
> On Fri, 2020-12-11 at 17:45 +0000, anton.ivanov@cambridgegreys.com
> wrote:
>> +++ b/arch/um/include/asm/atomic.h
>> @@ -0,0 +1,7 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _ASM_ATOMIC_XOR_H
> XOR?

Brainfart

Will fix it in v5.

>
> And also here - are the symlinks really needed?
>
> Not that I mind them too much, but it's a bit strange ... and would be a
> lot harder to port to other arches, if anyone should be inclined, if
> there are hard symlinks to x86.
>
> johannes
>
>
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..6ff22c587c10
--- /dev/null
+++ b/arch/um/include/asm/atomic.h
@@ -0,0 +1,7 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_ATOMIC_XOR_H
+#define _ASM_ATOMIC_XOR_H
+
+#include <asm/atomic-x86.h>
+
+#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