linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: akpm@linux-foundation.org
Cc: torvalds@linux-foundation.org, anfei.zhou@gmail.com,
	linux-arch@vger.kernel.org, miklos@szeredi.hu,
	nickpiggin@yahoo.com.au, rmk@arm.linux.org.uk, stable@kernel.org
Subject: Re: [patch 05/16] mm: flush dcache before writing into page to avoid alias
Date: Wed, 03 Feb 2010 12:25:07 -0600	[thread overview]
Message-ID: <1265221507.2873.369.camel@mulgrave.site> (raw)
In-Reply-To: <201002022144.o12Li2wj015711@imap1.linux-foundation.org>

On Tue, 2010-02-02 at 13:44 -0800, akpm@linux-foundation.org wrote:
> From: anfei zhou <anfei.zhou@gmail.com>
> 
> The cache alias problem will happen if the changes of user shared mapping
> is not flushed before copying, then user and kernel mapping may be mapped
> into two different cache line, it is impossible to guarantee the coherence
> after iov_iter_copy_from_user_atomic.  So the right steps should be:
> 
> 	flush_dcache_page(page);

This is likely unnecessary if the page has come down a standard path ...
for fuse, it is possible it didn't go through __get_user_pages().

> 	kmap_atomic(page);
> 	write to page;
> 	kunmap_atomic(page);
> 	flush_dcache_page(page);
> 
> More precisely, we might create two new APIs flush_dcache_user_page and
> flush_dcache_kern_page to replace the two flush_dcache_page accordingly.

We already have one of those: flush_kernel_dcache_page().

James

  reply	other threads:[~2010-02-03 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 21:44 [patch 05/16] mm: flush dcache before writing into page to avoid alias akpm
2010-02-03 18:25 ` James Bottomley [this message]
2010-02-04 14:39   ` anfei

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=1265221507.2873.369.camel@mulgrave.site \
    --to=james.bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=anfei.zhou@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rmk@arm.linux.org.uk \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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).