Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348722

Re: [4/4] MIPS: Sync icache & dcache in set_pte_at

From Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Newsgroups linux.kernel
Subject Re: [4/4] MIPS: Sync icache & dcache in set_pte_at
Date 2016-03-03 04:10 +0100
Message-ID <r8rOi-I0-9@gated-at.bofh.it> (permalink)
References <r8fN8-l3-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Paul Burton wrote:

> It is, however, used in such a way by others & seems to me like the only
> correct way to implement the lazy cache flushing. The alternative would
> be to adjust all generic code to ensure flush_icache_page gets called
> before set_pte_at

... which is an exact case right now. Both calls of flush_icache_page() are:

1) do_swap_page()

         flush_icache_page(vma, page);
         if (pte_swp_soft_dirty(orig_pte))
                 pte = pte_mksoft_dirty(pte);
         set_pte_at(mm, address, page_table, pte);
...

2) do_set_pte()

         flush_icache_page(vma, page);
         entry = mk_pte(page, vma->vm_page_prot);
         if (write)
                 entry = maybe_mkwrite(pte_mkdirty(entry), vma);
         if (anon) {
                 inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES);
                 page_add_new_anon_rmap(page, vma, address);
         } else {
                 inc_mm_counter_fast(vma->vm_mm, MM_FILEPAGES);
                 page_add_file_rmap(page);
         }
         set_pte_at(vma->vm_mm, address, pte, entry);

         /* no need to invalidate: a not-present page won't be cached */
         update_mmu_cache(vma, address, pte);
....

You should only be sure that flush_icache_page() completes a lazy 
D-cache flush.

- Leonid.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [4/4] MIPS: Sync icache & dcache in set_pte_at Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> - 2016-03-03 04:10 +0100

csiph-web