From: Alistair Francis Date: Sat, 1 Feb 2020 01:02:41 +0000 (-0800) Subject: target/riscv: Only set TB flags with FP status if enabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e28eaed87902c5e852c3ed043b27204e879aa4e2;p=qemu.git target/riscv: Only set TB flags with FP status if enabled Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 5b889a0065..aa04e5cca7 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -332,7 +332,10 @@ static inline void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc, #ifdef CONFIG_USER_ONLY *flags = TB_FLAGS_MSTATUS_FS; #else - *flags = cpu_mmu_index(env, 0) | (env->mstatus & MSTATUS_FS); + *flags = cpu_mmu_index(env, 0); + if (riscv_cpu_fp_enabled(env)) { + *flags |= env->mstatus & MSTATUS_FS; + } #endif }