qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Bellows <greg.bellows@linaro.org>
To: qemu-devel@nongnu.org, peter.maydell@linaro.org, alex.bennee@linaro.org
Cc: Greg Bellows <greg.bellows@linaro.org>
Subject: [Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exceptions
Date: Fri, 27 Mar 2015 14:10:41 -0500	[thread overview]
Message-ID: <1427483446-31900-3-git-send-email-greg.bellows@linaro.org> (raw)
In-Reply-To: <1427483446-31900-1-git-send-email-greg.bellows@linaro.org>

Updated the various helper routines to set the target EL as needed.

Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
---
 target-arm/op_helper.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index 72a973a..aa175b5 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -306,6 +306,7 @@ void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip, uint32_t syndrome)
     if (arm_feature(env, ARM_FEATURE_XSCALE) && ri->cp < 14
         && extract32(env->cp15.c15_cpar, ri->cp, 1) == 0) {
         env->exception.syndrome = syndrome;
+        env->exception.target_el = MAX(arm_current_el(env), 1);
         raise_exception(env, EXCP_UDEF);
     }
 
@@ -363,6 +364,7 @@ void HELPER(msr_i_pstate)(CPUARMState *env, uint32_t op, uint32_t imm)
      * to catch that case at translate time.
      */
     if (arm_current_el(env) == 0 && !(env->cp15.sctlr_el[1] & SCTLR_UMA)) {
+        env->exception.target_el = MAX(arm_current_el(env), 1);
         raise_exception(env, EXCP_UDEF);
     }
 
@@ -422,6 +424,7 @@ void HELPER(pre_hvc)(CPUARMState *env)
 
     if (undef) {
         env->exception.syndrome = syn_uncategorized();
+        env->exception.target_el = MAX(arm_current_el(env), 1);
         raise_exception(env, EXCP_UDEF);
     }
 }
@@ -452,11 +455,13 @@ void HELPER(pre_smc)(CPUARMState *env, uint32_t syndrome)
     } else if (!secure && cur_el == 1 && (env->cp15.hcr_el2 & HCR_TSC)) {
         /* In NS EL1, HCR controlled routing to EL2 has priority over SMD. */
         env->exception.syndrome = syndrome;
+        env->exception.target_el = 2;
         raise_exception(env, EXCP_HYP_TRAP);
     }
 
     if (undef) {
         env->exception.syndrome = syn_uncategorized();
+        env->exception.target_el = MAX(arm_current_el(env), 1);
         raise_exception(env, EXCP_UDEF);
     }
 }
-- 
1.8.3.2

  parent reply	other threads:[~2015-03-27 19:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 19:10 [Qemu-devel] [[PATCH] 0/7] target-arm: EL3 trap support Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 1/7] target-arm: Add exception target el infrastructure Greg Bellows
2015-04-16 17:50   ` Peter Maydell
2015-04-16 21:39     ` Greg Bellows
2015-03-27 19:10 ` Greg Bellows [this message]
2015-04-16 17:51   ` [Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exceptions Peter Maydell
2015-04-21 22:13     ` Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 3/7] target-arm: Update interrupt handling to use target EL Greg Bellows
2015-04-16 17:52   ` Peter Maydell
2015-04-16 21:03     ` Greg Bellows
2015-04-16 21:26       ` Peter Maydell
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 4/7] target-arm: Add AArch64 CPTR registers Greg Bellows
2015-04-16 18:00   ` Peter Maydell
2015-04-20 19:57     ` Greg Bellows
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 5/7] target-arm: Add TTBR regime function and use Greg Bellows
2015-03-27 23:25   ` Sergey Fedorov
2015-04-16 18:03   ` Peter Maydell
2015-04-17 18:29     ` Greg Bellows
2015-04-21  5:15   ` Sergey Fedorov
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 6/7] target-arm: Add WFx syndrome function Greg Bellows
2015-04-16 18:05   ` Peter Maydell
2015-03-27 19:10 ` [Qemu-devel] [[PATCH] 7/7] target-arm: Add WFx instruction trap support Greg Bellows
2015-04-16 18:22   ` Peter Maydell
2015-04-17 15:47     ` Greg Bellows
2015-04-17 15:50       ` 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=1427483446-31900-3-git-send-email-greg.bellows@linaro.org \
    --to=greg.bellows@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).