From: gmbnomis@gmail.com (Simon Baatz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 2/2] ARM: Handle user space mapped pages in flush_kernel_dcache_page
Date: Mon, 22 Apr 2013 00:06:30 +0200 [thread overview]
Message-ID: <20130421220629.GA25571@schnuecks.de> (raw)
In-Reply-To: <20130418135104.GA18616@arm.com>
Hi Catalin,
On Thu, Apr 18, 2013 at 02:51:04PM +0100, Catalin Marinas wrote:
> On Thu, Apr 18, 2013 at 12:40:16PM +0100, Jason Cooper wrote:
> > Ok, got it. I should have been more explicit. LVM doesn't work on ARM.
> > iirc, Simon had a demo of dm-crypt also faulting on ARM. This patch was
> > not the correct approach. Is there an interest (particularly Simon) in
> > fixing the problem?
>
> I think fixing this for ARM is useful but I don't have any time to
> allocate. I think I acked the first patch in the series but I don't
> fully remember the details behind the second one.
>
> As Russell said, flush_kernel_dcache_page() is not the right API.
It is not the driver itself which is using the API, it is the
generic scatterlist memory iterator. And I don't think that this is
wrong, as I have tried to explain in [1].
> flush_dcache_page() is not supposed to be used on anonymous pages. What
> we have for such pages is flush_anon_page() which is a no-op for VIPT
> non-aliasing pages. I can see that __get_user_pages() calls both
> flush_anon_page() flush_dcache_page().
Yes. But I think that is not relevant here. Although the naming
suggest that the function is just a light-weight version of
flush_dcache_page(), both the documentation and the commit text say
that flush_kernel_dcache_page() has to handle pages that were
obtained through get_user_pages, which includes anon pages.
Btw. many drivers which modify pages via the kernel mapping currently
use flush_dcache_page() instead. This is not supposed to work in
e.g. the direct I/O case where a driver sees anon pages. This works
just because flush_dcache_page() flushes the kernel mapping also for
anon pages. Something is is clearly not supposed to do according to
documentation.
> Is the problem that you have related to I-D cache coherency? Is
> flush_anon_page() the right place for this?
This particular problem is not related to I/D cache coherency.
However, as far as I know, flush_dcache_page() is expected to ensure
also I/D cache coherency. Also, we flush the I-cache in certain
situations in this function. As said in my response to Russel, I
don't know whether this is expected from flush_kernel_dcache_page()
as well. I would say yes, but I also have posted a version that only
flushes the D-cache kernel mapping.
- Simon
[1] http://permalink.gmane.org/gmane.linux.ports.arm.kernel/181703
next prev parent reply other threads:[~2013-04-21 22:06 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-07 11:29 [PATCH V2 0/2] fix and improvement of flush(_kernel)_dcache_page() Simon Baatz
2012-10-07 11:29 ` [PATCH V2 1/2] ARM: remove unnecessary flush of anon pages in flush_dcache_page() Simon Baatz
2012-10-08 11:36 ` Catalin Marinas
2012-10-08 17:38 ` Simon Baatz
2012-10-08 17:43 ` Catalin Marinas
2012-10-07 11:29 ` [PATCH V3 2/2] ARM: Handle user space mapped pages in flush_kernel_dcache_page Simon Baatz
2012-10-08 17:44 ` Catalin Marinas
2012-10-08 20:02 ` Simon Baatz
2012-10-08 20:20 ` Russell King - ARM Linux
2012-10-08 23:07 ` Simon Baatz
2012-11-18 21:10 ` Jason Cooper
2013-04-18 11:16 ` Jason Cooper
2013-04-18 11:22 ` Russell King - ARM Linux
2013-04-18 11:40 ` Jason Cooper
2013-04-18 13:51 ` Catalin Marinas
2013-04-21 22:06 ` Simon Baatz [this message]
2013-04-30 11:22 ` Catalin Marinas
2013-04-30 21:04 ` Simon Baatz
2013-05-01 14:22 ` Catalin Marinas
2013-05-01 19:04 ` Simon Baatz
2013-05-02 9:54 ` Catalin Marinas
2013-05-02 19:38 ` Simon Baatz
2013-05-03 10:02 ` Catalin Marinas
2013-05-04 8:21 ` Ming Lei
2013-05-08 15:08 ` Catalin Marinas
2013-05-08 18:43 ` Russell King - ARM Linux
2013-05-08 19:31 ` Simon Baatz
2013-05-08 21:13 ` Catalin Marinas
2013-05-09 1:52 ` Ming Lei
2013-05-11 6:27 ` Simon Baatz
2013-05-13 3:12 ` Ming Lei
2013-05-05 22:26 ` Simon Baatz
2013-05-08 15:28 ` Catalin Marinas
2013-04-18 19:39 ` Simon Baatz
2013-04-18 19:00 ` Simon Baatz
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=20130421220629.GA25571@schnuecks.de \
--to=gmbnomis@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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.