]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/riscv: Disable guest FP support based on virtual status
authorAlistair Francis <alistair.francis@wdc.com>
Sat, 1 Feb 2020 01:02:44 +0000 (17:02 -0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Thu, 27 Feb 2020 21:45:47 +0000 (13:45 -0800)
When the Hypervisor extension is in use we only enable floating point
support when both status and vsstatus have enabled floating point
support.

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_helper.c

index 895b6ca25ddf1f63f51eea8864b63bad9272936f..d9a29d702ac224cb53da7031b05e22b405dedfea 100644 (file)
@@ -99,6 +99,9 @@ bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
 bool riscv_cpu_fp_enabled(CPURISCVState *env)
 {
     if (env->mstatus & MSTATUS_FS) {
+        if (riscv_cpu_virt_enabled(env) && !(env->mstatus_hs & MSTATUS_FS)) {
+            return false;
+        }
         return true;
     }