Commit 53a19a9a authored by David Hildenbrand's avatar David Hildenbrand Committed by Peter Maydell
Browse files

s390x/tcg: always enable AFP for linux-user



linux-user should always enable AFP, otherwise our emulated binary
might crash once it tries to make use of additional floating-point
registers or instructions.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Alex Bennée <alex.bennee@linaro.org>
Fixes: db050415 ("s390x/tcg: check for AFP-register, BFP and DFP data exceptions")
Reported-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Tested-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Tested-by: default avatarCornelia Huck <cohuck@redhat.com>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 7c69b7c8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -145,6 +145,11 @@ static void s390_cpu_full_reset(CPUState *s)
    env->cregs[0] = CR0_RESET;
    env->cregs[14] = CR14_RESET;

#if defined(CONFIG_USER_ONLY)
    /* user mode should always be allowed to use the full FPU */
    env->cregs[0] |= CR0_AFP;
#endif

    /* architectured initial value for Breaking-Event-Address register */
    env->gbea = 1;