From patchwork Thu Oct 30 21:28:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 39937 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 584512405B for ; Fri, 31 Oct 2014 16:16:49 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k14sf4299764wgh.3 for ; Fri, 31 Oct 2014 09:16:48 -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=Z2CJG7x+7rCs9BD2IORaivE6ZHzV6pyNsKHd2Ut6DAc=; b=dVK0BWYV/pn1ZrdeewsV36sMcUxOaZnCkn9f4GcygJytWkvC1g7d/AM9AJFLzMXVZD 8SrsMBZF111pHGe7frQfqHjpSC57BrMf2TZHZq+AeCm3b0quxRu3VsZlUIGfAGdD1Dwb iLi4Wew7SMjNfkBr9dNwoDi5PQOe52AGcaDXKTnautGYeSA75jm+OiT2K/F0HOsQHMh+ EBjTd6q2TbFnn/p844dta1peXa13j/0UXDtNUAVh5luyG3t96rXTAnUwggkzlmqrHuVL xqzEieFurH5ecMjoq5vhQnV2rSqwhiEKuOL+7Y+Oe4SAJ9V1mSVhkn2gx7UtMaB2Ibbd 9Qeg== X-Gm-Message-State: ALoCoQmHbkpq92qDdc4Iww75caMOLNfNcooInixslJvk/rpl9/zHpa1TWWlm2tjOKN5B2Upy14cW X-Received: by 10.112.16.35 with SMTP id c3mr543355lbd.13.1414772208575; Fri, 31 Oct 2014 09:16:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.165 with SMTP id d5ls493576lag.1.gmail; Fri, 31 Oct 2014 09:16:48 -0700 (PDT) X-Received: by 10.112.169.106 with SMTP id ad10mr27426644lbc.13.1414772208306; Fri, 31 Oct 2014 09:16:48 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id l8si17483528lam.40.2014.10.31.09.16.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id hz20so4014591lab.9 for ; Fri, 31 Oct 2014 09:16:48 -0700 (PDT) X-Received: by 10.152.120.199 with SMTP id le7mr4922106lab.67.1414772207817; Fri, 31 Oct 2014 09:16:47 -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.84.229 with SMTP id c5csp226817lbz; Fri, 31 Oct 2014 09:16:46 -0700 (PDT) X-Received: by 10.140.86.116 with SMTP id o107mr35707828qgd.67.1414772205091; Fri, 31 Oct 2014 09:16:45 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n69si17818723qga.24.2014.10.31.09.16.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:16:45 -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]:38808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEsW-00037H-0R for patch@linaro.org; Fri, 31 Oct 2014 12:16:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkE63-0004z6-9r for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:27:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjxHm-00059m-Kq for qemu-devel@nongnu.org; Thu, 30 Oct 2014 17:29:43 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:60876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjxHm-00058z-Fi for qemu-devel@nongnu.org; Thu, 30 Oct 2014 17:29:38 -0400 Received: by mail-pa0-f53.google.com with SMTP id kx10so6273260pab.40 for ; Thu, 30 Oct 2014 14:29:37 -0700 (PDT) X-Received: by 10.66.218.168 with SMTP id ph8mr20081390pac.51.1414704577839; Thu, 30 Oct 2014 14:29:37 -0700 (PDT) Received: from gbellows-linaro.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com. [67.52.129.61]) by mx.google.com with ESMTPSA id o5sm8017713pdr.50.2014.10.30.14.29.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 14:29:37 -0700 (PDT) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch Date: Thu, 30 Oct 2014 16:28:51 -0500 Message-Id: <1414704538-17103-21-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1414704538-17103-1-git-send-email-greg.bellows@linaro.org> References: <1414704538-17103-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.220.53 Cc: greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v8 20/27] target-arm: make IFSR banked 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.215.50 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 From: Fabian Aggeler When EL3 is running in AArch32 (or ARMv7 with Security Extensions) IFSR has a secure and a non-secure instance. Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows --- target-arm/cpu.h | 10 +++++++++- target-arm/helper.c | 9 +++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 6d39af1..c44649e 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -251,7 +251,15 @@ typedef struct CPUARMState { uint32_t pmsav5_insn_ap; /* PMSAv5 MPU insn access permissions */ uint64_t hcr_el2; /* Hypervisor configuration register */ uint64_t scr_el3; /* Secure configuration register. */ - uint32_t ifsr_el2; /* Fault status registers. */ + union { /* Fault status registers. */ + struct { + uint32_t ifsr_ns; + uint32_t ifsr_s; + }; + struct { + uint32_t ifsr32_el2; + }; + }; uint64_t esr_el[4]; uint32_t c6_region[8]; /* MPU base/size registers. */ uint64_t far_el[4]; /* Fault address registers. */ diff --git a/target-arm/helper.c b/target-arm/helper.c index eaae534..de355f5 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1653,8 +1653,9 @@ static const ARMCPRegInfo vmsa_cp_reginfo[] = { .fieldoffset = offsetoflow32(CPUARMState, cp15.esr_el[1]), .resetfn = arm_cp_reset_ignore, }, { .name = "IFSR", .cp = 15, .crn = 5, .crm = 0, .opc1 = 0, .opc2 = 1, - .access = PL1_RW, - .fieldoffset = offsetof(CPUARMState, cp15.ifsr_el2), .resetvalue = 0, }, + .access = PL1_RW, .resetvalue = 0, + .bank_fieldoffsets = { offsetof(CPUARMState, cp15.ifsr_s), + offsetof(CPUARMState, cp15.ifsr_ns) } }, { .name = "ESR_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .crn = 5, .crm = 2, .opc1 = 0, .opc2 = 0, .access = PL1_RW, @@ -4297,11 +4298,11 @@ void arm_cpu_do_interrupt(CPUState *cs) env->exception.fsr = 2; /* Fall through to prefetch abort. */ case EXCP_PREFETCH_ABORT: - env->cp15.ifsr_el2 = env->exception.fsr; + A32_BANKED_CURRENT_REG_SET(env, ifsr, env->exception.fsr); env->cp15.far_el[1] = deposit64(env->cp15.far_el[1], 32, 32, env->exception.vaddress); qemu_log_mask(CPU_LOG_INT, "...with IFSR 0x%x IFAR 0x%x\n", - env->cp15.ifsr_el2, (uint32_t)env->exception.vaddress); + env->exception.fsr, (uint32_t)env->exception.vaddress); new_mode = ARM_CPU_MODE_ABT; addr = 0x0c; mask = CPSR_A | CPSR_I;