public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix: xtensa: add missing sync_core
@ 2017-08-27 21:36 Mathieu Desnoyers
  2017-08-28 17:12 ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Desnoyers @ 2017-08-27 21:36 UTC (permalink / raw)
  To: Paul E . McKenney
  Cc: linux-kernel, Mathieu Desnoyers, Peter Zijlstra, Chris Zankel,
	Max Filippov, linux-xtensa

The membarrier system call now requires all architectures to implement
sync_core(). On Xtensa, it is provided by the EXTW instruction.

[ Completely untested! Can someone on the xtensa side confirm whether
  EXTW is the right way to serialize core execution and try it out ? ]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
CC: Chris Zankel <chris@zankel.net>
CC: Max Filippov <jcmvbkbc@gmail.com>
CC: linux-xtensa@linux-xtensa.org
---
 arch/xtensa/include/asm/processor.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index 30ee8c608853..b435bd6adbd6 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -248,5 +248,14 @@ static inline unsigned long get_er(unsigned long addr)
 
 #endif /* XCHAL_HAVE_EXTERN_REGS */
 
+static inline void sync_core(void)
+{
+	/*
+	 * Synchronize the core execution pipeline. Acts as a compiler
+	 * barrier.
+	 */
+	asm volatile ("extw" : : : "memory");
+}
+
 #endif	/* __ASSEMBLY__ */
 #endif	/* _XTENSA_PROCESSOR_H */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-12 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-27 21:36 [PATCH] Fix: xtensa: add missing sync_core Mathieu Desnoyers
2017-08-28 17:12 ` Max Filippov
2017-08-29 18:55   ` Mathieu Desnoyers
2017-09-12  4:37     ` Max Filippov
2017-09-12 13:05       ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox