linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Matt Porter <mporter@kernel.crashing.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kallol Biswas <Kallol_Biswas@pmc-sierra.com>, linuxppc-dev@ozlabs.org
Subject: Re: memory with __get_free_pages and disabling caching
Date: Fri, 24 Mar 2006 18:25:49 -0700	[thread overview]
Message-ID: <20060324182549.C20731@cox.net> (raw)
In-Reply-To: <1143248571.3710.33.camel@localhost.localdomain>; from benh@kernel.crashing.org on Sat, Mar 25, 2006 at 12:02:51PM +1100

On Sat, Mar 25, 2006 at 12:02:51PM +1100, Benjamin Herrenschmidt wrote:
> 
> > Yes, that's how it works. After being allocated by the dma api
> > routines, the direct map is never accessed. Accessing the same
> > physical address via the cached direct map would cause serious
> > problems but you aren't allowed to touch address space like
> > that unless it's been allocated through a kernel allocator for
> > your use.
> 
> That is still broken for at least 6xx CPUs ... they may well prefetch it
> and you die...
 
Right.

> For example, page A is a normal page allocated for kernel use, page B
> just a after A is used by the DMA allocator for uncacheable accesses
> (and is thus mapped twice). If something does a loop going through an
> array in page A, you have no guarantee that some smart prefetcher &
> speculative accesses will not bring bits of page B into the cache since
> it's mapped and cacheable...

We had a similar scenario on 4xx with the smart prefetching that is
used in copy_tofrom_user. It had to be modified not to prefetch
across pages for 4xx. Eugene first saw corruption due to adjacent
page prefetches into a dmaable page.

-Matt

  reply	other threads:[~2006-03-25  1:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24 23:44 memory with __get_free_pages and disabling caching Kallol Biswas
2006-03-25  0:20 ` Benjamin Herrenschmidt
2006-03-25  0:29   ` Matt Porter
2006-03-25  0:27 ` Matt Porter
2006-03-25  1:02   ` Benjamin Herrenschmidt
2006-03-25  1:25     ` Matt Porter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-24 19:13 Kallol Biswas
2006-03-24 19:29 ` Kumar Gala
2006-03-24 22:17 ` Paul Mackerras
2006-03-24 22:30 ` Benjamin Herrenschmidt
2006-03-24  2:15 Kallol Biswas
2006-03-24  3:05 ` Benjamin Herrenschmidt

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=20060324182549.C20731@cox.net \
    --to=mporter@kernel.crashing.org \
    --cc=Kallol_Biswas@pmc-sierra.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).