diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2007-10-16 04:25:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:59 -0400 |
commit | 954ffcb35f5aca428661d29b96c4eee82b3c19cd (patch) | |
tree | 2dd8aaf26a8ae81b461b6d5d824ae8744690e483 /arch | |
parent | 97ee052461446526e1de7236497e6f1b1ffedf8c (diff) |
flush icache before set_pte() on ia64: flush icache at set_pte
Current ia64 kernel flushes icache by lazy_mmu_prot_update() *after*
set_pte(). This is too late. This patch removes lazy_mmu_prot_update and
add modfied set_pte() for flushing if necessary.
This patch flush icache of a page when
new pte has exec bit.
&& new pte has present bit
&& new pte is user's page.
&& (old *ptep is not present
|| new pte's pfn is not same to old *ptep's ptn)
&& new pte's page has no Pg_arch_1 bit.
Pg_arch_1 is set when a page is cache consistent.
I think this condition checks are much easier to understand than considering
"Where sync_icache_dcache() should be inserted ?".
pte_user() for ia64 was removed by http://lkml.org/lkml/2007/6/12/67 as
clean-up. So, I added it again.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/mm/init.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index c14abefabafa..a096b30734f3 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -54,15 +54,12 @@ struct page *zero_page_memmap_ptr; /* map entry for zero page */ | |||
54 | EXPORT_SYMBOL(zero_page_memmap_ptr); | 54 | EXPORT_SYMBOL(zero_page_memmap_ptr); |
55 | 55 | ||
56 | void | 56 | void |
57 | lazy_mmu_prot_update (pte_t pte) | 57 | __ia64_sync_icache_dcache (pte_t pte) |
58 | { | 58 | { |
59 | unsigned long addr; | 59 | unsigned long addr; |
60 | struct page *page; | 60 | struct page *page; |
61 | unsigned long order; | 61 | unsigned long order; |
62 | 62 | ||
63 | if (!pte_exec(pte)) | ||
64 | return; /* not an executable page... */ | ||
65 | |||
66 | page = pte_page(pte); | 63 | page = pte_page(pte); |
67 | addr = (unsigned long) page_address(page); | 64 | addr = (unsigned long) page_address(page); |
68 | 65 | ||