From nobody Thu Nov 6 01:27:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539012806874581.5666800753218; Mon, 8 Oct 2018 08:33:26 -0700 (PDT) Received: from localhost ([::1]:46920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9XX4-0001DR-Rr for importer@patchew.org; Mon, 08 Oct 2018 11:33:18 -0400 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 Received: from mx1.redhat.com ([209.132.183.28]:40776) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9XVz-0006yT-CZ; Mon, 08 Oct 2018 11:32:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FA65307D844; Mon, 8 Oct 2018 15:32:10 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-229.ams2.redhat.com [10.36.117.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 979511001F5D; Mon, 8 Oct 2018 15:32:05 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 8 Oct 2018 17:32:04 +0200 Message-Id: <20181008153204.18845-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 08 Oct 2018 15:32:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] s390x/tcg: always enable AFP for linux-user X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , David Hildenbrand , Cornelia Huck , Alexander Graf , Christian Borntraeger , qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 exc= eptions") Reported-by: Alex Benn=C3=A9e Signed-off-by: David Hildenbrand Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Cornelia Huck Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Tested-by: Alex Benn=C3=A9e Tested-by: Cornelia Huck --- 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