From patchwork Fri Jun 29 00:15:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 140486 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp197292ljj; Thu, 28 Jun 2018 17:16:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd5PIvfkJ4nsJf+2NLKIoYLCXT1di9GjGvtQmEBnGDOEsFbOgp4N3mU+nQBQvSeybh2lLP4 X-Received: by 2002:a37:84c3:: with SMTP id g186-v6mr10567293qkd.346.1530231385460; Thu, 28 Jun 2018 17:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530231385; cv=none; d=google.com; s=arc-20160816; b=rdqN8MHGfumSx4NYh6wjQc6xX567nNw3CvQeMFi5ShKLNXr66/mOsLb2tD+k+CX06Q jipdHudpg28MHAv2RcCyR0/FT4gQQpFZAIEihmZHAyKtTWCwMtwSKxySyWi/232JlZax VOX9W5QxfqOFH14eHy5HaZuFUg1qRrZXon5o17RMKJ5BMbaTmoEfgcXvyYbO+Y7Phb/S DDE9a9F1ThrjMQpuqSQhL4PRjV+HExXoS3snrt8RDFH7BFuVjmTBZG0CspYdPDJypaRN WQb0DRUlwBXb5VoLf1FvhA5Z9Jw3A1O4Yfl1TvOwVgsMl3RGbuJdu0t5EVlYxPA51I2n zbkA== 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=YHXLcyZt1QNkfP6YbxOwlV259R+b3jcKBj1+zMF8BSQ=; b=FpqWObn7z/c56lwqEL0u6yPX70+Lv3P7j1EagWYHUjReu43wKKOmSoa0ysBDcZESsV Nq/zDV7zA4ubf8SRN5JbwREbgxMsh0ERUPyHDHaHYSXrTX0g6Qndkb2FvyoxI+S0yW1o ukP6PqFNG2P7i8PXTxSPvyhRDORz52zXLPB/BcV5NJBHr/UY0kn5Vv5UmoZqnDA+IpPh PWImlFKtK9xrK4WUS9HoEkpUg4NG5f/k9x+fWFjbhitZHpvdgzrPAtLCxP7p9yvt4rlg rBWuzQaV+4qJVt6bsxaTRoPtaDJ+ZK93C8NZ2RDiuW08+IvsjYQoAZEe0Myq7IMCUPqd UuHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JVdbwcdC; 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 a7-v6si520763qkg.41.2018.06.28.17.16.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Jun 2018 17:16:25 -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=JVdbwcdC; 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]:39236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYh5M-00047I-S8 for patch@linaro.org; Thu, 28 Jun 2018 20:16:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYh4p-00045J-IK for qemu-devel@nongnu.org; Thu, 28 Jun 2018 20:15:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYh4o-0006iE-ES for qemu-devel@nongnu.org; Thu, 28 Jun 2018 20:15:51 -0400 Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:38964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYh4o-0006hx-6F for qemu-devel@nongnu.org; Thu, 28 Jun 2018 20:15:50 -0400 Received: by mail-pg0-x22a.google.com with SMTP id n2-v6so3167834pgq.6 for ; Thu, 28 Jun 2018 17:15:50 -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=YHXLcyZt1QNkfP6YbxOwlV259R+b3jcKBj1+zMF8BSQ=; b=JVdbwcdCYIwxJ4S/N7FIP6FHooaxTogS+ulMnXxyFoIZNiTMbj+DCvM8qeHLGaPuW/ 6a5fyNANJrw6mvE24BXYETuGmLTNIIls3clqYqqcNVfYDwVtkej8X4yC+T2x4uBMeJWw 9mefiIFY8R/IxfUkp7v3lHh6b75kUnjnStLLQ= 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=YHXLcyZt1QNkfP6YbxOwlV259R+b3jcKBj1+zMF8BSQ=; b=Khm34ODZ7bOgJXaBIXtjSb2Ult5XPvX7NskHIgJwq/xG3ue4ydlard2jP3YjaZAkga U/siuDJsAyLjT3DeuJLAsuz6ux8VhAutpvuQ38CMc5wclcQE4y/j3jDsPTuI3bHbv2dh lGrziUJNixcMC+s1ycsYo5cAT7RFrmnUnE1bZE2iAn9LDY6m/lKIuIAvGUa16upqGhWB OpTFTONUpnm+nvwe7rKXkeqMPWeV50KSEjov62urQ1/bfR5PDH6j5vWTbIoTDK9uwGLR bPIVAh39ZL7Lqo+afkRvGjAUkzOfZw42m7md67IxpJerKPWIQDzYwx+If4GS3PG9MnHv 5TxQ== X-Gm-Message-State: APt69E1MguceOiiFJRKJ2Ld4aqXNODgY23t8mrdgw7J34xJ/Pp1TtnGs sca/BEFdCTT72UiQmqZmBxYN5d9ukRA= X-Received: by 2002:a62:c1c5:: with SMTP id i188-v6mr12142891pfg.155.1530231349016; Thu, 28 Jun 2018 17:15:49 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id j3-v6sm11687618pff.35.2018.06.28.17.15.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jun 2018 17:15:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 17:15:38 -0700 Message-Id: <20180629001538.11415-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629001538.11415-1-richard.henderson@linaro.org> References: <20180629001538.11415-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:c05::22a Subject: [Qemu-devel] [PATCH 6/6] 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: peter.maydell@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 de1a07a9f1..943c589445 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1795,19 +1795,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 d0581d59d8..b24fee45e3 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -230,6 +230,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, @@ -237,15 +265,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.