public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [rfc][patch 1/3] x86_64: fence nontemproal stores
@ 2007-10-04  5:21 Nick Piggin
  2007-10-04  5:22 ` [rfc][patch 2/3] x86: fix IO write barriers Nick Piggin
  2007-10-04  5:23 ` [rfc][patch 3/3] x86: optimise barriers Nick Piggin
  0 siblings, 2 replies; 35+ messages in thread
From: Nick Piggin @ 2007-10-04  5:21 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Linus Torvalds, Andi Kleen

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
 

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

end of thread, other threads:[~2007-10-16 12:46 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-04  5:21 [rfc][patch 1/3] x86_64: fence nontemproal stores Nick Piggin
2007-10-04  5:22 ` [rfc][patch 2/3] x86: fix IO write barriers Nick Piggin
2007-10-04 17:32   ` Dave Jones
2007-10-04 17:53     ` Andi Kleen
2007-10-04 18:10       ` Dave Jones
2007-10-04 18:21         ` Andi Kleen
2007-10-04 18:41           ` Dave Jones
2007-10-04 18:58             ` Andi Kleen
2007-10-04 19:08               ` Dave Jones
2007-10-04 20:52                 ` Alan Cox
2007-10-04  5:23 ` [rfc][patch 3/3] x86: optimise barriers Nick Piggin
2007-10-12  8:25   ` Jarek Poplawski
2007-10-12  8:42     ` Helge Hafting
2007-10-12  9:12       ` Jarek Poplawski
2007-10-12  9:44         ` Nick Piggin
2007-10-12 10:04           ` Jarek Poplawski
2007-10-12 12:44         ` Helge Hafting
2007-10-12 13:29           ` Jarek Poplawski
2007-10-15 10:17             ` Helge Hafting
2007-10-15 11:53               ` Jarek Poplawski
2007-10-12  8:57     ` Nick Piggin
2007-10-12  9:55       ` Jarek Poplawski
2007-10-12 10:42         ` Nick Piggin
2007-10-12 11:55           ` Jarek Poplawski
2007-10-12 12:10             ` Jarek Poplawski
2007-10-12 15:13     ` Linus Torvalds
2007-10-15  7:44       ` Jarek Poplawski
2007-10-15  8:09         ` Nick Piggin
2007-10-15  9:10           ` Jarek Poplawski
2007-10-15  9:24             ` Jarek Poplawski
2007-10-16  0:50             ` Nick Piggin
2007-10-16  9:00               ` Jarek Poplawski
2007-10-16  9:14                 ` david
2007-10-16 12:49                   ` Jarek Poplawski
2007-10-15 14:38         ` David Schwartz

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