--- zzzz-none-000/linux-3.10.107/arch/arm64/mm/flush.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/arm64/mm/flush.c 2021-02-04 17:41:59.000000000 +0000 @@ -60,19 +60,10 @@ unsigned long uaddr, void *dst, const void *src, unsigned long len) { -#ifdef CONFIG_SMP preempt_disable(); -#endif memcpy(dst, src, len); flush_ptrace_access(vma, page, uaddr, dst, len); -#ifdef CONFIG_SMP preempt_enable(); -#endif -} - -void __flush_dcache_page(struct page *page) -{ - __flush_dcache_area(page_address(page), PAGE_SIZE); } void __sync_icache_dcache(pte_t pte, unsigned long addr) @@ -84,7 +75,8 @@ return; if (!test_and_set_bit(PG_dcache_clean, &page->flags)) { - __flush_dcache_page(page); + __flush_dcache_area(page_address(page), + PAGE_SIZE << compound_order(page)); __flush_icache_all(); } else if (icache_is_aivivt()) { __flush_icache_all(); @@ -106,5 +98,38 @@ /* * Additional functions defined in assembly. */ -EXPORT_SYMBOL(flush_cache_all); EXPORT_SYMBOL(flush_icache_range); + +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +#ifdef CONFIG_HAVE_RCU_TABLE_FREE +void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, + pmd_t *pmdp) +{ + pmd_t pmd = pmd_mksplitting(*pmdp); + + VM_BUG_ON(address & ~PMD_MASK); + set_pmd_at(vma->vm_mm, address, pmdp, pmd); + + /* dummy IPI to serialise against fast_gup */ + kick_all_cpus_sync(); +} +#endif /* CONFIG_HAVE_RCU_TABLE_FREE */ +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ + +void dmac_flush_range(const void *start, const void *end) +{ + __dma_flush_range(start, end); +} +EXPORT_SYMBOL(dmac_flush_range); + +void dmac_inv_range(const void *start, const void *end) +{ + __dma_inv_range(start, end); +} +EXPORT_SYMBOL(dmac_inv_range); + +void dmac_clean_range(const void *start, const void *end) +{ + __dma_clean_range(start, end); +} +EXPORT_SYMBOL(dmac_clean_range);