]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Set mstatus_hs.[SD|FS] bits if Clean and V=1 in mark_fs_dirty()
authorFrank Chang <frank.chang@sifive.com>
Tue, 21 Sep 2021 02:02:33 +0000 (10:02 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 6 Oct 2021 22:41:33 +0000 (08:41 +1000)
commita88f0402391e9075df774affe5482d1286b9237e
treea42ab27c699c3470e42bf71becc0e7e19413479c
parent02c1b569a15b4b06a3c69b6cb1713830a29cb01f
target/riscv: Set mstatus_hs.[SD|FS] bits if Clean and V=1 in mark_fs_dirty()

When V=1, both vsstauts.FS and HS-level sstatus.FS are in effect.
Modifying the floating-point state when V=1 causes both fields to
be set to 3 (Dirty).

However, it's possible that HS-level sstatus.FS is Clean and VS-level
vsstatus.FS is Dirty at the time mark_fs_dirty() is called when V=1.
We can't early return for this case because we still need to set
sstatus.FS to Dirty according to spec.

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Vincent Chen <vincent.chen@sifive.com>
Tested-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210921020234.123448-1-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.h
target/riscv/translate.c