From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9XW3-0000tE-OO for qemu-devel@nongnu.org; Mon, 08 Oct 2018 11:32:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9XVz-0006yz-MA for qemu-devel@nongnu.org; Mon, 08 Oct 2018 11:32:15 -0400 From: David Hildenbrand Date: Mon, 8 Oct 2018 17:32:04 +0200 Message-Id: <20181008153204.18845-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] s390x/tcg: always enable AFP for linux-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Christian Borntraeger , Cornelia Huck , Richard Henderson , Alexander Graf , David Hildenbrand , Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= 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=C3=A9e Fixes: db0504154e ("s390x/tcg: check for AFP-register, BFP and DFP data e= xceptions") Reported-by: Alex Benn=C3=A9e Signed-off-by: David Hildenbrand --- target/s390x/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) 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] =3D CR0_RESET; env->cregs[14] =3D CR14_RESET; =20 +#if defined(CONFIG_USER_ONLY) + /* user mode should always be allowed to use the full FPU */ + env->cregs[0] |=3D CR0_AFP; +#endif + /* architectured initial value for Breaking-Event-Address register *= / env->gbea =3D 1; =20 --=20 2.17.1