public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Mathieu Desnoyers <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mpe@ellerman.id.au, tglx@linutronix.de, ghackmann@google.com,
	boqun.feng@gmail.com, mingo@kernel.org, peterz@infradead.org,
	parri.andrea@gmail.com, linux-kernel@vger.kernel.org,
	hpa@zytor.com, luto@kernel.org, will.deacon@arm.com,
	mathieu.desnoyers@efficios.com, linux@armlinux.org.uk,
	avi@scylladb.com, torvalds@linux-foundation.org,
	paulmck@linux.vnet.ibm.com, arnd@arndb.de, davejwatson@fb.com,
	paulus@samba.org, sehr@google.com, ahh@google.com,
	maged.michael@gmail.com, benh@kernel.crashing.org
Subject: [tip:sched/urgent] locking: Introduce sync_core_before_usermode()
Date: Mon, 5 Feb 2018 13:28:12 -0800	[thread overview]
Message-ID: <tip-e61938a921a46347d7725badc40ec436ebfff977@git.kernel.org> (raw)
In-Reply-To: <20180129202020.8515-7-mathieu.desnoyers@efficios.com>

Commit-ID:  e61938a921a46347d7725badc40ec436ebfff977
Gitweb:     https://git.kernel.org/tip/e61938a921a46347d7725badc40ec436ebfff977
Author:     Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
AuthorDate: Mon, 29 Jan 2018 15:20:15 -0500
Committer:  Ingo Molnar <mingo@kernel.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@efficios.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrea Parri <parri.andrea@gmail.com>
Cc: Andrew Hunter <ahh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Avi Kivity <avi@scylladb.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Dave Watson <davejwatson@fb.com>
Cc: David Sehr <sehr@google.com>
Cc: Greg Hackmann <ghackmann@google.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Maged Michael <maged.michael@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Link: http://lkml.kernel.org/r/20180129202020.8515-7-mathieu.desnoyers@efficios.com
Signed-off-by: Ingo Molnar <mingo@kernel.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

  reply	other threads:[~2018-02-05 21:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 20:20 [PATCH for 4.16 00/11] membarrier updates for 4.16 Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v2 01/11] membarrier: selftest: Test private expedited cmd Mathieu Desnoyers
2018-02-05 21:25   ` [tip:sched/urgent] membarrier/selftest: Test private expedited command tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v7 02/11] powerpc: membarrier: Skip memory barrier in switch_mm() Mathieu Desnoyers
2018-02-05 20:22   ` Ingo Molnar
2018-02-05 20:32     ` Mathieu Desnoyers
2018-02-05 21:26   ` [tip:sched/urgent] powerpc, " tip-bot for Mathieu Desnoyers
2021-06-18 17:13   ` [PATCH for 4.16 v7 02/11] powerpc: " Christophe Leroy
2021-06-18 17:26     ` Mathieu Desnoyers
2021-06-19  9:35       ` Christophe Leroy
2021-06-19 15:02         ` Segher Boessenkool
2021-06-21 14:11           ` Christophe Leroy
2021-06-22  0:15             ` Segher Boessenkool
2018-01-29 20:20 ` [PATCH for 4.16 v5 03/11] membarrier: Document scheduler barrier requirements Mathieu Desnoyers
2018-02-05 21:26   ` [tip:sched/urgent] " tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v3 04/11] membarrier: provide GLOBAL_EXPEDITED command Mathieu Desnoyers
2018-02-05 21:27   ` [tip:sched/urgent] membarrier: Provide " tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v2 05/11] membarrier: selftest: Test global expedited cmd Mathieu Desnoyers
2018-02-05 21:27   ` [tip:sched/urgent] membarrier/selftest: Test global expedited command tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v2 06/11] Introduce sync_core_before_usermode Mathieu Desnoyers
2018-02-05 21:28   ` tip-bot for Mathieu Desnoyers [this message]
2018-01-29 20:20 ` [PATCH for 4.16 v3 07/11] x86: Implement sync_core_before_usermode Mathieu Desnoyers
2018-02-05 21:28   ` [tip:sched/urgent] lockin/x86: Implement sync_core_before_usermode() tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v3 08/11] membarrier: Provide core serializing command Mathieu Desnoyers
2018-02-05 21:29   ` [tip:sched/urgent] membarrier: Provide core serializing command, *_SYNC_CORE tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 v4 09/11] membarrier: x86: Provide core serializing command Mathieu Desnoyers
2018-02-05 21:29   ` [tip:sched/urgent] membarrier/x86: " tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 10/11] membarrier: arm64: " Mathieu Desnoyers
2018-02-05 21:30   ` [tip:sched/urgent] membarrier/arm64: " tip-bot for Mathieu Desnoyers
2018-01-29 20:20 ` [PATCH for 4.16 11/11] membarrier: selftest: Test private expedited sync core cmd Mathieu Desnoyers
2018-02-05 21:30   ` [tip:sched/urgent] membarrier/selftest: Test private expedited sync core command tip-bot for Mathieu Desnoyers
2018-02-05 21:21 ` [PATCH for 4.16 00/11] membarrier updates for 4.16 Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e61938a921a46347d7725badc40ec436ebfff977@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ahh@google.com \
    --cc=arnd@arndb.de \
    --cc=avi@scylladb.com \
    --cc=benh@kernel.crashing.org \
    --cc=boqun.feng@gmail.com \
    --cc=davejwatson@fb.com \
    --cc=ghackmann@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luto@kernel.org \
    --cc=maged.michael@gmail.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=parri.andrea@gmail.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=sehr@google.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox