aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-07-20 20:24:40 -0400
committerMax Filippov <jcmvbkbc@gmail.com>2014-08-14 03:59:23 -0400
commit270eec76de2557c9df01d74bc4c948d0924fc007 (patch)
tree6ae217d32d6bf41bf2b43fed7898d9e0fecbffc4
parent8504b503dfa86f698a38f9ee1fc2876ab012b776 (diff)
xtensa: support highmem in aliasing cache flushing code
Use __flush_invalidate_dcache_page_alias with alias set to color of the page physical address instead of __flush_invalidate_dcache_page: this works for high memory pages and mapping/unmapping to the TLBTEMP area is virtually free. Allow building configurations with aliasing cache and highmem enabled. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--arch/xtensa/mm/cache.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c
index 96aea6624318..d75aa1476da7 100644
--- a/arch/xtensa/mm/cache.c
+++ b/arch/xtensa/mm/cache.c
@@ -59,10 +59,6 @@
59 * 59 *
60 */ 60 */
61 61
62#if (DCACHE_WAY_SIZE > PAGE_SIZE) && defined(CONFIG_HIGHMEM)
63#error "HIGHMEM is not supported on cores with aliasing cache."
64#endif
65
66#if (DCACHE_WAY_SIZE > PAGE_SIZE) 62#if (DCACHE_WAY_SIZE > PAGE_SIZE)
67static inline void kmap_invalidate_coherent(struct page *page, 63static inline void kmap_invalidate_coherent(struct page *page,
68 unsigned long vaddr) 64 unsigned long vaddr)
@@ -166,7 +162,8 @@ void flush_dcache_page(struct page *page)
166 if (!alias && !mapping) 162 if (!alias && !mapping)
167 return; 163 return;
168 164
169 __flush_invalidate_dcache_page((long)page_address(page)); 165 virt = TLBTEMP_BASE_1 + (phys & DCACHE_ALIAS_MASK);
166 __flush_invalidate_dcache_page_alias(virt, phys);
170 167
171 virt = TLBTEMP_BASE_1 + (temp & DCACHE_ALIAS_MASK); 168 virt = TLBTEMP_BASE_1 + (temp & DCACHE_ALIAS_MASK);
172 169
@@ -231,13 +228,12 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep)
231#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK 228#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
232 229
233 if (!PageReserved(page) && test_bit(PG_arch_1, &page->flags)) { 230 if (!PageReserved(page) && test_bit(PG_arch_1, &page->flags)) {
234
235 unsigned long paddr = (unsigned long) page_address(page);
236 unsigned long phys = page_to_phys(page); 231 unsigned long phys = page_to_phys(page);
237 unsigned long tmp = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK); 232 unsigned long tmp;
238
239 __flush_invalidate_dcache_page(paddr);
240 233
234 tmp = TLBTEMP_BASE_1 + (phys & DCACHE_ALIAS_MASK);
235 __flush_invalidate_dcache_page_alias(tmp, phys);
236 tmp = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK);
241 __flush_invalidate_dcache_page_alias(tmp, phys); 237 __flush_invalidate_dcache_page_alias(tmp, phys);
242 __invalidate_icache_page_alias(tmp, phys); 238 __invalidate_icache_page_alias(tmp, phys);
243 239