From patchwork Thu Feb 8 17:31:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 127692 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1711707ljc; Thu, 8 Feb 2018 09:42:01 -0800 (PST) X-Google-Smtp-Source: AH8x2246n1I5/3g1DKayxwBZxGnY1iLHCBYkTTgbWt2fhw7lHuQxhKEfM9ok1Sydvcfmb3Eiczz8 X-Received: by 10.37.185.195 with SMTP id y3mr1123663ybj.7.1518111721485; Thu, 08 Feb 2018 09:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518111721; cv=none; d=google.com; s=arc-20160816; b=m/c1cjQbTqlm+Pin1uWOC7bb9DUYeSb+qJkwXX3M0BSko6aq2xlxGxfhEYtDknYxNr E5wtpUaMp5yPz6DdaQWV6X72twkI+i6lfXpVNuQ9uY2Zt52+iuK9TjKpXePoB75uygi4 voptyUR7EoKDtJ6pTfKdSlTzyVubXj0Qf3ZXuzAlIFimrNqdxdvM6wxy2usjNfnOHJ7y CuyIozPrycX50tidNDHaioHHzuALCmCNQaJoxg0Fv7222e3jUOyvNoZjptg1nHETJijl OQbgGbdkzxjBTLLijlWhPIq1T//eSQh5cql+GNeX/YAMShNf9pIKSxtTIUqBDWYgx+qQ KEfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=xy+BqTsxwQYHxuAigXd/mT01GPZdBWUZ1Bw2X5bjo58=; b=koRoG4pQuQIrTvY9CgvsSkd4gKhMftnYIV0+fXkKDiEFq1fnuLvu3LuXlyLOZihkOR HGXm6WgwJqEudc8HfvQIDKTvAXbpNaGFdfdqoaY8GmNQjZzEsfEq1y/Z2rEWcU2J+OQR yLTKebUf3IRTJU/FOzKFbQGvgfG0LGI97hX+qOBAvy4ZAC0PDh69nAKJdM6AUbMhLAyB DRtTF8u2kbUBspM+tHfL1jHmdR+wWKfIQRT54B30l450FQImF+2BulSxr2uhhwymW9a4 HacbTp4qhlJJFtIS6yifkjMQKeF5p9aORCzht9/RxIVVYzBiWMfwkJVPhmPR7bwV6FqR tVOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IqGcBGWu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y8si77027ywa.330.2018.02.08.09.42.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Feb 2018 09:42:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IqGcBGWu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqCu-00043P-So for patch@linaro.org; Thu, 08 Feb 2018 12:42:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejq3I-0003Eq-R0 for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:32:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejq3H-0006S2-IL for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:32:04 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:52157) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejq3H-0006Qr-Cy for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:32:03 -0500 Received: by mail-wm0-x244.google.com with SMTP id r71so10968235wmd.1 for ; Thu, 08 Feb 2018 09:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xy+BqTsxwQYHxuAigXd/mT01GPZdBWUZ1Bw2X5bjo58=; b=IqGcBGWuQnPiXZmW1TcU/zwFAjoUSlOwwVie/OvuYDJwVElmt296HUDqthZfXl2o0W +9uvFdfWpQ1k6h3JfYEQx4U58qiAzPcs9U32Bw8iWJHK9K4B8A4nYN5HlP8JRvKClFZ3 mwy3UVC8u9VlcLWnDCFK56k7H9JJ8vtLaUEDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xy+BqTsxwQYHxuAigXd/mT01GPZdBWUZ1Bw2X5bjo58=; b=tGNdweFpZZh3jwI1/hP48NITZu0fQDUhTnrmBd3QegRtryJJF9p6/58I1quz3xZ9PO RJgzVuShXmewfjtK9k9ik5tl64rTraG0JWNQTcmidbDOc6bjw3y/dasilRsubSTyTFTr +b5VrhLOQzNg9cNBPfyHAnAnfuXjCExmcha3ane2DDxmoSRD3d9r9Xw9+zqFIbd0kKz5 X2QTeC84aMkZdwNj/eos49mOa7Y5CEYJnJpodxvnQGQQqVbaqUndRnbnr8MjWpH1sEfo 2ciydblLK66Y/IE/wN9kQ2tOfSLLMHavY9xrU9XB0s9PV8zb/TPY1jHgVZVtIr0SC1rH 5MmQ== X-Gm-Message-State: APf1xPAeqEAgfYuHvh04EYGugoZPKRFtgUi3qOFKTekkWHiTUw1hNQeE 2fDWOGH1ab2fHtwZaM27T7C1Pg== X-Received: by 10.28.45.74 with SMTP id t71mr39114wmt.90.1518111122250; Thu, 08 Feb 2018 09:32:02 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y90sm623333wrc.24.2018.02.08.09.31.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 09:32:00 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EC1BF3E0BB7; Thu, 8 Feb 2018 17:31:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Thu, 8 Feb 2018 17:31:28 +0000 Message-Id: <20180208173157.24705-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180208173157.24705-1-alex.bennee@linaro.org> References: <20180208173157.24705-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v2 03/32] target/arm/cpu64: allow fp16 to be disabled 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 , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While for CONFIG_USER_ONLY it is policy for the "cpu" to be the most capable is can be this does cause problems. For example legacy RISU runs would fail as there are a bunch of implemented instructions which would have caused failures that now trigger actual calculations. Signed-off-by: Alex Bennée --- target/arm/cpu64.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) -- 2.15.1 Reviewed-by: Richard Henderson diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 973614dfc6..0dc4debd9c 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -275,6 +275,26 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool value, Error **errp) } } +#ifdef CONFIG_USER_ONLY +static bool aarch64_cpu_get_fp16(Object *obj, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + + return arm_feature(&cpu->env, ARM_FEATURE_V8_FP16); +} + +static void aarch64_cpu_set_fp16(Object *obj, bool value, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + + if (value == false) { + unset_feature(&cpu->env, ARM_FEATURE_V8_FP16); + } else { + set_feature(&cpu->env, ARM_FEATURE_V8_FP16); + } +} +#endif + static void aarch64_cpu_initfn(Object *obj) { object_property_add_bool(obj, "aarch64", aarch64_cpu_get_aarch64, @@ -283,6 +303,13 @@ static void aarch64_cpu_initfn(Object *obj) "Set on/off to enable/disable aarch64 " "execution state ", NULL); +#ifdef CONFIG_USER_ONLY + object_property_add_bool(obj, "fp16", aarch64_cpu_get_fp16, + aarch64_cpu_set_fp16, NULL); + object_property_set_description(obj, "fp16", + "Set on/off to enable/disable FP16 extensions ", + NULL); +#endif } static void aarch64_cpu_finalizefn(Object *obj)