From patchwork Thu Aug 9 04:21:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 143656 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1601791ljj; Wed, 8 Aug 2018 21:22:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzuCxRUO2/7o6LyzxY0xh5m1XluLj7Kv0ZKgRi2Oh+o0Og1i+L2pV6YNsFlwcJamywZXuiq X-Received: by 2002:ac8:1987:: with SMTP id u7-v6mr455573qtj.296.1533788563873; Wed, 08 Aug 2018 21:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533788563; cv=none; d=google.com; s=arc-20160816; b=xwnd8aui3VPM/c64gVt8Hp8xsyfeBvcX/HxnTq1MvKPu6JVUz/Nst2AzKjyVbesQqo RfVIEAotgFAmm8alTHwRiXqZdvzd53VHMMoqe4udivhh37J51SIgc8rDYIma3mmRFWwB 5gLwhdC6PgIHwABEsvnOz+Lyeo5T4ekMwRCYmBusC+7iuJNJvKSBtj9wWr6tS4qU01oo z+sb4+Wj+oSLsphFuNqkYEF5nT4HWJbN4FrqQiIAJnCJ3tseTEtN4bvGpvrTJ5PPnAy2 /fIhOoVopJLf2CqsaTFlYyWUZZU3UVw+b4v44PPYq04/DtFovd+iw8g6Hlj6UZRNtk+g CbTg== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=megdeTjYGDi91jW7S3Vt/13VC1dSMwSCHADtSBmt828=; b=xuW7cEcZIDRanHSWCmEjAYTiA5R0OzJyTgChI0S76JFKdZEfcqxOd/yMDlko3ES8VR JWnd2E1GR/bI70kPbHE6uk87Txq/toyfCCxqA67xbVnG6tQVXH4tM6O2xJ0eoG6yf15M f9WCcbnCw7XDKGUJ0qiggfQXGeu9WppGv/tY8u0HR98tpUL2XLZN7KOz9KLTxuVug9lW m7EDuVSkhI/3G38tAJVZRYWhb9j+U3Bp/NiKjPS1nCxqNdguq+C889ecvBIrfjuPRRyL +Qt/zgxtPFAt+ei8EbO5jnBVLvnjTHPpIFeNbk5g1LYtuYVnSJTaXMzdgEIBpH6gnLkS fE2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OCfbar2s; 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 m24-v6si6088116qkl.241.2018.08.08.21.22.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Aug 2018 21:22:43 -0700 (PDT) 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=OCfbar2s; 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]:47226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncTD-0000jS-AY for patch@linaro.org; Thu, 09 Aug 2018 00:22:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncSk-0000i8-1G for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fncSi-00077U-VJ for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:14 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:43992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fncSi-00076q-Nh for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:12 -0400 Received: by mail-pl0-x244.google.com with SMTP id x6-v6so1972192plv.10 for ; Wed, 08 Aug 2018 21:22:12 -0700 (PDT) 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; bh=megdeTjYGDi91jW7S3Vt/13VC1dSMwSCHADtSBmt828=; b=OCfbar2s3AvvtrRP2flIyuJebUWgnz4OsnW0S0NCUTAnucXZcf8umReYanVR0GznoY dR7QZedSuwvcne4ZAaoLiKzJOWw/pFipah8nrwnf+d5szluxhEtmOfU047tPHtBy8Y6O IpdENAjxiNrQiSwXCwno1sIqbwaP2enuXtBEQ= 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; bh=megdeTjYGDi91jW7S3Vt/13VC1dSMwSCHADtSBmt828=; b=soJ+BSAUNXCdMmpu+YDun/NM0y51iZNPPKbWiXAedCFI63PS8BChxEFVXINXDwtRRx tmr7WzpFkeTCLH/V6n01CNYoyOmP9Rajfpgq2vL5BWFWR6+WQ33u4MdA9TFoVNrrh1ql yQ4DdSTFror2oljfak4cykl9oRKuyI6L1hLwl25kZIVHlg1s+MItQLDodpzjIqxBTOry v+f0GgJVrXEWSCpULwbelmU+vGrSpTh6Ix3h24vFyxWNSS2UC1BO/qEhDPp85r79pRND Z+n1iGJCqxQuBAB3ub5uGb1wFkpHlPmXW6biyvfBYbBIFjF6kJjpz0QualUjOs25Y4Jb YxPA== X-Gm-Message-State: AOUpUlFKmldz7tv4uRYxhK2OG3VdG+KT4K7xl5S2R7wccQY0+FAbfR1k x+IsEBV6YsvBYcH7ovSgrUzUtNtABjg= X-Received: by 2002:a17:902:163:: with SMTP id 90-v6mr501677plb.322.1533788531458; Wed, 08 Aug 2018 21:22:11 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id m30-v6sm7355799pff.121.2018.08.08.21.22.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Aug 2018 21:22:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 21:21:48 -0700 Message-Id: <20180809042206.15726-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809042206.15726-1-richard.henderson@linaro.org> References: <20180809042206.15726-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH 02/20] target/arm: Set ID_AA64PFR0 bits for SVE for -cpu max 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: laurent.desnogues@gmail.com, peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This it a hair out of spec in that we have and advertise, support for fp16 in aarch64 mode, but do not have nor advertise the same in aarch32 mode. Rationale as commented. Signed-off-by: Richard Henderson --- target/arm/cpu64.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 4d629bb99b..ae650b608e 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -282,15 +282,24 @@ static void aarch64_max_initfn(Object *obj) cpu->id_aa64isar1 = deposit64(cpu->id_aa64isar1, 16, 4, 1); cpu->id_isar5 = deposit32(cpu->id_isar5, 28, 4, 1); -#ifdef CONFIG_USER_ONLY - /* We don't set these in system emulation mode for the moment, - * since we don't correctly set the ID registers to advertise them, - * and in some cases they're only available in AArch64 and not AArch32, - * whereas the architecture requires them to be present in both if - * present in either. + /* TODO: This is not yet implemented for AArch32, whereas the + * architecture requires a feature to be present in both if + * it is present in either. However, it is required by SVE, + * so we don't want to leave it out of AArch64 state. + * + * Practically, the Linux kernel does not query the MVFR1 bit + * nor expose this as a HWCAP bit to AArch32 userland. Thus + * userland, if it wanted to use fp16, would have to probe for + * support by executing an insn and checking for SIGILL. + * At which point it will get the correct answer: unsupported. */ set_feature(&cpu->env, ARM_FEATURE_V8_FP16); + cpu->id_aa64pfr0 = deposit64(cpu->id_aa64pfr0, 20, 4, 1); + set_feature(&cpu->env, ARM_FEATURE_SVE); + cpu->id_aa64pfr0 = deposit64(cpu->id_aa64pfr0, 32, 4, 1); + +#ifdef CONFIG_USER_ONLY /* For usermode -cpu max we can use a larger and more efficient DCZ * blocksize since we don't have to follow what the hardware does. */