On Tue, Jan 14, 2020 at 11:29 PM Richard Henderson <
richard.hender...@linaro.org> wrote:
> On 1/14/20 12:13 AM, shihpo.h...@sifive.com wrote:
> > if (riscv_cpu_fp_enabled(env)) {
> > -*flags |= TB_FLAGS_MSTATUS_FS;
> > +*flags |= env->mstatus & MSTATUS_FS;
> > }
>
> Note
On 1/14/20 12:13 AM, shihpo.h...@sifive.com wrote:
> if (riscv_cpu_fp_enabled(env)) {
> -*flags |= TB_FLAGS_MSTATUS_FS;
> +*flags |= env->mstatus & MSTATUS_FS;
> }
Note that riscv_cpu_fp_enabled is *also* testing env->mstatus, and that this
assignment can be made uncondit
It was found that running libquantum on riscv-linux qemu produced an
incorrect result. After investigation, FP registers are not saved
during context switch due to incorrect mstatus.FS.
In current implementation tb->flags merges all non-disabled state to
dirty. This means the code in mark_fs_dirty