From: David Hildenbrand Date: Mon, 8 Oct 2018 15:32:04 +0000 (+0200) Subject: s390x/tcg: always enable AFP for linux-user X-Git-Tag: qemu-xen-4.13.0-rc1~630 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=53a19a9a5f9811a911e9b69ef36afb0d66b5d85c;p=qemu-xen.git 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 Cc: Alex Bennée Fixes: db0504154e ("s390x/tcg: check for AFP-register, BFP and DFP data exceptions") Reported-by: Alex Bennée Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Tested-by: Alex Bennée Reviewed-by: Cornelia Huck Tested-by: Cornelia Huck Signed-off-by: Peter Maydell --- diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 8ed4823d6e..18ba7f85a5 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -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;