From: Eric Dumazet <dada1@cosmosbay.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Andi Kleen <ak@suse.de>, linux-kernel@vger.kernel.org
Subject: [PATCH] x86_64 prefetchw() function can take into account CONFIG_MK8 / CONFIG_MPSC
Date: Thu, 23 Jun 2005 11:37:40 +0200 [thread overview]
Message-ID: <42BA82E4.3040801@cosmosbay.com> (raw)
In-Reply-To: <42BA81B2.4070108@cosmosbay.com>
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
If we build a x86_64 kernel for an AMD64 or for an Intel EMT64, no need to use alternative_input.
Reserve alternative_input only for a generic kernel.
Thank you
Eric Dumazet
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: patch.2 --]
[-- Type: text/plain, Size: 1075 bytes --]
diff -Nru linux-2.6.12/include/asm-x86_64/processor.h linux-2.6.12-orig/include/asm-x86_64/processor.h
--- linux-2.6.12-orig/include/asm-x86_64/processor.h 2005-06-17 21:48:29.000000000 +0200
+++ linux-2.6.12/include/asm-x86_64/processor.h 2005-06-23 11:20:08.000000000 +0200
@@ -389,10 +389,21 @@
#define ARCH_HAS_PREFETCHW 1
static inline void prefetchw(void *x)
{
+#if defined(CONFIG_MK8)
+ /* AMD64 / MK8 has 3DNOW, we can emit a true prefetchw, using a "m" in the asm input */
+ asm volatile("prefetchw %0" :: "m" (*(unsigned long *)x));
+#elif defined(CONFIG_MPSC)
+ /* Intel EMT64 does not have 3DNOW, no prefetchw instruction */
+#else
+ /* If we build a generic X86_64 kernel,
+ * we must use alternative_input() and a "r" asm constraint to make sure
+ * the size of the instruction will be <= 5
+ */
alternative_input(ASM_NOP5,
"prefetchw (%1)",
X86_FEATURE_3DNOW,
"r" (x));
+#endif
}
#define ARCH_HAS_SPINLOCK_PREFETCH 1
next prev parent reply other threads:[~2005-06-23 9:43 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-06 20:29 RFC: NAPI packet weighting patch Ronciak, John
2005-06-06 23:55 ` Mitch Williams
2005-06-07 0:08 ` Ben Greear
2005-06-08 1:50 ` Jesse Brandeburg
2005-06-07 4:53 ` Stephen Hemminger
2005-06-07 12:38 ` jamal
2005-06-07 12:06 ` Martin Josefsson
2005-06-07 13:29 ` jamal
2005-06-07 12:36 ` Martin Josefsson
2005-06-07 16:34 ` Robert Olsson
2005-06-07 23:19 ` Rick Jones
2005-06-21 20:37 ` David S. Miller
2005-06-22 7:27 ` Eric Dumazet
2005-06-22 8:42 ` P
2005-06-22 19:37 ` jamal
2005-06-23 8:56 ` P
2005-06-21 20:20 ` David S. Miller
2005-06-21 20:38 ` Rick Jones
2005-06-21 20:55 ` David S. Miller
2005-06-21 21:47 ` Andi Kleen
2005-06-21 22:22 ` Donald Becker
2005-06-21 22:34 ` Andi Kleen
2005-06-22 0:08 ` Donald Becker
2005-06-22 4:44 ` Chris Friesen
2005-06-22 11:31 ` Andi Kleen
2005-06-22 16:23 ` Leonid Grossman
2005-06-22 16:37 ` jamal
2005-06-22 18:00 ` Leonid Grossman
2005-06-22 18:06 ` Andi Kleen
2005-06-22 20:22 ` David S. Miller
2005-06-22 20:35 ` Rick Jones
2005-06-22 20:43 ` David S. Miller
2005-06-22 21:10 ` Andi Kleen
2005-06-22 21:16 ` David S. Miller
2005-06-22 21:53 ` Chris Friesen
2005-06-22 22:11 ` Andi Kleen
2005-06-22 21:38 ` Eric Dumazet
2005-06-22 22:13 ` Eric Dumazet
2005-06-22 22:30 ` David S. Miller
2005-06-22 22:23 ` David S. Miller
2005-06-23 12:14 ` jamal
2005-06-23 17:36 ` David Mosberger
2005-06-22 22:42 ` Leonid Grossman
2005-06-22 23:13 ` Andi Kleen
2005-06-22 23:19 ` David S. Miller
2005-06-22 23:23 ` Andi Kleen
2005-06-23 9:32 ` [PATCH] x86_64 prefetchw() function can take into account CONFIG_MK8 / CONFIG_MPSC Eric Dumazet
2005-06-23 9:37 ` Eric Dumazet [this message]
2005-06-23 11:31 ` Andi Kleen
2005-06-23 12:53 ` Eric Dumazet
2005-06-23 13:10 ` Andi Kleen
2005-06-22 17:05 ` RFC: NAPI packet weighting patch Andi Kleen
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=42BA82E4.3040801@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.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 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.