From patchwork Mon Jun 30 23:09:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 32815 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8AF29203F4 for ; Mon, 30 Jun 2014 23:25:35 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id i13sf17632382qae.11 for ; Mon, 30 Jun 2014 16:25:35 -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=++ETWBOY1DcRhuCc22xQdZWj9+Rr6PQ98QZQGex5zlU=; b=hcg01HZQ+VjpcN0Xu2b62Y72P4Hp4didFUviPnmbDkyOjzrQeUHWhUQIWeVfj1WQt/ VFtIDr2cL/AdcusV+WrK2mb2+oyzaLoGf3nHKJHfi2ZzD+VbVpOWbJ+306gMXS2qwxuo WDpdK9m2qy0lgIFizzaEah785Kjp76cAu1ii0i5OAE1oZl5KZZfVbdXWUD0keeujhoGq OEKjfko84f+sElakJEBzob7UwZmgb1Lvaa7Fpx4gZ7GGamZs2wlr77ZUwHalB5ym5u4V WW48qEgB/XIzR9Zi23SUrxaGT7Wd4ApUGd9T4nsASSbv7qPK9v16KbAruO0f9ZTboyOr 6NWw== X-Gm-Message-State: ALoCoQmzbyx0wagUEHQPOM48ozM9Q5MvCxfGFE63T5Xh2j84ALBa5EHoGJJOnvslMibi1szbYryM X-Received: by 10.58.187.68 with SMTP id fq4mr24502002vec.0.1404170735386; Mon, 30 Jun 2014 16:25:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.168 with SMTP id h37ls257565qgd.62.gmail; Mon, 30 Jun 2014 16:25:35 -0700 (PDT) X-Received: by 10.58.39.42 with SMTP id m10mr39808613vek.29.1404170735199; Mon, 30 Jun 2014 16:25:35 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id r7si10690639vdc.51.2014.06.30.16.25.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so8159921vcb.36 for ; Mon, 30 Jun 2014 16:25:35 -0700 (PDT) X-Received: by 10.58.150.100 with SMTP id uh4mr41738447veb.30.1404170735118; Mon, 30 Jun 2014 16:25:35 -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.221.37.5 with SMTP id tc5csp175427vcb; Mon, 30 Jun 2014 16:25:34 -0700 (PDT) X-Received: by 10.224.12.138 with SMTP id x10mr15838033qax.36.1404170734705; Mon, 30 Jun 2014 16:25:34 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q65si27273634qga.96.2014.06.30.16.25.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:25:34 -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]:37205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kx4-00042l-BS for patch@linaro.org; Mon, 30 Jun 2014 19:25:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kjO-0006eY-Vt for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1kjJ-0003nj-JM for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:26 -0400 Received: from mail-oa0-f51.google.com ([209.85.219.51]:42526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kjJ-0003n1-7R for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:21 -0400 Received: by mail-oa0-f51.google.com with SMTP id j17so9656670oag.38 for ; Mon, 30 Jun 2014 16:11:21 -0700 (PDT) X-Received: by 10.182.44.197 with SMTP id g5mr46027927obm.18.1404169880952; Mon, 30 Jun 2014 16:11:20 -0700 (PDT) Received: from gbellows-linaro.bellowshome.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id cu7sm76370192oec.12.2014.06.30.16.11.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:11:19 -0700 (PDT) From: greg.bellows@linaro.org To: qemu-devel@nongnu.org Date: Mon, 30 Jun 2014 18:09:27 -0500 Message-Id: <1404169773-20264-28-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1404169773-20264-1-git-send-email-greg.bellows@linaro.org> References: <1404169773-20264-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.219.51 Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, Fabian Aggeler , Greg Bellows , serge.fdrv@gmail.com, edgar.iglesias@gmail.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH v4 27/33] 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.220.177 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 05eebdf..7935915 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -257,7 +257,15 @@ typedef struct CPUARMState { uint32_t pmsav5_insn_ap; /* PMSAv5 MPU insn access permissions */ uint64_t hcr_el2; /* Hypervisor configuration register */ uint32_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 79bf844..fea2d59 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1506,8 +1506,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, @@ -3870,11 +3871,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;