From patchwork Thu Aug 9 04:21:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 143658 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1603584ljj; Wed, 8 Aug 2018 21:25:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxCP+lsZwPaJFFYieG2SNJZz4eQ/KM8fAkKpxhyKdoXvQ4/9JfRncYg+ReHf/DhKkEA82op X-Received: by 2002:a37:9404:: with SMTP id w4-v6mr413827qkd.50.1533788706809; Wed, 08 Aug 2018 21:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533788706; cv=none; d=google.com; s=arc-20160816; b=irqpYJSfx256jpEgzq4QQMFo61bAHH+A2nDpZtFUBPifVMWVuP+iooIVwiPjjFKJkM 8HpN9Qf+2Sp5AvYeXMpc+1hts4KmI1SmcuKow4bG7fj/2AGIvs/cwK/ezXSIr3h7MqdD e7xOnUV2Z4uT4y4kehWm8RkKbMNtc/elMHFKjA1wEK7P+DNBXqI4+Qqn9e0onaAgkpCq 682TGqHXie+A9HLlNtJd1ItKh6Tzd2eojwuaxfYiug4eIkrbTmYZ94ksY+y9JZcBYsbh 2ETuED3shWxzssUDqY1yVxTqfu/ZhedPuPqYmQGMZ4Ag8bbKeddBPx+yQJfw1xozbqIE 4ftw== 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=mhyzR8Zi3Rp/BTnv7kPW11xxhgksRqlAPA2BPWvADYw=; b=iM9BeZQyEQ7XGhSizSuV0zo2WkT5JltWZ/U0CXaYO5UcrHMh8bc1zVwk8q0BYjEg/U bQ9cKqWt12ByciU/1qRtqcwvGpx1cYKqsZuX+tKSsxgqpe7tj1sNJ885827On3ugcexi mp1JQwkSUI6ViLWH7k7RKuEcXvTI9CqFePfovemLTaamAtzeFgIMJxAfu6k+2bQP4OBO AvwiW7x2d/JKyuMUOa+YJY0RWBv013uq2C5dS94DpKOu4bbc1eCmTzPYpYO8anJrlm4h NbP0+OEZZFpc5tjL6qMS7sJ/xapBMk5SqKYKJz5hfeNWi24QZqGz9QwGQLf2IIecCS8U XFXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fIF0bqpD; 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 e60-v6si1963839qtb.145.2018.08.08.21.25.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Aug 2018 21:25:06 -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=fIF0bqpD; 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]:47231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncVW-0001vs-7f for patch@linaro.org; Thu, 09 Aug 2018 00:25:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncSj-0000i7-WA for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fncSh-000765-GT for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:13 -0400 Received: from mail-pl0-x22d.google.com ([2607:f8b0:400e:c01::22d]:36213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fncSh-00075A-86 for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:11 -0400 Received: by mail-pl0-x22d.google.com with SMTP id e11-v6so1983787plb.3 for ; Wed, 08 Aug 2018 21:22:11 -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=mhyzR8Zi3Rp/BTnv7kPW11xxhgksRqlAPA2BPWvADYw=; b=fIF0bqpDFVPskLNwzauX8/faeSLwEVcQH3ZBDNxRZrsIj8wJohhzJ1lg1ljcCewTwI 1emE/bfdHs4nnGIXi2jboOHjLhfw9x1S1cbiRHbUOwqdAoDTuicigKfBEvbcCqNVRUXy 3LAA2nYhXQmGW5icuNdmLyU+ULurspIwo8oWo= 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=mhyzR8Zi3Rp/BTnv7kPW11xxhgksRqlAPA2BPWvADYw=; b=cPYouqwux++YO5f0pYN0RrESUmdCiubaMIQ0iXunE/sG+vNmPhj9T28M13L0HymKPo ALaNSnZoT23g22ta5tX9wfpt5a6iJ30A+WMFy8qowhqjbgTaNZH8VzLzmEJ3q30VvIvw Rm+p2KSjSAdTUSb6hG4mi2bkOIdw3LUBk9lUseEmz81W2lb6dSNnIGIFWWQZ471WDyQn E/ByoyguPh5DNn5jdBkvTYKqaR3kJhjZ2AOxECmsPFrwMttE9+j0BSgcgRnZVqnGO8M/ EsVSU3A5Dk7vgDg+Sq4dO1VlBghQ1hnJys7NGLEyE7xAR1fbldtzxNvqMrXH8hyPJo+C 7nJw== X-Gm-Message-State: AOUpUlE+rNONkjtx+tgCNyBOC+I1QcDWP0TFORzO7t8li/LMZU/mVJDW a+gF8SY/C2b+7w+3JiQA55VKQm/EgW0= X-Received: by 2002:a17:902:b784:: with SMTP id e4-v6mr503387pls.185.1533788529963; Wed, 08 Aug 2018 21:22:09 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Aug 2018 21:22:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 21:21:47 -0700 Message-Id: <20180809042206.15726-2-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::22d Subject: [Qemu-devel] [PATCH 01/20] target/arm: Set ISAR bits 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" For the supported extensions, fill in the appropriate bits in ID_ISAR5, ID_ISAR6, ID_AA64ISAR0, ID_AA64ISAR1. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 24 +++++++++++++++++------- target/arm/cpu64.c | 36 ++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b25898ed4c..71daa39e86 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1802,19 +1802,29 @@ static void arm_max_initfn(Object *obj) kvm_arm_set_cpu_features_from_host(cpu); } else { cortex_a15_initfn(obj); + + set_feature(&cpu->env, ARM_FEATURE_V8_AES); + cpu->id_isar5 = deposit32(cpu->id_isar5, 4, 4, 2); + set_feature(&cpu->env, ARM_FEATURE_V8_SHA1); + cpu->id_isar5 = deposit32(cpu->id_isar5, 8, 4, 1); + set_feature(&cpu->env, ARM_FEATURE_V8_SHA256); + cpu->id_isar5 = deposit32(cpu->id_isar5, 12, 4, 1); + set_feature(&cpu->env, ARM_FEATURE_CRC); + cpu->id_isar5 = deposit32(cpu->id_isar5, 16, 4, 1); + set_feature(&cpu->env, ARM_FEATURE_V8_RDM); + cpu->id_isar5 = deposit32(cpu->id_isar5, 24, 4, 1); + set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); + cpu->id_isar5 = deposit32(cpu->id_isar5, 28, 4, 1); + + set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); + cpu->id_isar6 = deposit32(cpu->id_isar6, 4, 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, */ set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_V8_AES); - set_feature(&cpu->env, ARM_FEATURE_V8_SHA1); - set_feature(&cpu->env, ARM_FEATURE_V8_SHA256); set_feature(&cpu->env, ARM_FEATURE_V8_PMULL); - set_feature(&cpu->env, ARM_FEATURE_CRC); - set_feature(&cpu->env, ARM_FEATURE_V8_RDM); - set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); - set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); #endif } } diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 800bff780e..4d629bb99b 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -254,6 +254,34 @@ static void aarch64_max_initfn(Object *obj) kvm_arm_set_cpu_features_from_host(cpu); } else { aarch64_a57_initfn(obj); + + set_feature(&cpu->env, ARM_FEATURE_V8_SHA512); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 12, 4, 2); + + set_feature(&cpu->env, ARM_FEATURE_V8_ATOMICS); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 20, 4, 2); + + set_feature(&cpu->env, ARM_FEATURE_V8_RDM); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 28, 4, 1); + cpu->id_isar5 = deposit32(cpu->id_isar5, 24, 4, 1); + + set_feature(&cpu->env, ARM_FEATURE_V8_SHA3); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 32, 4, 1); + + set_feature(&cpu->env, ARM_FEATURE_V8_SM3); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 36, 4, 1); + + set_feature(&cpu->env, ARM_FEATURE_V8_SM4); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 40, 4, 1); + + set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); + cpu->id_aa64isar0 = deposit64(cpu->id_aa64isar0, 44, 4, 1); + cpu->id_isar6 = deposit32(cpu->id_isar6, 4, 4, 1); + + set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); + 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, @@ -261,15 +289,7 @@ static void aarch64_max_initfn(Object *obj) * whereas the architecture requires them to be present in both if * present in either. */ - set_feature(&cpu->env, ARM_FEATURE_V8_SHA512); - set_feature(&cpu->env, ARM_FEATURE_V8_SHA3); - set_feature(&cpu->env, ARM_FEATURE_V8_SM3); - set_feature(&cpu->env, ARM_FEATURE_V8_SM4); - set_feature(&cpu->env, ARM_FEATURE_V8_ATOMICS); - set_feature(&cpu->env, ARM_FEATURE_V8_RDM); - set_feature(&cpu->env, ARM_FEATURE_V8_DOTPROD); set_feature(&cpu->env, ARM_FEATURE_V8_FP16); - set_feature(&cpu->env, ARM_FEATURE_V8_FCMA); set_feature(&cpu->env, ARM_FEATURE_SVE); /* 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.