mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
RISC-V: Clear load reservations on context switch and SC
This prevents a load reservation from being placed in one context/process, then being used in another, resulting in an SC succeeding incorrectly and breaking atomics. Signed-off-by: Joel Sing <joel@sing.id.au> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
591bddea8d
commit
c13b169f1a
3 changed files with 18 additions and 1 deletions
|
@ -297,6 +297,7 @@ static void riscv_cpu_reset(CPUState *cs)
|
|||
env->pc = env->resetvec;
|
||||
#endif
|
||||
cs->exception_index = EXCP_NONE;
|
||||
env->load_res = -1;
|
||||
set_default_nan_mode(1, &env->fp_status);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue