From patchwork Fri Oct 10 16:03: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: 38607 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4F8AA205D8 for ; Fri, 10 Oct 2014 16:12:45 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf2285793lab.3 for ; Fri, 10 Oct 2014 09:12:44 -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: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=LuOEYcA3l3sgrwqfTgI96U2VFbCQpq8yTMmkp/ee0I0=; b=N6N2yn2QL0XMVzcXWneQbfX94LoIy0TtdTa2Lin54tpNKxjmNTbflgrdGjUWRAbR5C 1xdj3t4+UwcGM1Civj9lnYw/5J82mONDOgNo8csG8bVJtuASewPTLVELnAjTClmMjTtk h2+nO/B9BQudKYT1rWOIPt2d1daMrVoG3v+fN/fZJq5txMowDCaxYqbN2twERWU5AOkI 3rTAXWoLvk+aMyr2v/xu/WkJFuhXCZ/Q+QBiMb3G7XRBtVHVevRKG4b18TPuc1852aYk tdTqKrDFg4lVwT5eHNPdXKN9IUL4nJt3kVr2JqKsohS65jODw3a+a4h/zP9yW735Mk84 El2A== X-Gm-Message-State: ALoCoQn50Ew9XJt81LITpLssp2f5a4zSh5qJ6c7KMP75M8hfbP/nyRseDugfBOyOoeRs/nyMD4ne X-Received: by 10.181.25.234 with SMTP id it10mr1238547wid.1.1412957564093; Fri, 10 Oct 2014 09:12:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.132 with SMTP id c4ls272287lac.88.gmail; Fri, 10 Oct 2014 09:12:43 -0700 (PDT) X-Received: by 10.112.65.5 with SMTP id t5mr5819093lbs.82.1412957563936; Fri, 10 Oct 2014 09:12:43 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id c6si10024718laa.50.2014.10.10.09.12.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id gm9so3599922lab.13 for ; Fri, 10 Oct 2014 09:12:42 -0700 (PDT) X-Received: by 10.112.14.34 with SMTP id m2mr5721732lbc.74.1412957562362; Fri, 10 Oct 2014 09:12:42 -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 c5csp457217lbz; Fri, 10 Oct 2014 09:12:41 -0700 (PDT) X-Received: by 10.52.38.195 with SMTP id i3mr5296868vdk.8.1412957560847; Fri, 10 Oct 2014 09:12:40 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u67si11656169qgu.103.2014.10.10.09.12.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:12:40 -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]:49446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xcco3-0003BA-PR for patch@linaro.org; Fri, 10 Oct 2014 12:12:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccg7-0007Om-22 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xccg1-00088p-Pl for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:26 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:35993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccg1-00088b-FC for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:21 -0400 Received: by mail-oi0-f51.google.com with SMTP id h136so7098388oig.10 for ; Fri, 10 Oct 2014 09:04:21 -0700 (PDT) X-Received: by 10.182.191.102 with SMTP id gx6mr2943493obc.60.1412957061143; Fri, 10 Oct 2014 09:04:21 -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 d6sm5382455obt.12.2014.10.10.09.04.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:04:20 -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: Fri, 10 Oct 2014 11:03:38 -0500 Message-Id: <1412957023-11105-28-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412957023-11105-1-git-send-email-greg.bellows@linaro.org> References: <1412957023-11105-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.218.51 Subject: [Qemu-devel] [PATCH v6 27/32] 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.54 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 adb51d3..66206f9 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -260,7 +260,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 af6b371..9fdbbbf 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, @@ -4366,11 +4367,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;