MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 18 Dec 2009 16:40:18 +0000 (16:40 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 20 Feb 2010 16:41:46 +0000 (16:41 +0000)
commit4b3073e1c53a256275f1079c0fbfbe85883d9275
treea0fa98cb75edbbc58c43bbe38ac4c6da0913ae6d
parented42acaef1a9d51631a31b55e9ed52d400430492
MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself

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.

Includes a fix from Stephen Rothwell:

  sparc: fix fallout from update_mmu_cache API change

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
40 files changed:
Documentation/cachetlb.txt
arch/alpha/include/asm/pgtable.h
arch/arm/include/asm/tlbflush.h
arch/arm/mm/fault-armv.c
arch/avr32/include/asm/pgtable.h
arch/avr32/mm/tlb.c
arch/cris/include/asm/pgtable.h
arch/frv/include/asm/pgtable.h
arch/ia64/include/asm/pgtable.h
arch/m32r/include/asm/tlbflush.h
arch/m32r/mm/fault-nommu.c
arch/m32r/mm/fault.c
arch/m68k/include/asm/pgtable_mm.h
arch/microblaze/include/asm/tlbflush.h
arch/mips/include/asm/pgtable.h
arch/mn10300/include/asm/pgtable.h
arch/mn10300/mm/mmu-context.c
arch/parisc/include/asm/pgtable.h
arch/parisc/kernel/cache.c
arch/powerpc/include/asm/pgtable.h
arch/powerpc/mm/mem.c
arch/s390/include/asm/pgtable.h
arch/score/include/asm/pgtable.h
arch/sh/include/asm/pgtable.h
arch/sh/mm/fault_32.c
arch/sparc/include/asm/pgtable_32.h
arch/sparc/include/asm/pgtable_64.h
arch/sparc/mm/fault_32.c
arch/sparc/mm/init_64.c
arch/sparc/mm/nosun4c.c
arch/sparc/mm/srmmu.c
arch/sparc/mm/sun4c.c
arch/um/include/asm/pgtable.h
arch/x86/include/asm/pgtable_32.h
arch/x86/include/asm/pgtable_64.h
arch/xtensa/include/asm/pgtable.h
arch/xtensa/mm/cache.c
mm/hugetlb.c
mm/memory.c
mm/migrate.c