All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: smp: Add a memory barrier before we start secondary cores
@ 2014-02-12 11:46 Mark Brown
  2014-02-12 12:27 ` Will Deacon
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2014-02-12 11:46 UTC (permalink / raw)
  To: linux-arm-kernel

From: Mark Brown <broonie@linaro.org>

Ensure that memory writes will be visible to the newly started core by
inserting a write barrier prior to starting. This adds robustness against
possible incomplete synchronisation of state.

Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
---
 arch/arm64/kernel/smp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 9660750f34ba..f5520d8fafab 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -160,6 +160,11 @@ asmlinkage void secondary_start_kernel(void)
 	smp_store_cpu_info(cpu);
 
 	/*
+	 * Ensure memory writes are visible before we start.
+	 */
+	smp_wmb();
+
+	/*
 	 * OK, now it's safe to let the boot CPU continue.  Wait for
 	 * the CPU migration code to notice that the CPU is online
 	 * before we continue.
-- 
1.9.0.rc3

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

end of thread, other threads:[~2014-02-13 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 11:46 [PATCH] arm64: smp: Add a memory barrier before we start secondary cores Mark Brown
2014-02-12 12:27 ` Will Deacon
2014-02-12 12:47   ` Mark Brown
2014-02-12 13:43     ` Catalin Marinas
2014-02-12 14:56       ` Mark Brown
2014-02-12 18:23         ` Catalin Marinas
2014-02-13 15:58           ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.