]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/riscv: Only set TB flags with FP status if enabled
authorAlistair Francis <alistair.francis@wdc.com>
Sat, 1 Feb 2020 01:02:41 +0000 (17:02 -0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Thu, 27 Feb 2020 21:45:46 +0000 (13:45 -0800)
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
target/riscv/cpu.h

index 5b889a00657f1a3c13635a2a5a01e7f235f2b49a..aa04e5cca71eea7b40239f23d4549437b9a77592 100644 (file)
@@ -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
 }