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

[MIPS] Use real cache invalidate

R10k non coherent machines need a real dma cache invalidate to get rid of
speculative stores in cache. For other machines this promises a slight
speedup.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Thomas Bogendoerfer and committed by
Ralf Baechle
e9c33572 87353d8a

+9 -2
+2 -2
arch/mips/mm/c-r4k.c
··· 589 589 if (size >= scache_size) 590 590 r4k_blast_scache(); 591 591 else 592 - blast_scache_range(addr, addr + size); 592 + blast_inv_scache_range(addr, addr + size); 593 593 return; 594 594 } 595 595 ··· 597 597 r4k_blast_dcache(); 598 598 } else { 599 599 R4600_HIT_CACHEOP_WAR_IMPL; 600 - blast_dcache_range(addr, addr + size); 600 + blast_inv_dcache_range(addr, addr + size); 601 601 } 602 602 603 603 bc_inv(addr, size);
+7
include/asm-mips/r4kcache.h
··· 403 403 __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) 404 404 __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) 405 405 406 + __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16) 407 + __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32) 408 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16) 409 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32) 410 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64) 411 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128) 412 + 406 413 /* build blast_xxx_range, protected_blast_xxx_range */ 407 414 #define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \ 408 415 static inline void prot##blast_##pfx##cache##_range(unsigned long start, \