qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com,
	aggelerf@ethz.ch, agraf@suse.de, john.williams@xilinx.com,
	alex.bennee@linaro.org, christoffer.dall@linaro.org,
	rth@twiddle.net
Subject: [Qemu-devel] [PATCH v4 20/21] target-arm: A64: Register VBAR_EL2
Date: Fri, 23 May 2014 10:42:17 +1000	[thread overview]
Message-ID: <1400805738-11889-21-git-send-email-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <1400805738-11889-1-git-send-email-edgar.iglesias@gmail.com>

From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 target-arm/cpu.h    |  2 +-
 target-arm/helper.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index b14fac5..3ccbd95 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -198,7 +198,7 @@ typedef struct CPUARMState {
         uint32_t c9_pmuserenr; /* perf monitor user enable */
         uint32_t c9_pminten; /* perf monitor interrupt enables */
         uint64_t mair_el1;
-        uint64_t vbar_el[2]; /* vector base address register */
+        uint64_t vbar_el[3]; /* vector base address register */
         uint32_t c13_fcse; /* FCSE PID.  */
         uint64_t contextidr_el1; /* Context ID.  */
         uint64_t tpidr_el0; /* User RW Thread register.  */
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 5a2073e..ebe735b 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -2077,6 +2077,15 @@ static const ARMCPRegInfo v8_cp_reginfo[] = {
     REGINFO_SENTINEL
 };
 
+/* Used to describe the behaviour of EL2 regs when EL2 does not exist.  */
+static const ARMCPRegInfo v8_el3_no_el2_cp_reginfo[] = {
+    { .name = "VBAR_EL2", .state = ARM_CP_STATE_AA64,
+      .opc0 = 3, .opc1 = 4, .crn = 12, .crm = 0, .opc2 = 0,
+      .access = PL2_RW,
+      .readfn = arm_cp_read_zero, .writefn = arm_cp_write_ignore },
+    REGINFO_SENTINEL
+};
+
 static const ARMCPRegInfo v8_el2_cp_reginfo[] = {
     { .name = "ELR_EL2", .state = ARM_CP_STATE_AA64,
       .type = ARM_CP_NO_MIGRATE,
@@ -2087,6 +2096,11 @@ static const ARMCPRegInfo v8_el2_cp_reginfo[] = {
       .type = ARM_CP_NO_MIGRATE,
       .opc0 = 3, .opc1 = 4, .crn = 4, .crm = 0, .opc2 = 0,
       .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, banked_spsr[6]) },
+    { .name = "VBAR_EL2", .state = ARM_CP_STATE_AA64,
+      .opc0 = 3, .opc1 = 4, .crn = 12, .crm = 0, .opc2 = 0,
+      .access = PL2_RW, .writefn = vbar_write,
+      .fieldoffset = offsetof(CPUARMState, cp15.vbar_el[2]),
+      .resetvalue = 0 },
     REGINFO_SENTINEL
 };
 
@@ -2356,6 +2370,13 @@ void register_cp_regs_for_features(ARMCPU *cpu)
     }
     if (arm_feature(env, ARM_FEATURE_EL2)) {
         define_arm_cp_regs(cpu, v8_el2_cp_reginfo);
+    } 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)) {
+            define_arm_cp_regs(cpu, v8_el3_no_el2_cp_reginfo);
+        }
     }
     if (arm_feature(env, ARM_FEATURE_EL3)) {
         define_arm_cp_regs(cpu, v8_el3_cp_reginfo);
-- 
1.8.3.2

  parent reply	other threads:[~2014-05-23  0:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  0:41 [Qemu-devel] [PATCH v4 00/21] target-arm: Preparations for A64 EL2 and 3 Edgar E. Iglesias
2014-05-23  0:41 ` [Qemu-devel] [PATCH v4 01/21] target-arm: Make elr_el1 an array Edgar E. Iglesias
2014-05-23  0:41 ` [Qemu-devel] [PATCH v4 02/21] target-arm: Make esr_el1 " Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 03/21] target-arm: c12_vbar -> vbar_el[] Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 04/21] target-arm: Move get_mem_index to translate.h Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 05/21] target-arm: A32: Use get_mem_index for load/stores Edgar E. Iglesias
2014-05-23 14:26   ` Peter Maydell
2014-05-23 14:45   ` Peter Maydell
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 06/21] target-arm: Use a 1:1 mapping between EL and MMU index Edgar E. Iglesias
2014-05-23 14:04   ` Peter Maydell
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 07/21] target-arm: A64: Add SP entries for EL2 and 3 Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 08/21] target-arm: A64: Add ELR " Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 09/21] target-arm: Add SPSR entries for EL2/HYP and EL3/MON Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 10/21] target-arm: A64: Introduce aarch64_banked_spsr_index() Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 11/21] target-arm: Add a feature flag for EL2 Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 12/21] target-arm: Add a feature flag for EL3 Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 13/21] target-arm: Register EL2 versions of ELR and SPSR Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 14/21] target-arm: Register EL3 " Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 15/21] target-arm: A64: Forbid ERET to higher or unimplemented ELs Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 16/21] target-arm: A64: Trap ERET from EL0 at translation time Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 17/21] target-arm: A64: Generalize ERET to various ELs Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 18/21] target-arm: A64: Generalize update_spsel for the " Edgar E. Iglesias
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 19/21] target-arm: Make vbar_write writeback to any CPREG Edgar E. Iglesias
2014-05-23  0:42 ` Edgar E. Iglesias [this message]
2014-05-23  0:42 ` [Qemu-devel] [PATCH v4 21/21] target-arm: A64: Register VBAR_EL3 Edgar E. Iglesias
2014-05-23 12:54 ` [Qemu-devel] [PATCH v4 00/21] target-arm: Preparations for A64 EL2 and 3 Peter Maydell
2014-05-23 15:39   ` Peter Maydell
2014-05-25  0:28     ` Edgar E. Iglesias
2014-05-25  9:09       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400805738-11889-21-git-send-email-edgar.iglesias@gmail.com \
    --to=edgar.iglesias@gmail.com \
    --cc=aggelerf@ethz.ch \
    --cc=agraf@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=john.williams@xilinx.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).