From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbZf5-0001dB-QV for qemu-devel@nongnu.org; Fri, 27 Mar 2015 15:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbZer-000547-JE for qemu-devel@nongnu.org; Fri, 27 Mar 2015 15:11:19 -0400 Received: from mail-ob0-f180.google.com ([209.85.214.180]:36605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbZer-00052y-Dc for qemu-devel@nongnu.org; Fri, 27 Mar 2015 15:11:05 -0400 Received: by obbld8 with SMTP id ld8so26678229obb.3 for ; Fri, 27 Mar 2015 12:11:05 -0700 (PDT) From: Greg Bellows Date: Fri, 27 Mar 2015 14:10:41 -0500 Message-Id: <1427483446-31900-3-git-send-email-greg.bellows@linaro.org> In-Reply-To: <1427483446-31900-1-git-send-email-greg.bellows@linaro.org> References: <1427483446-31900-1-git-send-email-greg.bellows@linaro.org> Subject: [Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org, alex.bennee@linaro.org Cc: Greg Bellows Updated the various helper routines to set the target EL as needed. Signed-off-by: Greg Bellows --- 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