From: Carsten Langgaard <carstenl@mips.com>
To: Dominic Sweetman <dom@algor.co.uk>
Cc: Ralf Baechle <ralf@uni-koblenz.de>,
linux-mips@linux-mips.org, dom@mips.com, chris@mips.com,
kevink@mips.com
Subject: Re: Prefetches in memcpy
Date: Thu, 05 Dec 2002 16:14:21 +0100 [thread overview]
Message-ID: <3DEF6D4D.C0E886B0@mips.com> (raw)
In-Reply-To: 15855.7458.19248.593085@arsenal.algor.co.uk
[-- Attachment #1: Type: text/plain, Size: 604 bytes --]
Here's what I think we should do for now (attached patch).
/Carsten
Dominic Sweetman wrote:
> Carsten,
>
> > I think we should get rid of the prefetches until someone comes up with a
> > version that doesn't prefetch beyond the copy destination/source area.
>
> I agree.
>
> --
> Dominic
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
[-- Attachment #2: memcpy.patch --]
[-- Type: text/plain, Size: 1770 bytes --]
Index: arch/mips/lib/memcpy.S
===================================================================
RCS file: /home/cvs/linux/arch/mips/lib/memcpy.S,v
retrieving revision 1.6.2.4
diff -u -r1.6.2.4 memcpy.S
--- arch/mips/lib/memcpy.S 19 Sep 2002 14:01:24 -0000 1.6.2.4
+++ arch/mips/lib/memcpy.S 5 Dec 2002 15:06:58 -0000
@@ -21,6 +21,17 @@
#define src a1
#define len a2
+/*
+ * There is spread a number of PREF instructions in the memcpy function, but
+ * there is no check if we are prefetching out-side the "memcpy" areas.
+ * This is extremely dangerous because we might prefetch out-side the physical
+ * memory area causing e.g. a bus error or something even more nasty.
+ * It could also hit a DMA buffer region, and there by break the PCI DMA
+ * flushing scheme.
+ * So for now, we simply get rid of the PREFs here.
+ */
+#define PREF(hint,addr)
+
/*
* Spec
*
Index: arch/mips64/lib/memcpy.S
===================================================================
RCS file: /home/cvs/linux/arch/mips64/lib/memcpy.S,v
retrieving revision 1.9.2.3
diff -u -r1.9.2.3 memcpy.S
--- arch/mips64/lib/memcpy.S 19 Sep 2002 14:01:24 -0000 1.9.2.3
+++ arch/mips64/lib/memcpy.S 5 Dec 2002 15:06:59 -0000
@@ -21,6 +21,17 @@
#define src a1
#define len a2
+/*
+ * There is spread a number of PREF instructions in the memcpy function, but
+ * there is no check if we are prefetching out-side the "memcpy" areas.
+ * This is extremely dangerous because we might prefetch out-side the physical
+ * memory area causing e.g. a bus error or something even more nasty.
+ * It could also hit a DMA buffer region, and there by break the PCI DMA
+ * flushing scheme.
+ * So for now, we simply get rid of the PREFs here.
+ */
+#define PREF(hint,addr)
+
/*
* Spec
*
next prev parent reply other threads:[~2002-12-05 15:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-05 13:45 Prefetches in memcpy Carsten Langgaard
2002-11-05 15:38 ` Ralf Baechle
2002-11-05 16:13 ` Kevin D. Kissell
2002-11-05 16:13 ` Kevin D. Kissell
2002-11-05 16:29 ` Ralf Baechle
2002-11-05 16:41 ` Ralf Baechle
2002-11-05 17:26 ` Alan Cox
2002-12-04 15:06 ` Carsten Langgaard
2002-12-05 9:32 ` Dominic Sweetman
2002-12-05 15:14 ` Carsten Langgaard [this message]
2002-12-05 15:47 ` Maciej W. Rozycki
2002-12-08 7:06 ` Gilad
2002-12-08 10:01 ` Kevin D. Kissell
2002-12-08 10:01 ` Kevin D. Kissell
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=3DEF6D4D.C0E886B0@mips.com \
--to=carstenl@mips.com \
--cc=chris@mips.com \
--cc=dom@algor.co.uk \
--cc=dom@mips.com \
--cc=kevink@mips.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@uni-koblenz.de \
/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