Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: use asm-generic/cacheflush.h

ARM64 needs almost no cache flushing routines of its own. Rely on
asm-generic/cacheflush.h for the defaults.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: http://lkml.kernel.org/r/20200515143646.3857579-10-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
a7ba1212 43c74ca3

+5 -41
+5 -41
arch/arm64/include/asm/cacheflush.h
··· 94 94 95 95 kick_all_cpus_sync(); 96 96 } 97 - 98 - static inline void flush_cache_mm(struct mm_struct *mm) 99 - { 100 - } 101 - 102 - static inline void flush_cache_page(struct vm_area_struct *vma, 103 - unsigned long user_addr, unsigned long pfn) 104 - { 105 - } 106 - 107 - static inline void flush_cache_range(struct vm_area_struct *vma, 108 - unsigned long start, unsigned long end) 109 - { 110 - } 97 + #define flush_icache_range flush_icache_range 111 98 112 99 /* 113 100 * Cache maintenance functions used by the DMA API. No to be used directly. ··· 110 123 */ 111 124 extern void copy_to_user_page(struct vm_area_struct *, struct page *, 112 125 unsigned long, void *, const void *, unsigned long); 113 - #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 114 - do { \ 115 - memcpy(dst, src, len); \ 116 - } while (0) 117 - 118 - #define flush_cache_dup_mm(mm) flush_cache_mm(mm) 126 + #define copy_to_user_page copy_to_user_page 119 127 120 128 /* 121 129 * flush_dcache_page is used when the kernel has written to the page ··· 136 154 dsb(ish); 137 155 } 138 156 139 - #define flush_dcache_mmap_lock(mapping) do { } while (0) 140 - #define flush_dcache_mmap_unlock(mapping) do { } while (0) 141 - 142 - /* 143 - * We don't appear to need to do anything here. In fact, if we did, we'd 144 - * duplicate cache flushing elsewhere performed by flush_dcache_page(). 145 - */ 146 - #define flush_icache_page(vma,page) do { } while (0) 147 - 148 - /* 149 - * Not required on AArch64 (PIPT or VIPT non-aliasing D-cache). 150 - */ 151 - static inline void flush_cache_vmap(unsigned long start, unsigned long end) 152 - { 153 - } 154 - 155 - static inline void flush_cache_vunmap(unsigned long start, unsigned long end) 156 - { 157 - } 158 - 159 157 int set_memory_valid(unsigned long addr, int numpages, int enable); 160 158 161 159 int set_direct_map_invalid_noflush(struct page *page); 162 160 int set_direct_map_default_noflush(struct page *page); 163 161 164 - #endif 162 + #include <asm-generic/cacheflush.h> 163 + 164 + #endif /* __ASM_CACHEFLUSH_H */