Re: [CFT] MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself

From: Geert Uytterhoeven
Date: Wed Jan 20 2010 - 11:45:44 EST


On Wed, Jan 20, 2010 at 14:52, Russell King <rmk+lkml@xxxxxxxxxxxxxxxx> wrote:
> On VIVT ARM, when we have multiple shared mappings of the same file
> in the same MM, we need to ensure that we have coherency across all
> copies. ÂWe do this via make_coherent() by making the pages
> uncacheable.
>
> This used to work fine, until we allowed highmem with highpte - we
> now have a page table which is mapped as required, and is not available
> for modification via update_mmu_cache().
>
> Ralf Beache suggested getting rid of the PTE value passed to
> update_mmu_cache():
>
> ÂOn MIPS update_mmu_cache() calls __update_tlb() which walks pagetables
> Âto construct a pointer to the pte again. ÂPassing a pte_t * is much
> Âmore elegant. ÂMaybe we might even replace the pte argument with the
> Âpte_t?
>
> Ben Herrenschmidt would also like the pte pointer for PowerPC:
>
> ÂPassing the ptep in there is exactly what I want. ÂI want that
> Â-instead- of the PTE value, because I have issue on some ppc cases,
> Âfor I$/D$ coherency, where set_pte_at() may decide to mask out the
> Â_PAGE_EXEC.
>
> So, pass in the mapped page table pointer into update_mmu_cache(), and
> remove the PTE value, updating all implementations and call sites to
> suit.

> diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt
> index da42ab4..74a8b6f 100644
> --- a/Documentation/cachetlb.txt
> +++ b/Documentation/cachetlb.txt
> @@ -88,12 +88,12 @@ changes occur:
> Â Â Â ÂThis is used primarily during fault processing.
>
> Â5) void update_mmu_cache(struct vm_area_struct *vma,
> - Â Â Â Â Â Â Â Â Â Â Â Âunsigned long address, pte_t pte)
> + Â Â Â Â Â Â Â Â Â Â Â Âunsigned long address, pte_t *ptep)
>
> Â Â Â ÂAt the end of every page fault, this routine is invoked to
> Â Â Â Âtell the architecture specific code that a translation
> - Â Â Â described by "pte" now exists at virtual address "address"
> - Â Â Â for address space "vma->vm_mm", in the software page tables.
> + Â Â Â now exists at virtual address "address" for address space
> + Â Â Â "vma->vm_mm", in the software page tables.
>
> Â Â Â ÂA port may use this information in any way it so chooses.
> Â Â Â ÂFor example, it could use this event to pre-load TLB

Now the documentation no longer mentions what the 3rd parameter is used for?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/