qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exception


From: Greg Bellows
Subject: [Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exceptions
Date: Fri, 27 Mar 2015 14:10:41 -0500

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

Signed-off-by: Greg Bellows <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]