From patchwork Mon Oct 8 15:32:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 980639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42TPWG6Px7z9sj2 for ; Tue, 9 Oct 2018 02:32:41 +1100 (AEDT) Received: from localhost ([::1]:46916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9XWP-0000tW-NL for incoming@patchwork.ozlabs.org; Mon, 08 Oct 2018 11:32:37 -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) 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_Benn?= =?utf-8?b?w6ll?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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] = 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;