From patchwork Fri Mar 27 19:10:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 46440 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2BE2C21597 for ; Fri, 27 Mar 2015 19:13:07 +0000 (UTC) Received: by wixm2 with SMTP id m2sf6796200wix.0 for ; Fri, 27 Mar 2015 12:13:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=CT+ZrX6QleVTh7DpAYNq3OKxOPgBO9u3dfA1YHuRges=; b=FWnXAwLu9vKdocXwx8y3kaLUDg0TIUN+Oy9Y9x8xvKhtuxZflvHQk9oSyt6PWKToPG 2NqSJ+277vtGu9qy6600+RsuxJcthQ45MQIMmGC1jRlxajA0kFigBzRHL7OA/X1+7F0n SkvDibkN4OHgAnv6J+7V7JHG+Dmi2FkmYO5qk5x/nNWJTn35zUsh2BvL4uQfDqHfUKKD LBEXMEVbN94FQE95dj50SkU23g7JKkE80Y/wP3RUnCVhWOwuo+Hv47YXndoBad6qwIRn Z7sublXVPOXayPUYtjqxn0zYn9bbA5memWxFk/Oh+BheIgOM/3ffwa4LA2AZjwhn7iKj gWJg== X-Gm-Message-State: ALoCoQmTHzgtfkP1YaeAQc0bGgMCoe5JcpYLMQPj4RC2q+V9fLRk12Y7ZJt8PYUy9KMyrCJQYXDg X-Received: by 10.112.167.131 with SMTP id zo3mr5087002lbb.7.1427483586422; Fri, 27 Mar 2015 12:13:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.131 with SMTP id dg3ls411299lac.74.gmail; Fri, 27 Mar 2015 12:13:06 -0700 (PDT) X-Received: by 10.152.115.134 with SMTP id jo6mr5661410lab.10.1427483586270; Fri, 27 Mar 2015 12:13:06 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id tz9si1948029lbb.156.2015.03.27.12.13.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 12:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbug6 with SMTP id ug6so70487555lbb.3 for ; Fri, 27 Mar 2015 12:13:06 -0700 (PDT) X-Received: by 10.152.87.135 with SMTP id ay7mr3801036lab.88.1427483585982; Fri, 27 Mar 2015 12:13:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp66001lbq; Fri, 27 Mar 2015 12:13:05 -0700 (PDT) X-Received: by 10.140.133.67 with SMTP id 64mr27521171qhf.17.1427483584751; Fri, 27 Mar 2015 12:13:04 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f135si2751186qhe.122.2015.03.27.12.13.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 12:13:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:51412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbZgl-000370-Nk for patch@linaro.org; Fri, 27 Mar 2015 15:13:03 -0400 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) X-Received: by 10.182.126.162 with SMTP id mz2mr17533850obb.21.1427483465095; Fri, 27 Mar 2015 12:11:05 -0700 (PDT) Received: from gbellows-linaro.bellowshome.netattlocal.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id hc7sm1490859obb.16.2015.03.27.12.11.03 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Mar 2015 12:11:04 -0700 (PDT) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org, alex.bennee@linaro.org Date: Fri, 27 Mar 2015 14:10:41 -0500 Message-Id: <1427483446-31900-3-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1427483446-31900-1-git-send-email-greg.bellows@linaro.org> References: <1427483446-31900-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.214.180 Cc: Greg Bellows Subject: [Qemu-devel] [[PATCH] 2/7] target-arm: Extend helpers to route exceptions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: greg.bellows@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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); } }