From patchwork Tue Sep 30 21:49:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 38208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5D2A52055D for ; Tue, 30 Sep 2014 22:06:54 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf6186779lam.4 for ; Tue, 30 Sep 2014 15:06: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=I9ogOgn3kiJI40DiXn100qCx0IVZaXSTfa6Z2uA2+/0=; b=T6HmjSdkIA45UnOUY4+fpCjZMOqNHZ3th7BNGyS4IzPnCEBdvloswfrbvTVR3ydn0O P/UukmfwxNGvSpHiDKxoPK0Wugstf0s0eLK8e26PbwWLKbngYaWD0F+VauZRMkyOC/kR 6d+Ph3h3JVmhGHmr31j7u7+DQsHGyjr/UidsLBGtTTbnoLgJDEO8VU5mHh12qEmzVZRn Flr+omS6IeeCgb/A2r2cidliSJkKTRTXgTJxkzvlnKnoVRIk/+SHdTxHfMBdIiBgOxCX wDhs9Kc99FheQ6a6wamjw/HvTW4P9H19BR0jFx63nkRnov0TsS8aj8S6RpmwiwMVLco/ 3vjg== X-Gm-Message-State: ALoCoQnx97BQJxLylRASHLIg0G4bN8D+OA5/++0FxruqP8CLcbjtaGUJoK98y6cj9nUWNgGbLI3N X-Received: by 10.180.221.236 with SMTP id qh12mr1381578wic.4.1412114813190; Tue, 30 Sep 2014 15:06:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.165 with SMTP id f5ls97005lam.33.gmail; Tue, 30 Sep 2014 15:06:53 -0700 (PDT) X-Received: by 10.152.7.193 with SMTP id l1mr50632116laa.62.1412114813018; Tue, 30 Sep 2014 15:06:53 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id q13si24503618lal.108.2014.09.30.15.06.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 15:06:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so3313497lab.40 for ; Tue, 30 Sep 2014 15:06:52 -0700 (PDT) X-Received: by 10.112.4.33 with SMTP id h1mr46656201lbh.67.1412114812929; Tue, 30 Sep 2014 15:06:52 -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.130.169 with SMTP id of9csp431066lbb; Tue, 30 Sep 2014 15:06:52 -0700 (PDT) X-Received: by 10.224.97.10 with SMTP id j10mr66026174qan.43.1412114811688; Tue, 30 Sep 2014 15:06:51 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id z1si20398985qas.47.2014.09.30.15.06.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 15:06:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:46664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5ZK-0001C9-RE for patch@linaro.org; Tue, 30 Sep 2014 18:06:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5Jz-0001EZ-4z for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:51:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ5Jq-00044E-HN for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:50:59 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:56523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5Jq-00043W-1s for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:50:50 -0400 Received: by mail-pa0-f52.google.com with SMTP id fb1so8332952pad.11 for ; Tue, 30 Sep 2014 14:50:34 -0700 (PDT) X-Received: by 10.70.126.101 with SMTP id mx5mr79289899pdb.112.1412113834453; Tue, 30 Sep 2014 14:50:34 -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 qy1sm16027662pbc.27.2014.09.30.14.50.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 14:50:33 -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: Tue, 30 Sep 2014 16:49:38 -0500 Message-Id: <1412113785-21525-27-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412113785-21525-1-git-send-email-greg.bellows@linaro.org> References: <1412113785-21525-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.52 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v5 26/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.215.53 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. --- 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 5f9edc5..8e10e18 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -265,7 +265,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 a083566..85c7cc8 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1663,7 +1663,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, @@ -4389,11 +4390,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;