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,
john.williams@xilinx.com, alex.bennee@linaro.org, agraf@suse.de
Subject: [Qemu-devel] [PATCH v1 03/22] target-arm: Make esr_el1 an array
Date: Tue, 6 May 2014 16:08:07 +1000 [thread overview]
Message-ID: <1399356506-5609-4-git-send-email-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <1399356506-5609-1-git-send-email-edgar.iglesias@gmail.com>
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
No functional change.
Prepares for future addtion of EL2 and 3 versions of this reg.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
target-arm/cpu.h | 3 ++-
target-arm/helper-a64.c | 4 ++--
target-arm/helper.c | 11 ++++++-----
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index eb7a0f5..2a068ec 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -186,7 +186,8 @@ typedef struct CPUARMState {
uint32_t pmsav5_data_ap; /* PMSAv5 MPU data access permissions */
uint32_t pmsav5_insn_ap; /* PMSAv5 MPU insn access permissions */
uint32_t ifsr_el2; /* Fault status registers. */
- uint64_t esr_el1;
+#define ESR_EL_IDX(x) (x - 1)
+ uint64_t esr_el[1];
uint32_t c6_region[8]; /* MPU base/size registers. */
uint64_t far_el1; /* Fault address registers. */
uint64_t par_el1; /* Translation result. */
diff --git a/target-arm/helper-a64.c b/target-arm/helper-a64.c
index 5adf2b5..4bee075 100644
--- a/target-arm/helper-a64.c
+++ b/target-arm/helper-a64.c
@@ -464,7 +464,7 @@ void aarch64_cpu_do_interrupt(CPUState *cs)
env->exception.syndrome);
}
- env->cp15.esr_el1 = env->exception.syndrome;
+ env->cp15.esr_el[ESR_EL_IDX(1)] = env->exception.syndrome;
env->cp15.far_el1 = env->exception.vaddress;
switch (cs->exception_index) {
@@ -495,7 +495,7 @@ void aarch64_cpu_do_interrupt(CPUState *cs)
} else {
env->banked_spsr[0] = cpsr_read(env);
if (!env->thumb) {
- env->cp15.esr_el1 |= 1 << 25;
+ env->cp15.esr_el[ESR_EL_IDX(1)] |= 1 << 25;
}
env->elr_el[ELR_EL_IDX(1)] = env->regs[15];
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 3457d3e..c86fab6 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1452,7 +1452,7 @@ static void vmsa_ttbr_write(CPUARMState *env, const ARMCPRegInfo *ri,
static const ARMCPRegInfo vmsa_cp_reginfo[] = {
{ .name = "DFSR", .cp = 15, .crn = 5, .crm = 0, .opc1 = 0, .opc2 = 0,
.access = PL1_RW, .type = ARM_CP_NO_MIGRATE,
- .fieldoffset = offsetoflow32(CPUARMState, cp15.esr_el1),
+ .fieldoffset = offsetoflow32(CPUARMState, cp15.esr_el[ESR_EL_IDX(1)]),
.resetfn = arm_cp_reset_ignore, },
{ .name = "IFSR", .cp = 15, .crn = 5, .crm = 0, .opc1 = 0, .opc2 = 1,
.access = PL1_RW,
@@ -1460,7 +1460,8 @@ static const ARMCPRegInfo vmsa_cp_reginfo[] = {
{ .name = "ESR_EL1", .state = ARM_CP_STATE_AA64,
.opc0 = 3, .crn = 5, .crm = 2, .opc1 = 0, .opc2 = 0,
.access = PL1_RW,
- .fieldoffset = offsetof(CPUARMState, cp15.esr_el1), .resetvalue = 0, },
+ .fieldoffset = offsetof(CPUARMState, cp15.esr_el[ESR_EL_IDX(1)]),
+ .resetvalue = 0, },
{ .name = "TTBR0_EL1", .state = ARM_CP_STATE_BOTH,
.opc0 = 3, .crn = 2, .crm = 0, .opc1 = 0, .opc2 = 0,
.access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.ttbr0_el1),
@@ -1521,7 +1522,7 @@ static void omap_cachemaint_write(CPUARMState *env, const ARMCPRegInfo *ri,
static const ARMCPRegInfo omap_cp_reginfo[] = {
{ .name = "DFSR", .cp = 15, .crn = 5, .crm = CP_ANY,
.opc1 = CP_ANY, .opc2 = CP_ANY, .access = PL1_RW, .type = ARM_CP_OVERRIDE,
- .fieldoffset = offsetoflow32(CPUARMState, cp15.esr_el1),
+ .fieldoffset = offsetoflow32(CPUARMState, cp15.esr_el[ESR_EL_IDX(1)]),
.resetvalue = 0, },
{ .name = "", .cp = 15, .crn = 15, .crm = 0, .opc1 = 0, .opc2 = 0,
.access = PL1_RW, .type = ARM_CP_NOP },
@@ -3331,11 +3332,11 @@ void arm_cpu_do_interrupt(CPUState *cs)
offset = 4;
break;
case EXCP_DATA_ABORT:
- env->cp15.esr_el1 = env->exception.fsr;
+ env->cp15.esr_el[ESR_EL_IDX(1)] = env->exception.fsr;
env->cp15.far_el1 = deposit64(env->cp15.far_el1, 0, 32,
env->exception.vaddress);
qemu_log_mask(CPU_LOG_INT, "...with DFSR 0x%x DFAR 0x%x\n",
- (uint32_t)env->cp15.esr_el1,
+ (uint32_t)env->cp15.esr_el[ESR_EL_IDX(1)],
(uint32_t)env->exception.vaddress);
new_mode = ARM_CPU_MODE_ABT;
addr = 0x10;
--
1.8.3.2
next prev parent reply other threads:[~2014-05-06 6:11 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 6:08 [Qemu-devel] [PATCH v1 00/22] target-arm: Preparations for A64 EL2 and 3 Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 01/22] target-arm: A64: Add friendly logging of PSTATE A and I flags Edgar E. Iglesias
2014-05-07 5:32 ` Peter Crosthwaite
2014-05-07 8:50 ` Peter Maydell
2014-05-08 0:08 ` Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 02/22] target-arm: Make elr_el1 an array Edgar E. Iglesias
2014-05-07 5:10 ` Peter Crosthwaite
2014-05-08 0:13 ` Edgar E. Iglesias
2014-05-16 14:19 ` Peter Maydell
2014-05-16 22:19 ` Edgar E. Iglesias
2014-05-16 14:22 ` Peter Maydell
2014-05-16 22:18 ` Edgar E. Iglesias
2014-05-06 6:08 ` Edgar E. Iglesias [this message]
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 04/22] target-arm: c12_vbar -> vbar_el[] Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 05/22] target-arm: Add arm_el_to_mmu_idx() Edgar E. Iglesias
2014-05-07 5:43 ` Peter Crosthwaite
2014-05-16 14:24 ` Peter Maydell
2014-05-16 22:10 ` Edgar E. Iglesias
2014-05-16 22:13 ` Alexander Graf
2014-05-17 1:41 ` Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 06/22] target-arm: Move get_mem_index to translate.h Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 07/22] target-arm: A64: Add SP entries for EL2 and 3 Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 08/22] target-arm: A64: Add ELR " Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 09/22] target-arm: Add SPSR entries for EL2/HYP and EL3/MON Edgar E. Iglesias
2014-05-07 5:31 ` Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 10/22] target-arm: A64: Introduce arm64_banked_spsr_index() Edgar E. Iglesias
2014-05-07 5:50 ` Peter Crosthwaite
2014-05-16 14:31 ` Peter Maydell
2014-05-17 2:21 ` Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 11/22] target-arm: Add a feature flag for EL2 Edgar E. Iglesias
2014-05-07 5:50 ` Peter Crosthwaite
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 12/22] target-arm: Add a feature flag for EL3 Edgar E. Iglesias
2014-05-07 5:51 ` Peter Crosthwaite
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 13/22] target-arm: Register EL2 versions of ELR and SPSR Edgar E. Iglesias
2014-05-07 6:02 ` Peter Crosthwaite
2014-05-16 14:36 ` Peter Maydell
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 14/22] target-arm: Register EL3 " Edgar E. Iglesias
2014-05-07 6:02 ` Peter Crosthwaite
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 15/22] target-arm: A64: Forbid ERET to increase the EL Edgar E. Iglesias
2014-05-07 6:03 ` Peter Crosthwaite
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 16/22] target-arm: A64: Forbid ERET to unimplemented ELs Edgar E. Iglesias
2014-05-07 6:04 ` Peter Crosthwaite
2014-05-07 9:00 ` Peter Maydell
2014-05-08 0:14 ` Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 17/22] target-arm: A64: Generalize ERET to various ELs Edgar E. Iglesias
2014-05-07 6:09 ` Peter Crosthwaite
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 18/22] target-arm: A64: Generalize update_spsel for the " Edgar E. Iglesias
2014-05-07 6:13 ` Peter Crosthwaite
2014-05-13 17:32 ` Richard Henderson
2014-05-14 1:18 ` Edgar E. Iglesias
2014-05-14 15:57 ` Richard Henderson
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 19/22] target-arm: Add storage for VBAR_EL2 and 3 Edgar E. Iglesias
2014-05-16 14:40 ` Peter Maydell
2014-05-17 1:42 ` Edgar E. Iglesias
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 20/22] target-arm: Make vbar_write writeback to any CPREG Edgar E. Iglesias
2014-05-07 6:19 ` Peter Crosthwaite
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 21/22] target-arm: A64: Register VBAR_EL2 Edgar E. Iglesias
2014-05-07 6:22 ` Peter Crosthwaite
2014-05-16 14:43 ` Peter Maydell
2014-05-06 6:08 ` [Qemu-devel] [PATCH v1 22/22] target-arm: A64: Register VBAR_EL3 Edgar E. Iglesias
2014-05-07 6:23 ` Peter Crosthwaite
2014-05-06 7:58 ` [Qemu-devel] [PATCH v1 00/22] target-arm: Preparations for A64 EL2 and 3 Peter Maydell
2014-05-07 3:46 ` Edgar E. Iglesias
2014-05-12 19:13 ` Aggeler Fabian
2014-05-12 20:39 ` Peter Maydell
2014-05-14 8:58 ` Aggeler Fabian
2014-05-14 13:55 ` Greg Bellows
2014-05-15 9:28 ` Aggeler Fabian
2014-05-15 9:45 ` Sergey Fedorov
2014-05-15 12:44 ` Christopher Covington
2014-05-14 14:56 ` Edgar E. Iglesias
2014-05-12 23:41 ` Peter Crosthwaite
2014-05-13 3:31 ` Edgar E. Iglesias
2014-05-06 8:24 ` Alexander Graf
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=1399356506-5609-4-git-send-email-edgar.iglesias@gmail.com \
--to=edgar.iglesias@gmail.com \
--cc=agraf@suse.de \
--cc=alex.bennee@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 \
/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).