[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e61938a921a46347d7725badc40ec436ebfff977@git.kernel.org>
Date: Mon, 5 Feb 2018 13:28:12 -0800
From: tip-bot for Mathieu Desnoyers <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mpe@...erman.id.au, tglx@...utronix.de, ghackmann@...gle.com,
boqun.feng@...il.com, mingo@...nel.org, peterz@...radead.org,
parri.andrea@...il.com, linux-kernel@...r.kernel.org,
hpa@...or.com, luto@...nel.org, will.deacon@....com,
mathieu.desnoyers@...icios.com, linux@...linux.org.uk,
avi@...lladb.com, torvalds@...ux-foundation.org,
paulmck@...ux.vnet.ibm.com, arnd@...db.de, davejwatson@...com,
paulus@...ba.org, sehr@...gle.com, ahh@...gle.com,
maged.michael@...il.com, benh@...nel.crashing.org
Subject: [tip:sched/urgent] locking: Introduce sync_core_before_usermode()
Commit-ID: e61938a921a46347d7725badc40ec436ebfff977
Gitweb: https://git.kernel.org/tip/e61938a921a46347d7725badc40ec436ebfff977
Author: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
AuthorDate: Mon, 29 Jan 2018 15:20:15 -0500
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 5 Feb 2018 21:34:50 +0100
locking: Introduce sync_core_before_usermode()
Introduce an architecture function that ensures the current CPU
issues a core serializing instruction before returning to usermode.
This is needed for the membarrier "sync_core" command.
Architectures defining the sync_core_before_usermode() static inline
need to select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Acked-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Andrea Parri <parri.andrea@...il.com>
Cc: Andrew Hunter <ahh@...gle.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Avi Kivity <avi@...lladb.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Boqun Feng <boqun.feng@...il.com>
Cc: Dave Watson <davejwatson@...com>
Cc: David Sehr <sehr@...gle.com>
Cc: Greg Hackmann <ghackmann@...gle.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Maged Michael <maged.michael@...il.com>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Russell King <linux@...linux.org.uk>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-api@...r.kernel.org
Cc: linux-arch@...r.kernel.org
Link: http://lkml.kernel.org/r/20180129202020.8515-7-mathieu.desnoyers@efficios.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/sync_core.h | 21 +++++++++++++++++++++
init/Kconfig | 3 +++
2 files changed, 24 insertions(+)
diff --git a/include/linux/sync_core.h b/include/linux/sync_core.h
new file mode 100644
index 0000000..013da4b
--- /dev/null
+++ b/include/linux/sync_core.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_SYNC_CORE_H
+#define _LINUX_SYNC_CORE_H
+
+#ifdef CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
+#include <asm/sync_core.h>
+#else
+/*
+ * This is a dummy sync_core_before_usermode() implementation that can be used
+ * on all architectures which return to user-space through core serializing
+ * instructions.
+ * If your architecture returns to user-space through non-core-serializing
+ * instructions, you need to write your own functions.
+ */
+static inline void sync_core_before_usermode(void)
+{
+}
+#endif
+
+#endif /* _LINUX_SYNC_CORE_H */
+
diff --git a/init/Kconfig b/init/Kconfig
index 837adcf..535421f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1918,3 +1918,6 @@ config ASN1
functions to call on what tags.
source "kernel/Kconfig.locks"
+
+config ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
+ bool
Powered by blists - more mailing lists