From patchwork Mon Sep 11 13:53:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 721463 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp1112411wrp; Mon, 11 Sep 2023 06:55:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1aazPAWDAELC66sohkxpZXqepsNoQVX3TfA+avrABnwUBi5FEuXZiR7ZV1Khy5wfvkVeu X-Received: by 2002:a05:620a:4045:b0:767:197e:4417 with SMTP id i5-20020a05620a404500b00767197e4417mr13540677qko.3.1694440527256; Mon, 11 Sep 2023 06:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694440527; cv=none; d=google.com; s=arc-20160816; b=iTCSGL7GWPlXOjFgCYqo4p1ho/MGGQ1hDRDMGzGLTMlIif5FPe8cGNC6CBJ66+03wW vOLNouecCg5XERrrNE2kDEv91bp5qEV2NdshcDqVTuBXBnOkcrgPLtt1c6GZub2UkcXe qn+szxxIx0gDlyS0R70WyFrXqFDc8fObbFb9E9o5VgrGzm7XUx0J96vd2tGBmQkKi9aU Um/LZLw+ZuwYQRvEZL3IG3u8E2UFI6+ri3tzK2eeqtPQ7GzA+1lKuoGCnOOBs9t6Trb3 rcV0nxveKRXVSMYa2Y+D7JDF5sqW8bUj/LjOS5XR70Tt1Xt2glUjTmfgzL4M00yLw46/ Rg/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=EhsANPr+s+DzOUAyiokLp6LNqlQRXOf6IY9mVxsXL14=; fh=H2AmuqulvQE+T5zu97MCEUC3z9wF9NssS7895NhR/+c=; b=mEmQlS4pqoNX/HILoka36y15dI9OPZxxwsHqk9+GW+svzWf9TIsLSzfp9htzucva98 25I4riqvjVglS2AgDeOsdaNHV34hcxp/A8he3dq9ELAB+rcmc/Ct2lli9DjGYNP45no6 /8c687CCis7DDNlecoX+OrGOiSLoqkyzafLg7qPHJMbRE0hzBdTaV37yNjPBdSAz4YbC D/n1FNEYbufAEwRAnWirpxBLbStQIAewDMz+/a1AdOAol8BDaaFU3edFkocj+DBQ8y8m oBLP1y3V0eTEG1PI/h2CyYiQWgTrDG9eEtJwfE4lIxEnivVoIIxjmts/CtY4Lw9FrZxy po5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zi40qD8b; 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 g18-20020ac87f52000000b00403a9dc72bbsi4757480qtk.609.2023.09.11.06.55.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Sep 2023 06:55:27 -0700 (PDT) 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=zi40qD8b; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMR-0005iF-5w; Mon, 11 Sep 2023 09:53:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfhMP-0005gm-KL for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:53 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMI-00039s-ER for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:53 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31c4d5bd69cso4615220f8f.3 for ; Mon, 11 Sep 2023 06:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440423; x=1695045223; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EhsANPr+s+DzOUAyiokLp6LNqlQRXOf6IY9mVxsXL14=; b=zi40qD8bBOdUYEg2SB2DsPlzO9HoWgOlDL9Z/qr6/8SBNPZ7aY10qa3r5iEyKA4cOk bSBMXbselHh7mxeVZrcg0A/62W3NIrKWHB7qS5rfB1L2YDR8eWPyhfQj+YEaiU2wcQX0 axuwLlIDHOqZ7mBVDIfZwi0n1jes3C1BKpEqNJfjnidzav216Lea96Ghq3eAhgHBI7zo PYOZztYDpdEl8XiMdBTbsxNP2GhsOItW0DEvkXB3600eAYkAoqZ2JORo16VfxNqSlDyj 7AVLJNeN2U/z+KwVwNWzJ1j5a9/3g7RXhZVslfFTUitG0LeurBKrp1J+NXiS/ueANP1z LSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440423; x=1695045223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EhsANPr+s+DzOUAyiokLp6LNqlQRXOf6IY9mVxsXL14=; b=VOwVLfmA+2funkeNDfIHYTy4OAQ5NnCL7LJnYicBEgHeRrCxpF000yvUyQmnTZK/Me ad5gevCEukx872qzyXo/kU01PqorwhP1/YyYjNVVkk8vjcFdsMd+o2w4sbYT0wXmuj8U RjCdJjPSQngExFwB8JQ5fwz66T7lPNXg2JkdsoQ71gp4o/wsb9EreyzaZyg0MTfseoUj 1piwuVuA7cXt0L/tN4yFyQisbUfXCbY8oF/P13dcop9OgkZQ6rtVtb3NOOu0lTZl0d52 yHz11IMbqegFT/Zx7YoAqK/nyNDqzYuRSjV+ZizZZeX01brvUxy/Q04JPafJI9N91G29 2lGA== X-Gm-Message-State: AOJu0Yw2FnMGYec5wo3Hhrwn/u0CiW9KOVkLb1nVnKA1w1lXkN9foRIe 4ObIyY67w7Ze6tvaym1kASoitA== X-Received: by 2002:adf:d082:0:b0:31d:c3d2:4300 with SMTP id y2-20020adfd082000000b0031dc3d24300mr6535375wrh.71.1694440423429; Mon, 11 Sep 2023 06:53:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:43 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/7] target/arm: Add ID_AA64ISAR2_EL1 Date: Mon, 11 Sep 2023 14:53:34 +0100 Message-Id: <20230911135340.1139553-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Aaron Lindsay Signed-off-by: Aaron Lindsay [PMM: drop the HVF part of the patch and just comment that we need to do something when the register appears in that API] Signed-off-by: Peter Maydell --- target/arm/cpu.h | 1 + target/arm/helper.c | 4 ++-- target/arm/hvf/hvf.c | 1 + target/arm/kvm64.c | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d50cd918580..e637796fd83 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1033,6 +1033,7 @@ struct ArchCPU { uint32_t dbgdevid1; uint64_t id_aa64isar0; uint64_t id_aa64isar1; + uint64_t id_aa64isar2; uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; uint64_t id_aa64mmfr0; diff --git a/target/arm/helper.c b/target/arm/helper.c index e3f5a7d2bdc..f9f7c3c39e9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -8435,11 +8435,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, .resetvalue = cpu->isar.id_aa64isar1 }, - { .name = "ID_AA64ISAR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64, + { .name = "ID_AA64ISAR2_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 2, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, - .resetvalue = 0 }, + .resetvalue = cpu->isar.id_aa64isar2 }, { .name = "ID_AA64ISAR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 3, .access = PL1_R, .type = ARM_CP_CONST, diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 486f90be1d2..546c0e817f4 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -847,6 +847,7 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) { HV_SYS_REG_ID_AA64DFR1_EL1, &host_isar.id_aa64dfr1 }, { HV_SYS_REG_ID_AA64ISAR0_EL1, &host_isar.id_aa64isar0 }, { HV_SYS_REG_ID_AA64ISAR1_EL1, &host_isar.id_aa64isar1 }, + /* Add ID_AA64ISAR2_EL1 here when HVF supports it */ { HV_SYS_REG_ID_AA64MMFR0_EL1, &host_isar.id_aa64mmfr0 }, { HV_SYS_REG_ID_AA64MMFR1_EL1, &host_isar.id_aa64mmfr1 }, { HV_SYS_REG_ID_AA64MMFR2_EL1, &host_isar.id_aa64mmfr2 }, diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 4d904a1d11b..ac440c33f9a 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -304,6 +304,8 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) ARM64_SYS_REG(3, 0, 0, 6, 0)); err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar1, ARM64_SYS_REG(3, 0, 0, 6, 1)); + err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar2, + ARM64_SYS_REG(3, 0, 0, 6, 2)); err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr0, ARM64_SYS_REG(3, 0, 0, 7, 0)); err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr1,