From patchwork Tue Dec 3 23:42:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 180778 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2213594ile; Tue, 3 Dec 2019 15:46:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwXRE8W2Hw2f7R90yIZygOZbbt0DijO1uB82p01Ftqxx4bK7NoXU0GA+CYj+Hwb7Rlws8Rv X-Received: by 2002:aa7:df82:: with SMTP id b2mr952138edy.46.1575416814381; Tue, 03 Dec 2019 15:46:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575416814; cv=none; d=google.com; s=arc-20160816; b=gLiPpHeZOjv+trOOf6UW4euo5z49x0hUvzB9c2IZVc11kNZyhrsMVqvbaGt5CJ+894 UHYOw9skoZtGM6KPmAW3XHouebLho5jVJV8QJUymJSlqT6qhYsBZMn6LuNfMCN/31FcQ WP+Tit1uCd1TfcNMRVLvImY0XKGpM1tVa+DX+b7ZvSpwfEPSJHW41p9WxQ7EVcPUnnCZ BldAi6N7yItoNA+S0uuuKKyCNXzSOamOx4/5VAykfT1J+8lRZ8i0WWOATIIO8Bx+Duou ejDuQ8sVuEEVOZT+AUDDyPnKkouWhHPHzjt5nvZBL63A4+HcK46rOn1aA1i2adg9heC7 zDYw== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=/dG0vms7SBwlzTpS1M8Jc87zaIsx5MqGFuBibUfxWTI=; b=NWMETLAMkLNSloF0UrL16JTwK87ZKbAPgUse5E2VLSd4nUNVULPPosJ2O/hbaAbM04 088C0HyBykIfwDCwenBezHurecFyoijL+YzpUze4gGES3jQzopej4ZaNeSokf7fkdvOc EnM+Rslbt387p9c7Hf7FDEiuANK9CQQRK1BQOO+SkKzQ7d1hH7QCYK0OSS8n+Zj7U28S bp8ar820xzx7W/nDMRfX96X/hPicVcqtpnmM9qQSbAtk4m6STkCvfLz/qGXt8pnt4uxe 06YjjNLXbQ1gn8S4AkeE4SDND8S7n9wM0Y/IXwTvnPalUppyqMYzGiHFhBRGs2Du10/p /iNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="EwwIjJ/o"; 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=pass (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 co5si3569411edb.203.2019.12.03.15.46.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Dec 2019 15:46:54 -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=pass header.i=@linaro.org header.s=google header.b="EwwIjJ/o"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icHsX-0006xD-Fq for patch@linaro.org; Tue, 03 Dec 2019 18:46:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38738) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icHol-00048l-I6 for qemu-devel@nongnu.org; Tue, 03 Dec 2019 18:42:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icHoh-0006U2-KF for qemu-devel@nongnu.org; Tue, 03 Dec 2019 18:42:53 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:38792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icHof-0006Rm-S6 for qemu-devel@nongnu.org; Tue, 03 Dec 2019 18:42:51 -0500 Received: by mail-pg1-x541.google.com with SMTP id t3so2383166pgl.5 for ; Tue, 03 Dec 2019 15:42:49 -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=/dG0vms7SBwlzTpS1M8Jc87zaIsx5MqGFuBibUfxWTI=; b=EwwIjJ/oQT7jo5Ss3LX74mBDgAu2q4DysQI3E4xOCJan5lGbN2Fd+Vcc79UCC6//O2 k6ZLwSK3rDnIUssYKzifUaGPafsC9m+ZhZzfdd2+6DgD5dTwB/uPFHNAV3Sb/P2VRKtk g/g6+5u4kum5h/BF2de/Z5fdi5aYd72bav6kyZXD5DpYUPNiSxowsSgKW1SGqQ4hPxVw AegURwrDSgzWt3bbELQqY+hDTtTCYj0KNOiZk0Bg6Pic2dAdoaRg1lQGWEQKQ3hmBfFz /10AZdAlVqUgeRp9O+aZwl5nqpR0Va1LwzYG+xZCitolkQ4Ui5XI43uewcfD5xgjfw8n ZY+w== 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=/dG0vms7SBwlzTpS1M8Jc87zaIsx5MqGFuBibUfxWTI=; b=eLeTQ+mHVaP+o4RWRTB5nGRzAZxTgvWrt8nPcEnuvhhW84ZvOzrjjwjKQtWTWDDjfy oAfDdKRA3QL5OXvaubVBN9e0cGChpBm7iESPh9tAnS47TEQN9D6jp8GLTA1UloZHnQU2 rhw2zVmHahVJ2cafQ0/MYZstgVzvqjGTNZRU+5OWGr62gr6wYHiI3nqrC8BLQ59Qh9b1 alrPx+raFixeq5iMV1b3FZSV11BOsYj+zGMbTQ1YFkhrpkwmgGFCNoOYQBJDwPx4lhSd O/g4NvZijl0/NJsyQXbeXWfQ4vJwnfF5FWC4tySHa5KCsY1lFu1Fzurm6er3CBcuEqKr YmBg== X-Gm-Message-State: APjAAAUJNfkJkOV7QoHO8UD5+va4xCq+HyNvNyYZZmF76s3fukkyiPRE pBIiTOl3tYM40ajAq6uluMQWpBkbJCI= X-Received: by 2002:a63:4e0e:: with SMTP id c14mr271849pgb.237.1575416567822; Tue, 03 Dec 2019 15:42:47 -0800 (PST) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id k5sm4128256pju.14.2019.12.03.15.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 15:42:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/4] target/arm: Add ID_AA64MMFR2_EL1 Date: Tue, 3 Dec 2019 15:42:41 -0800 Message-Id: <20191203234244.9124-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191203234244.9124-1-richard.henderson@linaro.org> References: <20191203234244.9124-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::541 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Add definitions for all of the fields, up to ARMv8.5. Convert the existing RESERVED register to a full register. Query KVM for the value of the register for the host. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 17 +++++++++++++++++ target/arm/helper.c | 4 ++-- target/arm/kvm64.c | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d403dc5947..cdf6caf869 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -864,6 +864,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; @@ -1778,6 +1779,22 @@ 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_AA64MMFR2, EVT, 56, 4) +FIELD(ID_AA64MMFR2, E0PD, 60, 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 f1eab4fb28..70f2db5447 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6825,11 +6825,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, .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, .accessfn = access_aa64_tid3, - .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 876184b8fe..482e7fdfbb 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -549,6 +549,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,