From patchwork Mon Jun 30 23:09:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 32816 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D539203F4 for ; Mon, 30 Jun 2014 23:26:53 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id id10sf18898066vcb.7 for ; Mon, 30 Jun 2014 16:26:53 -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=6KJflV0acD8Y9JrNwqTidPyVIlzltkRTr1UHxvTfbJQ=; b=fz0/mf36jV4RjUUF1WqLV85CXy/MBRoEs01lqKnTMAIsMVAZSGTIdiN4/fcG/z9QR3 hizsmQo8bKcEWk5UpJmggCSXPHntOVPPL0+ZuA4Gqm9x6vYdfMxEyUun5AWWSDqGQA/l OXPfeTRHZQuygZNcqAu3AQpaHzhZ9nTSkZl5mPTaxT7p8CBnogk8qeT2l07TWdwjWeYY WwOazNoeyaAdjNsMGINUI4oKLKKw1xTmuPnohugZ4JkpQue60pbF6/t95SCTWxn/MhYv snAyjQKg8ZfsDTkaWKmcKkveAcWN4Ao9lp1x01LOVpUYxSP4FHDB58JGwk9sWX1lB7TZ ORkw== X-Gm-Message-State: ALoCoQkRibn3WaAiiwkEWqIMZnPiLoerV82iZnAZcbmqgtZrbjq+ZDkJDTksbZxNH2PM/K2z0H0C X-Received: by 10.236.23.230 with SMTP id v66mr1916863yhv.53.1404170813399; Mon, 30 Jun 2014 16:26:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.107 with SMTP id f98ls505271qge.65.gmail; Mon, 30 Jun 2014 16:26:53 -0700 (PDT) X-Received: by 10.220.251.134 with SMTP id ms6mr21833720vcb.10.1404170813232; Mon, 30 Jun 2014 16:26:53 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id fj18si10734578vec.5.2014.06.30.16.26.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:26:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id db11so8776342veb.40 for ; Mon, 30 Jun 2014 16:26:53 -0700 (PDT) X-Received: by 10.220.105.136 with SMTP id t8mr40809079vco.13.1404170813094; Mon, 30 Jun 2014 16:26:53 -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 tc5csp175481vcb; Mon, 30 Jun 2014 16:26:52 -0700 (PDT) X-Received: by 10.224.128.193 with SMTP id l1mr65876942qas.91.1404170812585; Mon, 30 Jun 2014 16:26:52 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j10si1433297qao.21.2014.06.30.16.26.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:26:52 -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]:37253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kyK-0005ZV-6n for patch@linaro.org; Mon, 30 Jun 2014 19:26:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kjQ-0006hO-NP for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1kjL-0003qb-DK for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:28 -0400 Received: from mail-ob0-f172.google.com ([209.85.214.172]:43893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kjL-0003q5-7h for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:11:23 -0400 Received: by mail-ob0-f172.google.com with SMTP id uy5so9634241obc.17 for ; Mon, 30 Jun 2014 16:11:23 -0700 (PDT) X-Received: by 10.182.228.163 with SMTP id sj3mr6695992obc.72.1404169882958; Mon, 30 Jun 2014 16:11:22 -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.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 16:11:21 -0700 (PDT) From: greg.bellows@linaro.org To: qemu-devel@nongnu.org Date: Mon, 30 Jun 2014 18:09:28 -0500 Message-Id: <1404169773-20264-29-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.214.172 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 28/33] target-arm: make DFSR 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.128.181 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) DFSR has a secure and a non-secure instance. Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows --------------- v3 -> v4 - Reverted esr/dfsr back to array-based notation as a union with v7 naming. Signed-off-by: Greg Bellows --- target-arm/cpu.h | 10 +++++++++- target-arm/helper.c | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 7935915..872b42d 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -266,7 +266,15 @@ typedef struct CPUARMState { uint32_t ifsr32_el2; }; }; - uint64_t esr_el[4]; + union { + struct { + uint64_t _unused_dfsr; + uint64_t dfsr_ns; + uint64_t hsr; + uint64_t dfsr_s; + }; + uint64_t esr_el[4]; + }; uint32_t c6_region[8]; /* MPU base/size registers. */ uint64_t far_el[4]; /* Fault address registers. */ uint64_t par_el1; /* Translation result. */ diff --git a/target-arm/helper.c b/target-arm/helper.c index fea2d59..fa3ae3a 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1503,7 +1503,8 @@ static void vmsa_ttbr_write(CPUARMState *env, const ARMCPRegInfo *ri, static const ARMCPRegInfo vmsa_cp_reginfo[] = { { .name = "DFSR", .cp = 15, .crn = 5, .crm = 0, .opc1 = 0, .opc2 = 0, .access = PL1_RW, .type = ARM_CP_NO_MIGRATE, - .fieldoffset = offsetoflow32(CPUARMState, cp15.esr_el[1]), + .bank_fieldoffsets = { offsetoflow32(CPUARMState, cp15.dfsr_s), + offsetoflow32(CPUARMState, cp15.dfsr_ns) }, .resetfn = arm_cp_reset_ignore, }, { .name = "IFSR", .cp = 15, .crn = 5, .crm = 0, .opc1 = 0, .opc2 = 1, .access = PL1_RW, .resetvalue = 0, @@ -3882,11 +3883,11 @@ void arm_cpu_do_interrupt(CPUState *cs) offset = 4; break; case EXCP_DATA_ABORT: - env->cp15.esr_el[1] = env->exception.fsr; + A32_BANKED_CURRENT_REG_SET(env, dfsr, env->exception.fsr); env->cp15.far_el[1] = deposit64(env->cp15.far_el[1], 0, 32, env->exception.vaddress); qemu_log_mask(CPU_LOG_INT, "...with DFSR 0x%x DFAR 0x%x\n", - (uint32_t)env->cp15.esr_el[1], + env->exception.fsr, (uint32_t)env->exception.vaddress); new_mode = ARM_CPU_MODE_ABT; addr = 0x10;