All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danjel McGougan <danjel.mcgougan@comhem.se>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ppc32 copy_to_user dcbt fixup
Date: Sat, 13 Mar 2004 15:39:57 +0100	[thread overview]
Message-ID: <40531D3D.2090702@comhem.se> (raw)
In-Reply-To: <1z8Na-5hH-1@gated-at.bofh.it>

Bryan Rittmeyer wrote:
> copy_tofrom_user and copy_page use dcbt to prefetch source data [1].
> Since at least 2.4.17, these functions have been prefetching
> beyond the end of the source buffer, leading to two problems:
> 
> 1. Subtly broken software cache coherency. If the area following src
> was invalidate_dcache_range'd prior to submitting for DMA,
> an out-of-bounds dcbt from copy_to_user of a separate slab object
> may read in the area before DMA completion. When the DMA does complete,
> data will not be loaded from RAM because stale data is already in cache.
> Thus you get a corrupt network packet, bogus audio capture, etc.
> 
[snip]

I am no expert on the ppc arch, but in my humble opinion it seems 
strange to invalidate the dcache *before* the memory-writing 
DMA-transaction. The obvious solution is to invalidate the dcache 
*after* DMA completion. It seems hard to guarantee that nobody will 
touch the memory area in question during the DMA.

Just some clue-less comments from a linux-kernel lurker.

Regards,
Danjel

       reply	other threads:[~2004-03-13 14:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1z8Na-5hH-1@gated-at.bofh.it>
2004-03-13 14:39 ` Danjel McGougan [this message]
2004-03-14 22:35   ` [PATCH] ppc32 copy_to_user dcbt fixup Bryan Rittmeyer
2004-03-13  4:15 Bryan Rittmeyer
2004-03-13  4:50 ` Benjamin Herrenschmidt
2004-03-13  7:49   ` Bryan Rittmeyer
2004-03-13  8:36     ` Benjamin Herrenschmidt
2004-03-15  8:38   ` Segher Boessenkool
2004-03-13  9:11 ` Eugene Surovegin
2004-03-16  1:59   ` Bryan Rittmeyer

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=40531D3D.2090702@comhem.se \
    --to=danjel.mcgougan@comhem.se \
    --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.