[rfc][patch 1/3] x86_64: fence nontemproal stores

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Kernel Mailing List <linux-kernel@...>, Linus Torvalds <torvalds@...>, Andi Kleen <ak@...>
Date: Thursday, October 4, 2007 - 1:21 am

Hi,

Here's a couple of patches to improve the memory barrier situation on x86.
They probably aren't going upstream until after the x86 merge, however I'm
posting them here for RFC, and in case anybody wants to backport into stable
trees.

---
movnt* instructions are not strongly ordered with respect to other stores,
so if we are to assume stores are strongly ordered in the rest of the x86_64
kernel, we must fence these off (see similar examples in i386 kernel).

[ The AMD memory ordering document seems to say that nontemporal stores can
  also pass earlier regular stores, so maybe we need sfences _before_ movnt*
  everywhere too? ]

Signed-off-by: Nick Piggin <npiggin@suse.de>

Index: linux-2.6/arch/x86_64/lib/copy_user_nocache.S
===================================================================
--- linux-2.6.orig/arch/x86_64/lib/copy_user_nocache.S
+++ linux-2.6/arch/x86_64/lib/copy_user_nocache.S
@@ -117,6 +117,7 @@ ENTRY(__copy_user_nocache)
 	popq %rbx
 	CFI_ADJUST_CFA_OFFSET -8
 	CFI_RESTORE rbx
+	sfence
 	ret
 	CFI_RESTORE_STATE
 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[rfc][patch 1/3] x86_64: fence nontemproal stores, Nick Piggin, (Thu Oct 4, 1:21 am)
[rfc][patch 3/3] x86: optimise barriers, Nick Piggin, (Thu Oct 4, 1:23 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 4:25 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Linus Torvalds, (Fri Oct 12, 11:13 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Mon Oct 15, 3:44 am)
RE: [rfc][patch 3/3] x86: optimise barriers, David Schwartz, (Mon Oct 15, 10:38 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Nick Piggin, (Mon Oct 15, 4:09 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Mon Oct 15, 5:10 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Nick Piggin, (Mon Oct 15, 8:50 pm)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Tue Oct 16, 5:00 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Tue Oct 16, 8:49 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Mon Oct 15, 5:24 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Nick Piggin, (Fri Oct 12, 4:57 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 5:55 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Nick Piggin, (Fri Oct 12, 6:42 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 7:55 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 8:10 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Helge Hafting, (Fri Oct 12, 4:42 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 5:12 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Helge Hafting, (Fri Oct 12, 8:44 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 9:29 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Helge Hafting, (Mon Oct 15, 6:17 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Mon Oct 15, 7:53 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Nick Piggin, (Fri Oct 12, 5:44 am)
Re: [rfc][patch 3/3] x86: optimise barriers, Jarek Poplawski, (Fri Oct 12, 6:04 am)
[rfc][patch 2/3] x86: fix IO write barriers, Nick Piggin, (Thu Oct 4, 1:22 am)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Dave Jones, (Thu Oct 4, 1:32 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Andi Kleen, (Thu Oct 4, 1:53 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Dave Jones, (Thu Oct 4, 2:10 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Andi Kleen, (Thu Oct 4, 2:21 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Dave Jones, (Thu Oct 4, 2:41 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Andi Kleen, (Thu Oct 4, 2:58 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Dave Jones, (Thu Oct 4, 3:08 pm)
Re: [rfc][patch 2/3] x86: fix IO write barriers, Alan Cox, (Thu Oct 4, 4:52 pm)