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,
greg.bellows@linaro.org, alex.bennee@linaro.org,
christoffer.dall@linaro.org, rth@twiddle.net
Subject: [Qemu-devel] [PATCH v5 17/23] target-arm: A64: Forbid ERET to higher or unimplemented ELs
Date: Sun, 25 May 2014 11:08:46 +1000 [thread overview]
Message-ID: <1400980132-25949-18-git-send-email-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <1400980132-25949-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/op_helper.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index c2b4bf0..e95a7f4 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -389,6 +389,7 @@ void HELPER(exception_return)(CPUARMState *env)
unsigned int spsr_idx = aarch64_banked_spsr_index(1);
uint32_t spsr = env->banked_spsr[spsr_idx];
int new_el, i;
+ int cur_el = arm_current_pl(env);
if (env->pstate & PSTATE_SP) {
env->sp_el[1] = env->xregs[31];
@@ -410,8 +411,11 @@ void HELPER(exception_return)(CPUARMState *env)
env->regs[15] = env->elr_el[1] & ~0x1;
} else {
new_el = extract32(spsr, 2, 2);
- if (new_el > 1) {
- /* Return to unimplemented EL */
+ if (new_el > cur_el
+ || (new_el == 2 && !arm_feature(env, ARM_FEATURE_EL2))) {
+ /* Disallow return to an EL which is unimplemented or higher
+ * than the current one.
+ */
goto illegal_return;
}
if (extract32(spsr, 1, 1)) {
--
1.8.3.2
next prev parent reply other threads:[~2014-05-25 1:21 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-25 1:08 [Qemu-devel] [PATCH v5 00/23] target-arm: Preparations for A64 EL2 and 3 Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 01/23] target-arm: Move get_mem_index to translate.h Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 02/23] target-arm/translate.c: Clean up mmu index handling for ldrt/strt Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 03/23] target-arm/translate.c: Use get_mem_index() for SRS memory accesses Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 04/23] target-arm: A32: Use get_mem_index for load/stores Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 05/23] target-arm: Use a 1:1 mapping between EL and MMU index Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 06/23] target-arm: Make elr_el1 an array Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 07/23] target-arm: Make esr_el1 " Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 08/23] target-arm: c12_vbar -> vbar_el[] Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 09/23] target-arm: A64: Add SP entries for EL2 and 3 Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 10/23] target-arm: A64: Add ELR " Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 11/23] target-arm: Add SPSR entries for EL2/HYP and EL3/MON Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 12/23] target-arm: A64: Introduce aarch64_banked_spsr_index() Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 13/23] target-arm: Add a feature flag for EL2 Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 14/23] target-arm: Add a feature flag for EL3 Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 15/23] target-arm: Register EL2 versions of ELR and SPSR Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 16/23] target-arm: Register EL3 " Edgar E. Iglesias
2014-05-25 1:08 ` Edgar E. Iglesias [this message]
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 18/23] target-arm: A64: Trap ERET from EL0 at translation time Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 19/23] target-arm: A64: Generalize ERET to various ELs Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 20/23] target-arm: A64: Generalize update_spsel for the " Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 21/23] target-arm: Make vbar_write writeback to any CPREG Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 22/23] target-arm: A64: Register VBAR_EL2 Edgar E. Iglesias
2014-05-25 1:08 ` [Qemu-devel] [PATCH v5 23/23] target-arm: A64: Register VBAR_EL3 Edgar E. Iglesias
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=1400980132-25949-18-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=greg.bellows@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).