LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Mike Stroyan <mike.stroyan@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hugh@veritas.com>,
"Luck, Tony" <tony.luck@intel.com>,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Fw: [PATCH] ia64: race flushing icache in do_no_page path
Date: Fri, 27 Apr 2007 21:55:08 +1000 [thread overview]
Message-ID: <4631E49C.2030501@yahoo.com.au> (raw)
In-Reply-To: <20070426173544.GA30744@ldl.fc.hp.com>
Mike Stroyan wrote:
> On Thu, Apr 26, 2007 at 05:53:49PM +1000, Nick Piggin wrote:
>
>>I had a couple of questions which I'm hoping someone would be kind
>>enough to explain :)
>
> ...
>
>>I wonder how this is different to all the other code which calls
>>lazy_mmu_prot_update() after set_pte_at(). do_swap_page, for example,
>>_could_ fault in executable code, couldn't it?
>
>
> The do_swap_page code does look suspect. It seems to be working on
> ia64 because a DMA transfer of data from swap to the allocated page
> is removing old lines from the icache. If code on an anonymous page
> was swapping in without direct DMA to the page then the same problem
> could occur. I can't think of a reasonable situation that would cause
> swapping in to not use DMA. Swapping to/from NFS does not seem reasonable
> to me anyway.
But that's because of ia64's cache coherency implementation. I don't really
follow the documentation to know whether it should be one way or the other,
but surely it should be done either before or after the set_pte_at, not both.
Anyway, how about fremap or mprotect, for example?
>>It is because do_swap_page uses flush_icache_page()? So why doesn't
>>the flush_icache_page() work in do_no_page as well? (It seems to look
>>like a superset of lazy_mmu_prot_update on ia64?!?).
>
>
> flush_icache_page() on ia64 is provided by include/asm-ia64/cacheflush.h.
> It doesn't have any effect at all.
>
> #define flush_icache_page(vma,page) do { } while (0)
You're right, sorry I was mistakenly looking at the flush_range. That was
my only immediate concern with your patch... So, for finding and fixing
that bug you have my admiration :)
OK, I'm still not sure that I understand why lazy_mmu_prot_update should be
used rather than flush_icache_page (in concept, not ia64 implementation).
Sure, flush_icache_page isn't given the pte, but let's assume we can change
that.
> lazy_mmu_prot_update() is supposed to get icache flushes done when they
> need to be. And it is supposed to avoid unneeded flushes when the icache
> is known to be clean for a page.
That's the theory. However, I'd still like to know how the arch code can
make the assertion that icache is known to be at all times other than at
the time of a fault?
Ie. what if an operation which causes incoherency is carried out _after_
an executable mapping is installed for that page.
--
SUSE Labs, Novell Inc.
next prev parent reply other threads:[~2007-04-27 11:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070425205548.fd51b301.akpm@linux-foundation.org>
2007-04-26 7:53 ` Nick Piggin
2007-04-26 17:35 ` Mike Stroyan
2007-04-27 11:55 ` Nick Piggin [this message]
2007-04-27 14:18 ` Hugh Dickins
2007-04-27 17:02 ` David Mosberger-Tang
2007-04-28 1:31 ` Rohit Seth
2007-04-28 5:34 ` Hugh Dickins
2007-04-28 18:17 ` Rohit Seth
2007-05-01 11:52 ` Nick Piggin
2007-05-02 0:36 ` Rohit Seth
2007-05-02 2:05 ` Nick Piggin
2007-04-28 2:16 ` Nick Piggin
2007-04-28 1:24 ` Rohit Seth
2007-04-28 2:00 ` Nick Piggin
2007-04-28 3:04 ` Nick Piggin
2007-04-28 5:20 ` Hugh Dickins
2007-04-28 6:03 ` Nick Piggin
2007-04-28 18:30 ` Rohit Seth
2007-05-01 11:47 ` Nick Piggin
2007-05-02 0:36 ` Rohit Seth
2007-04-28 18:05 ` Rohit Seth
2007-05-01 11:43 ` Nick Piggin
2007-05-04 21:32 ` Mike Stroyan
2007-04-28 4:11 ` Nick Piggin
2007-04-28 17:57 ` Rohit Seth
2007-05-01 11:39 ` Nick Piggin
2007-05-02 0:36 ` Rohit Seth
2007-05-02 1:57 ` Nick Piggin
2007-07-04 14:24 Zoltan Menyhart
2007-07-04 16:58 ` KAMEZAWA Hiroyuki
2007-07-05 8:57 ` Zoltan Menyhart
2007-07-05 17:36 ` Mike Stroyan
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=4631E49C.2030501@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@linux-foundation.org \
--cc=hugh@veritas.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.stroyan@hp.com \
--cc=tony.luck@intel.com \
--subject='Re: Fw: [PATCH] ia64: race flushing icache in do_no_page path' \
/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
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).