···13131414#include <asm/cacheflush.h>1515#include <asm/system.h>1616+#include <asm/tlbflush.h>1717+1818+#ifdef CONFIG_CPU_CACHE_VIPT1919+#define ALIAS_FLUSH_START 0xffff40002020+2121+#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)2222+2323+static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)2424+{2525+ unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);2626+2727+ set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));2828+ flush_tlb_kernel_page(to);2929+3030+ asm( "mcrr p15, 0, %1, %0, c14\n"3131+ " mcrr p15, 0, %1, %0, c5\n"3232+ :3333+ : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES)3434+ : "cc");3535+}3636+#else3737+#define flush_pfn_alias(pfn,vaddr) do { } while (0)3838+#endif16391740static void __flush_dcache_page(struct address_space *mapping, struct page *page)1841{···6037 return;61386239 /*4040+ * This is a page cache page. If we have a VIPT cache, we4141+ * only need to do one flush - which would be at the relevant4242+ * userspace colour, which is congruent with page->index.4343+ */4444+ if (cache_is_vipt()) {4545+ if (cache_is_vipt_aliasing())4646+ flush_pfn_alias(page_to_pfn(page),4747+ page->index << PAGE_CACHE_SHIFT);4848+ return;4949+ }5050+5151+ /*6352 * There are possible user space mappings of this page:6453 * - VIVT cache: we need to also write back and invalidate all user6554 * data in the current VM view associated with this page.···9257 continue;9358 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;9459 flush_cache_page(mpnt, mpnt->vm_start + offset, page_to_pfn(page));9595- if (cache_is_vipt())9696- break;9760 }9861 flush_dcache_mmap_unlock(mapping);9962}