public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <ak@suse.de>
Subject: [rfc][patch 1/3] x86_64: fence nontemproal stores
Date: Thu, 4 Oct 2007 07:21:54 +0200	[thread overview]
Message-ID: <20071004052153.GA15131@wotan.suse.de> (raw)

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
 

             reply	other threads:[~2007-10-04  5:22 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04  5:21 Nick Piggin [this message]
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

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=20071004052153.GA15131@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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