u-boot-brain/arch
Paul Burton d8b326976a MIPS: Clear instruction hazards in flush_cache()
When writing code, for example during relocation, we ensure that the
icache has a coherent view of the new instructions with a call to
flush_cache(). This handles the bulk of the work to ensure the new
instructions will execute as expected, however it does not ensure that
the CPU pipeline doesn't already contain instructions taken from a stale
view of the affected memory. This could theoretically be a problem for
relocation, but in practice typically isn't because we sync caches for
enough code after the entry point of the newly written code that by the
time the CPU pipeline might possibly fetch any of it we'll have long ago
written it back & invalidated any stale icache entries. This is however
a problem for shorter regions of code.

In preparation for later patches which write shorter segments of code,
ensure any instruction hazards are cleared by flush_cache() by
introducing & using a new instruction_hazard_barrier() function which
makes use of the jr.hb instruction to clear the hazard.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: u-boot@lists.denx.de
2017-11-28 21:59:30 +01:00
..
arc arc: cache: Add required NOPs after invalidation of instruction cache 2017-11-24 19:38:23 +03:00
arm Merge git://www.denx.de/git/u-boot-imx 2017-11-27 07:22:11 -05:00
m68k m68k: Use asm-generic/io.h 2017-10-02 21:52:20 -04:00
microblaze microblaze: Use asm-generic/io.h 2017-10-02 21:52:21 -04:00
mips MIPS: Clear instruction hazards in flush_cache() 2017-11-28 21:59:30 +01:00
nds32 nds32: Use asm-generic/io.h 2017-10-02 21:52:21 -04:00
nios2 nios2: 10m50: Add CPU pre-relocation in device tree 2017-11-17 10:51:24 -05:00
powerpc powerpc: mpc85xx: Implement CPU erratum A-007907 for secondary cores 2017-10-23 14:02:48 -07:00
sandbox sandbox: Add clrbits/setbits macros 2017-11-16 18:45:05 -07:00
sh sh: Use asm-generic/io.h 2017-10-02 21:52:21 -04:00
x86 pylibfdt: compile pylibfdt only when dtoc/binman is necessary 2017-11-17 07:43:32 -05:00
xtensa xtensa: Use asm-generic/io.h 2017-10-02 21:52:22 -04:00
.gitignore .gitignore: drop include/asm/proc from ignore pattern 2014-06-19 11:18:54 -04:00
Kconfig usb: net: migrate USB Ethernet adapters to Kconfig 2017-09-08 10:23:00 -04:00