From patchwork Sat Feb 23 02:39:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159091 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2442311jaa; Fri, 22 Feb 2019 18:43:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ/TdFatE6XroFPXzcdNcI7qtp3ZJwdXU/Zyqjs9dkI9AlOywQlHNwN91Egap6DLc5ZEAg7 X-Received: by 2002:a25:61d1:: with SMTP id v200mr6033827ybb.517.1550889789439; Fri, 22 Feb 2019 18:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550889789; cv=none; d=google.com; s=arc-20160816; b=dK/sNVN+pfGeIQUL+rX4KP7AIbrUDKikv3gIcRo3E7DH7QrzeyNxQl4z4pJE8PS4L5 tsSR2n2P5K+immD+FlyEfgknPxz1+33xUQRBpWWrP9r7pWiRJ1rK+KCHjDXPKvE9WKiK aOHAwA1feUhNXw5dBXWvrTIHu7XcwXx8+CkNaSqVEakuJb9h83Nh7MLvoNm5qcMMybpW gpRa4gg+TBmOexy6O9XoS95xN+DLOmR6NmXIZDqrHd3pX5tTeFUTSFoFYJTDPY6KkGHM +VYgGWIQ4I3WWgHDRRuxJYXoEJnfzBRFpIY4IRfj/2MP+1SCmnjJTiJcH8JgBBHDWGpF uBRg== 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; bh=WvrXQEWeefZUb5cnHgporlJEbaVWKMTqlWlLaZjLad0=; b=pyJF7LB94au43V/+QYgJyjJuEkRPQQE2ACF1XES9iXMNkDFnQRUiiOAd2umgke2Ud2 dHxEw9oY5dDRhjWtDd1KMZZ07sAQ1H6/Rz7eYmjunkQx5jB1+1TkusrVgz6aM91znVP1 ZSdOySUF4wcul2x5gLOh14SNDIAEI5hgtEpLM95O02RAiCBztYleVQN7NFvOtnr2CtKg ZNp97Nj4V5W2KoKoki8xeMWFMmeXV1/QaDj1xYFYsc+6by48FliOegX+H3PhzsGo73+W lPnods8W+Hq/ZJVmQ/RbFlZQrl8dMwsVUc1JK5D9Pf5v+izoCiU9TMUhJL1z1qEEMciF IhMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EgVrDgDl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id l186si1914641ywe.35.2019.02.22.18.43.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Feb 2019 18:43:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EgVrDgDl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:60043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxNHQ-00048g-VC for patch@linaro.org; Fri, 22 Feb 2019 21:43:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxNET-0002v4-P2 for qemu-devel@nongnu.org; Fri, 22 Feb 2019 21:40:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxNES-0002YC-Um for qemu-devel@nongnu.org; Fri, 22 Feb 2019 21:40:05 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:39500) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxNES-0002Wz-Nc for qemu-devel@nongnu.org; Fri, 22 Feb 2019 21:40:04 -0500 Received: by mail-pg1-x543.google.com with SMTP id h8so1426284pgp.6 for ; Fri, 22 Feb 2019 18:40:04 -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; bh=WvrXQEWeefZUb5cnHgporlJEbaVWKMTqlWlLaZjLad0=; b=EgVrDgDle+8q0p17oD5XeUjAYUJmYtNpbjNBi3efzTTU95WvQ9jwUXFc4bDrGaJLBa a4u4Vg5gQE+tSCapqPtMZnAHNouHIxEUBM5atmzuo3x2/xPPdgC591NiNyXQaNVPusw+ onE10Lm0rfpzC/1P8L6ZYnHb7ucO5ttczGaSKsVErs2CFOm6PciFtWTVGup6i/arDeQU OtdQ45KE7PGU/6EDbp/HW8Jo5yObO1cB9gGoHLKgv9VWjKTZL9rlNhwRsn0Wca5CHONH 0bCqMgboBFJ3rlBLdFylX9RPsReeuWF7AhdXCdaaNwpvMvVBjpn+/48ur8PUWpuIzjrN SkGA== 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=WvrXQEWeefZUb5cnHgporlJEbaVWKMTqlWlLaZjLad0=; b=Rz1c/ZO/WFwPgsCXB3uUbQx71Wwnxx+WmyWpcvIqUX66bZItNQqu/Jm6Oz5ClF4bkt 1xyestpTY/Wjd4k2l4mEeVmhWTd/2yQtuUdrQh/LNnZUCYlmVJxNQS8urebtMajpoa7d nSCNCN01f6Gn099mSsByRnLKUOamxXFrNFJm030d57P+MUnopb6YdnVwKmZVId6mHfjY Gbs2p44jpRjhpj2zKq8/P5pOAItSQBpVVRdffIhOvdfUtQVNfvMgNYEiCbkCRwTrRmon YnllJVsYilCujfMqeBZdlj5Mb32vTrib6u3PhFFhCLG+iic41Tk6oRHX8XHCo9RToSCy LBeA== X-Gm-Message-State: AHQUAuawSJq8WNFIJFKA94IOb6NgaoXFz3cG1xbT57h56Ykiipjsl3mg lrJq6p8OAzqM0pTkkhmHM14P7fkesOg= X-Received: by 2002:a63:ff60:: with SMTP id s32mr6829469pgk.266.1550889603427; Fri, 22 Feb 2019 18:40:03 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id j6sm3052513pgq.33.2019.02.22.18.40.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Feb 2019 18:40:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 18:39:54 -0800 Message-Id: <20190223023957.18865-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190223023957.18865-1-richard.henderson@linaro.org> References: <20190223023957.18865-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH 3/6] target/arm: Implement ID_AA64MMFR2 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, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This was res0 before ARMv8.2, but will shortly be used by new processor definitions. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 15 +++++++++++++++ target/arm/helper.c | 4 ++-- target/arm/kvm64.c | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) -- 2.17.2 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c2899f0bed..02642a7db3 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -855,6 +855,7 @@ struct ARMCPU { uint64_t id_aa64pfr1; uint64_t id_aa64mmfr0; uint64_t id_aa64mmfr1; + uint64_t id_aa64mmfr2; } isar; uint32_t midr; uint32_t revidr; @@ -1724,6 +1725,20 @@ FIELD(ID_AA64MMFR1, PAN, 20, 4) FIELD(ID_AA64MMFR1, SPECSEI, 24, 4) FIELD(ID_AA64MMFR1, XNX, 28, 4) +FIELD(ID_AA64MMFR2, CNP, 0, 4) +FIELD(ID_AA64MMFR2, UAO, 4, 4) +FIELD(ID_AA64MMFR2, LSM, 8, 4) +FIELD(ID_AA64MMFR2, IESB, 12, 4) +FIELD(ID_AA64MMFR2, VARANGE, 16, 4) +FIELD(ID_AA64MMFR2, CCIDX, 20, 4) +FIELD(ID_AA64MMFR2, NV, 24, 4) +FIELD(ID_AA64MMFR2, ST, 28, 4) +FIELD(ID_AA64MMFR2, AT, 32, 4) +FIELD(ID_AA64MMFR2, IDS, 36, 4) +FIELD(ID_AA64MMFR2, FWB, 40, 4) +FIELD(ID_AA64MMFR2, TTL, 48, 4) +FIELD(ID_AA64MMFR2, BBM, 52, 4) + FIELD(ID_DFR0, COPDBG, 0, 4) FIELD(ID_DFR0, COPSDBG, 4, 4) FIELD(ID_DFR0, MMAPDBG, 8, 4) diff --git a/target/arm/helper.c b/target/arm/helper.c index 8903cc13d8..fbdca9324b 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6052,10 +6052,10 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 1, .access = PL1_R, .type = ARM_CP_CONST, .resetvalue = cpu->isar.id_aa64mmfr1 }, - { .name = "ID_AA64MMFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64, + { .name = "ID_AA64MMFR2_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 2, .access = PL1_R, .type = ARM_CP_CONST, - .resetvalue = 0 }, + .resetvalue = cpu->isar.id_aa64mmfr2 }, { .name = "ID_AA64MMFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 3, .access = PL1_R, .type = ARM_CP_CONST, diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index e3ba149248..c3d421b53b 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -542,6 +542,8 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) ARM64_SYS_REG(3, 0, 0, 7, 0)); err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr1, ARM64_SYS_REG(3, 0, 0, 7, 1)); + err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr2, + ARM64_SYS_REG(3, 0, 0, 7, 2)); /* * Note that if AArch32 support is not present in the host,