linux/arch/riscv/kernel
Andrew Waterman 08f051eda3 RISC-V: Flush I$ when making a dirty page executable
The RISC-V ISA allows for instruction caches that are not coherent WRT
stores, even on a single hart.  As a result, we need to explicitly flush
the instruction cache whenever marking a dirty page as executable in
order to preserve the correct system behavior.

Local instruction caches aren't that scary (our implementations actually
flush the cache, but RISC-V is defined to allow higher-performance
implementations to exist), but RISC-V defines no way to perform an
instruction cache shootdown.  When explicitly asked to do so we can
shoot down remote instruction caches via an IPI, but this is a bit on
the slow side.

Instead of requiring an IPI to all harts whenever marking a page as
executable, we simply flush the currently running harts.  In order to
maintain correct behavior, we additionally mark every other hart as
needing a deferred instruction cache which will be taken before anything
runs on it.

Signed-off-by: Andrew Waterman <andrew@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2017-11-30 12:58:25 -08:00
..
vdso RISC-V: Add VDSO entries for clock_get/gettimeofday/getcpu 2017-11-27 07:51:39 -08:00
.gitignore RISC-V: Build Infrastructure 2017-09-26 15:26:49 -07:00
asm-offsets.c RISC-V: Task implementation 2017-09-26 15:26:46 -07:00
cacheinfo.c
cpu.c
cpufeature.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
entry.S RISC-V: Task implementation 2017-09-26 15:26:46 -07:00
head.S
irq.c
Makefile RISC-V: Build Infrastructure 2017-09-26 15:26:49 -07:00
module.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
process.c RISC-V: Task implementation 2017-09-26 15:26:46 -07:00
ptrace.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
reset.c
riscv_ksyms.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
setup.c
signal.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
smp.c RISC-V: Flush I$ when making a dirty page executable 2017-11-30 12:58:25 -08:00
smpboot.c
stacktrace.c
sys_riscv.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
syscall_table.c RISC-V: User-facing API 2017-09-26 15:26:48 -07:00
time.c
traps.c
vdso.c
vmlinux.lds.S RISC-V: Build Infrastructure 2017-09-26 15:26:49 -07:00