From nobody Wed May  7 04:44:43 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=linaro.org
ARC-Seal: i=1; a=rsa-sha256; t=1652098001; cv=none;
	d=zohomail.com; s=zohoarc;
	b=c2kQB1950PenhNHNkuPXEe+pnQQOjpIKAFUEpkz7WgnJl90nZ4eGlWDTVCqr3DzvfTHj8KsyPFdTigzCMFigVozZ3cb3YI6Lz5ObV421WT5V2nMo5E37B2ojHD16mcyMi9hOS59ZiX/k1ocAZhDRcBflIAFeCxp/7G5EVtO9Uao=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1652098001;
 h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To;
	bh=AMHYpqYyVexl/KQxM32vgi111AbDDgBeiFSwyB6v1qY=;
	b=F9R4A/ErK5QdNcXKVrzZsHnfOQ1J1OGhnhHf6Lv/m8VWTpNsocO9SRFZbWbvCQeASZoIxejPSmUaItV/CBIh1PWdkaPkr7yLthALqki8QQqiV7hLzbwHKrjSbhFkMttkgPDgk5qh1K+iIZFKqGF9JnHV2fKtSkPp5hnvLnWOk0c=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<peter.maydell@linaro.org> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1652098001369896.9830381705377;
 Mon, 9 May 2022 05:06:41 -0700 (PDT)
Received: from localhost ([::1]:58946 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>)
	id 1no29w-0007Uv-9S
	for importer@patchew.org; Mon, 09 May 2022 08:06:40 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49654)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)
 id 1no22S-00071t-Cj
 for qemu-devel@nongnu.org; Mon, 09 May 2022 07:58:56 -0400
Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35697)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)
 id 1no22Q-0001Gm-Ak
 for qemu-devel@nongnu.org; Mon, 09 May 2022 07:58:56 -0400
Received: by mail-wr1-x42d.google.com with SMTP id j15so19134476wrb.2
 for <qemu-devel@nongnu.org>; Mon, 09 May 2022 04:58:53 -0700 (PDT)
Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2])
 by smtp.gmail.com with ESMTPSA id
 bs6-20020a056000070600b0020c5253d8bdsm12199928wrb.9.2022.05.09.04.58.51
 for <qemu-devel@nongnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 09 May 2022 04:58:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;
 h=from:to:subject:date:message-id:in-reply-to:references:mime-version
 :content-transfer-encoding;
 bh=AMHYpqYyVexl/KQxM32vgi111AbDDgBeiFSwyB6v1qY=;
 b=z2c3usWgNkj0IeuV9S3gCwit8cc13I3mZ6oaR8q4zBGP1Fiy0AEpL97X9a6gPlLACc
 qTdLg3FoLaPVLcTPDbRCKebFbFUN98CaxMEBSgniqYjOK+fUk888HkPMU09eFlDpjCpc
 c8Kyeo6X0noZYTDC+EwBoVqOhITg8MugspwiNZS25jGj9YJl2u4pdGTVEGKtMpsKu6Mb
 wqw/l3JI1xMz+GugZZ2GUAk5DAOWD7MYymSdBAJ/sDOm6Q34suCkECr5iNsXoohatq8w
 L3JBGfFdF4E1n3/jgVMGcBD482b9Yijjm63TXrkxWrEfV/AtbFHnfFzJFTGtP7ImZcZ4
 S3bg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=AMHYpqYyVexl/KQxM32vgi111AbDDgBeiFSwyB6v1qY=;
 b=IDWZWqcvzi3/I9mRE6pxBRqRo9XA6T1B4Zwp4ET2Qm87EIOync764Bja7MfQKAxdqh
 K2+7Ztg6G8Kla6aOYYv1fUb4tdTPQUaf/tXKeXtnS74YYCWiwH0y1HxNK8RmUMHrKyBG
 6BsMpfYYT7gGygDO2XxfBNJAGbAZig+1JOAj9h1CwO1qCh9X7aQGl4nzKmG7zB2LTP2L
 0z1WxwS0pyEdIQBo7T3qFuK8xdE4XRCMyyp+QU4WTOdGN0bsnL5TfK/YMh2aCOatk/fK
 FfK/wCGDw5riOliJyw6o7TsZ3iIa7Dhq69AvweOec+fdIwB2BhcowXnrCS+9fKbBYmT1
 amTg==
X-Gm-Message-State: AOAM53304TYNXh1wO8PXZua7qAnovY0GnHTGaeePSw5OF/VCjHfJWKKO
 tP2ia3UBvA67r06lgY5LZxyvEi/XAHhv4A==
X-Google-Smtp-Source: 
 ABdhPJxMDADuwXZYygM1QeSlWj+sV9LdFUgKLipfUx1vwbYa3j6pGMRfOvfm6QTvjGu5h3vN+M/jjg==
X-Received: by 2002:adf:f748:0:b0:20c:86d5:c343 with SMTP id
 z8-20020adff748000000b0020c86d5c343mr13628104wrp.477.1652097532797;
 Mon, 09 May 2022 04:58:52 -0700 (PDT)
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 03/32] target/arm: Drop EL3 no EL2 fallbacks
Date: Mon,  9 May 2022 12:58:19 +0100
Message-Id: <20220509115848.3521805-4-peter.maydell@linaro.org>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20220509115848.3521805-1-peter.maydell@linaro.org>
References: <20220509115848.3521805-1-peter.maydell@linaro.org>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::42d;
 envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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,
 T_SCC_BODY_TEXT_LINE=-0.01 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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org>
X-ZohoMail-DKIM: pass (identity @linaro.org)
X-ZM-MESSAGEID: 1652098001779100002
Content-Type: text/plain; charset="utf-8"

From: Richard Henderson <richard.henderson@linaro.org>

Drop el3_no_el2_cp_reginfo, el3_no_el2_v8_cp_reginfo, and the local
vpidr_regs definition, and rely on the squashing to ARM_CP_CONST
while registering for v8.

This is a behavior change for v7 cpus with Security Extensions and
without Virtualization Extensions, in that the virtualization cpregs
are now correctly not present.  This would be a migration compatibility
break, except that we have an existing bug in which migration of 32-bit
cpus with Security Extensions enabled does not work.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220506180242.216785-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/helper.c | 158 ++++----------------------------------------
 1 file changed, 13 insertions(+), 145 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 9ab8b65e7bc..ea2788b3d53 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -5099,124 +5099,6 @@ static const ARMCPRegInfo v8_cp_reginfo[] =3D {
       .fieldoffset =3D offsetoflow32(CPUARMState, cp15.mdcr_el3) },
 };
=20
-/* Used to describe the behaviour of EL2 regs when EL2 does not exist.  */
-static const ARMCPRegInfo el3_no_el2_cp_reginfo[] =3D {
-    { .name =3D "VBAR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 12, .crm =3D 0, .opc2 =3D 0,
-      .access =3D PL2_RW,
-      .readfn =3D arm_cp_read_zero, .writefn =3D arm_cp_write_ignore },
-    { .name =3D "HCR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 0,
-      .access =3D PL2_RW,
-      .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "HACR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 7,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "ESR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 5, .crm =3D 2, .opc2 =3D 0,
-      .access =3D PL2_RW,
-      .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "CPTR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 2,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "MAIR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 10, .crm =3D 2, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "HMAIR1", .state =3D ARM_CP_STATE_AA32,
-      .cp =3D 15, .opc1 =3D 4, .crn =3D 10, .crm =3D 2, .opc2 =3D 1,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "AMAIR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 10, .crm =3D 3, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "HAMAIR1", .state =3D ARM_CP_STATE_AA32,
-      .cp =3D 15, .opc1 =3D 4, .crn =3D 10, .crm =3D 3, .opc2 =3D 1,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "AFSR0_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 5, .crm =3D 1, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "AFSR1_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 5, .crm =3D 1, .opc2 =3D 1,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "TCR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 0, .opc2 =3D 2,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "VTCR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 1, .opc2 =3D 2,
-      .access =3D PL2_RW, .accessfn =3D access_el3_aa32ns,
-      .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "VTTBR", .state =3D ARM_CP_STATE_AA32,
-      .cp =3D 15, .opc1 =3D 6, .crm =3D 2,
-      .access =3D PL2_RW, .accessfn =3D access_el3_aa32ns,
-      .type =3D ARM_CP_CONST | ARM_CP_64BIT, .resetvalue =3D 0 },
-    { .name =3D "VTTBR_EL2", .state =3D ARM_CP_STATE_AA64,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 1, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "SCTLR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 0, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "TPIDR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 13, .crm =3D 0, .opc2 =3D 2,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "TTBR0_EL2", .state =3D ARM_CP_STATE_AA64,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 0, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "HTTBR", .cp =3D 15, .opc1 =3D 4, .crm =3D 2,
-      .access =3D PL2_RW, .type =3D ARM_CP_64BIT | ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "CNTHCTL_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 1, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "CNTVOFF_EL2", .state =3D ARM_CP_STATE_AA64,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 0, .opc2 =3D 3,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "CNTVOFF", .cp =3D 15, .opc1 =3D 4, .crm =3D 14,
-      .access =3D PL2_RW, .type =3D ARM_CP_64BIT | ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "CNTHP_CVAL_EL2", .state =3D ARM_CP_STATE_AA64,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 2, .opc2 =3D 2,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "CNTHP_CVAL", .cp =3D 15, .opc1 =3D 6, .crm =3D 14,
-      .access =3D PL2_RW, .type =3D ARM_CP_64BIT | ARM_CP_CONST,
-      .resetvalue =3D 0 },
-    { .name =3D "CNTHP_TVAL_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 2, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "CNTHP_CTL_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 2, .opc2 =3D 1,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "MDCR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 1,
-      .access =3D PL2_RW, .accessfn =3D access_tda,
-      .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "HPFAR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 6, .crm =3D 0, .opc2 =3D 4,
-      .access =3D PL2_RW, .accessfn =3D access_el3_aa32ns,
-      .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "HSTR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 3,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "FAR_EL2", .state =3D ARM_CP_STATE_BOTH,
-      .opc0 =3D 3, .opc1 =3D 4, .crn =3D 6, .crm =3D 0, .opc2 =3D 0,
-      .access =3D PL2_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-    { .name =3D "HIFAR", .state =3D ARM_CP_STATE_AA32,
-      .type =3D ARM_CP_CONST,
-      .cp =3D 15, .opc1 =3D 4, .crn =3D 6, .crm =3D 0, .opc2 =3D 2,
-      .access =3D PL2_RW, .resetvalue =3D 0 },
-};
-
-/* Ditto, but for registers which exist in ARMv8 but not v7 */
-static const ARMCPRegInfo el3_no_el2_v8_cp_reginfo[] =3D {
-    { .name =3D "HCR2", .state =3D ARM_CP_STATE_AA32,
-      .cp =3D 15, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 4,
-      .access =3D PL2_RW,
-      .type =3D ARM_CP_CONST, .resetvalue =3D 0 },
-};
-
 static void do_hcr_write(CPUARMState *env, uint64_t value, uint64_t valid_=
mask)
 {
     ARMCPU *cpu =3D env_archcpu(env);
@@ -7902,7 +7784,17 @@ void register_cp_regs_for_features(ARMCPU *cpu)
         define_arm_cp_regs(cpu, v8_idregs);
         define_arm_cp_regs(cpu, v8_cp_reginfo);
     }
-    if (arm_feature(env, ARM_FEATURE_EL2)) {
+
+    /*
+     * Register the base EL2 cpregs.
+     * Pre v8, these registers are implemented only as part of the
+     * Virtualization Extensions (EL2 present).  Beginning with v8,
+     * if EL2 is missing but EL3 is enabled, mostly these become
+     * RES0 from EL3, with some specific exceptions.
+     */
+    if (arm_feature(env, ARM_FEATURE_EL2)
+        || (arm_feature(env, ARM_FEATURE_EL3)
+            && arm_feature(env, ARM_FEATURE_V8))) {
         uint64_t vmpidr_def =3D mpidr_read_val(env);
         ARMCPRegInfo vpidr_regs[] =3D {
             { .name =3D "VPIDR", .state =3D ARM_CP_STATE_AA32,
@@ -7946,33 +7838,9 @@ void register_cp_regs_for_features(ARMCPU *cpu)
             };
             define_one_arm_cp_reg(cpu, &rvbar);
         }
-    } else {
-        /* If EL2 is missing but higher ELs are enabled, we need to
-         * register the no_el2 reginfos.
-         */
-        if (arm_feature(env, ARM_FEATURE_EL3)) {
-            /* When EL3 exists but not EL2, VPIDR and VMPIDR take the value
-             * of MIDR_EL1 and MPIDR_EL1.
-             */
-            ARMCPRegInfo vpidr_regs[] =3D {
-                { .name =3D "VPIDR_EL2", .state =3D ARM_CP_STATE_BOTH,
-                  .opc0 =3D 3, .opc1 =3D 4, .crn =3D 0, .crm =3D 0, .opc2 =
=3D 0,
-                  .access =3D PL2_RW, .accessfn =3D access_el3_aa32ns,
-                  .type =3D ARM_CP_CONST, .resetvalue =3D cpu->midr,
-                  .fieldoffset =3D offsetof(CPUARMState, cp15.vpidr_el2) },
-                { .name =3D "VMPIDR_EL2", .state =3D ARM_CP_STATE_BOTH,
-                  .opc0 =3D 3, .opc1 =3D 4, .crn =3D 0, .crm =3D 0, .opc2 =
=3D 5,
-                  .access =3D PL2_RW, .accessfn =3D access_el3_aa32ns,
-                  .type =3D ARM_CP_NO_RAW,
-                  .writefn =3D arm_cp_write_ignore, .readfn =3D mpidr_read=
 },
-            };
-            define_arm_cp_regs(cpu, vpidr_regs);
-            define_arm_cp_regs(cpu, el3_no_el2_cp_reginfo);
-            if (arm_feature(env, ARM_FEATURE_V8)) {
-                define_arm_cp_regs(cpu, el3_no_el2_v8_cp_reginfo);
-            }
-        }
     }
+
+    /* Register the base EL3 cpregs. */
     if (arm_feature(env, ARM_FEATURE_EL3)) {
         define_arm_cp_regs(cpu, el3_cp_reginfo);
         ARMCPRegInfo el3_regs[] =3D {
--=20
2.25.1