From: Ralf Baechle <ralf@linux-mips.org>
To: Jim Quinlan <jim2101024@gmail.com>
Cc: linux-mips@linux-mips.org, cernekee@gmail.com
Subject: Re: [PATCH] MIPS: dma: if BMIPS5000, flush region just like r10000
Date: Wed, 4 Sep 2013 18:53:58 +0200 [thread overview]
Message-ID: <20130904165358.GA27447@linux-mips.org> (raw)
In-Reply-To: <1377637071-32740-1-git-send-email-jim2101024@gmail.com>
Dan,
On Tue, Aug 27, 2013 at 04:57:51PM -0400, Jim Quinlan wrote:
> Date: Tue, 27 Aug 2013 16:57:51 -0400
> From: Jim Quinlan <jim2101024@gmail.com>
> To: ralf@linux-mips.org, linux-mips@linux-mips.org
> cc: cernekee@gmail.com, Jim Quinlan <jim2101024@gmail.com>
> Subject: [PATCH] MIPS: dma: if BMIPS5000, flush region just like r10000
> Content-Type: text/plain
>
> The BMIPS5000 (Zephyr) processor utilizes instruction speculation. A
> stale misprediction address in either the JTB or the CRS may trigger
> a prefetch inside a region that is currently being used by a DMA
> engine, which is not IO-coherent. This prefetch will fetch a line
> into the scache, and that line will soon become stale (ie wrong)
> during/after the DMA. Mayhem ensues.
>
> In dma-default.c, the r10000 is handled as a special case in the
> same way that we want to handle Zephyr. So we generalize the
> exception cases into a function, and include Zephyr as one
> of the processors that needs this special care.
Is this a processor erratum or just documented, undesireable behaviour?
In case of the R10000 family it's the later and it also only affects
systems without cache coherency. In such systems it is also possible
that cachelines in speculative-dirty state will be created by a
speculativly executed store instruction. This is normal - but on a
cache coherent system the coherency logic would prevent such speculativly
dirty lines from being written back to memory.
To avoid this from happening non-coherent R10000 systems also require their
kernel to be built with a special compiler option that inserts cache barrier
operations wherever a speculativly dirty line otherwise might be created.
Patch is looking good.
Ralf
next prev parent reply other threads:[~2013-09-04 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-27 20:57 [PATCH] MIPS: dma: if BMIPS5000, flush region just like r10000 Jim Quinlan
2013-09-04 16:53 ` Ralf Baechle [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-09-04 17:55 Jim Quinlan
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=20130904165358.GA27447@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=cernekee@gmail.com \
--cc=jim2101024@gmail.com \
--cc=linux-mips@linux-mips.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.