From patchwork Fri Oct 10 16:03:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 38623 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 54439202DB for ; Fri, 10 Oct 2014 16:26:52 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id w7sf2267383lbi.10 for ; Fri, 10 Oct 2014 09:26:51 -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=mcPjQGm7v0v2qhKtikjyiQ+lbwy6B2KmLobOpFnMqFg=; b=LQMTfV55gsY0VmThbN6YbzTdbV7Bg3dcCAMGlWycot7c5OarnUQ54WlhV46lkQ7Dvg ZF4fO4NeuoJ2YDGkNgccHAKVhT0dDSuI8TVT38d07JvMJLpH0WA4KJdbWdVtlmalUCPw JCIlgua5mLWT9O2PFtBArV566RJBGy/AtJRRiDB+Wpk3CfZT5GWAT56Ncjz5bMCFLcur poizy2fWBJ7QkfZtx1j9O2ZvTwnC4Vq1jTfvGIFKDrEm1tFxHpeA3x3iX0uT6b5jKiqH MkB0BFuOwLZSe23jG/9E6/oZTvraKmidErrHjzTF6oVQKbk+GBYFk4DqixUkhlaqrcZ5 /PZA== X-Gm-Message-State: ALoCoQmA0bLHPiMaTsDfigEje2AlbiLZNXBrjdFQocH1vzWBFGDloKmHZHAK+nqcIiXWkAlhWReN X-Received: by 10.194.100.3 with SMTP id eu3mr366224wjb.6.1412958411054; Fri, 10 Oct 2014 09:26:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.40 with SMTP id p8ls262852lah.106.gmail; Fri, 10 Oct 2014 09:26:50 -0700 (PDT) X-Received: by 10.152.22.7 with SMTP id z7mr6185455lae.6.1412958410806; Fri, 10 Oct 2014 09:26:50 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id 1si10015205lal.89.2014.10.10.09.26.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so3457623lbv.33 for ; Fri, 10 Oct 2014 09:26:50 -0700 (PDT) X-Received: by 10.112.52.165 with SMTP id u5mr5896940lbo.80.1412958408366; Fri, 10 Oct 2014 09:26:48 -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 c5csp459941lbz; Fri, 10 Oct 2014 09:26:47 -0700 (PDT) X-Received: by 10.224.20.9 with SMTP id d9mr10360845qab.7.1412958407052; Fri, 10 Oct 2014 09:26:47 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l8si11638316qao.129.2014.10.10.09.26.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:26:47 -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]:49648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xcd1i-0002HY-0k for patch@linaro.org; Fri, 10 Oct 2014 12:26:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XccgC-0007Xt-Bi for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xccg5-0008B9-OT for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:32 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:57045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccg5-0008Ac-Kf for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:25 -0400 Received: by mail-oi0-f42.google.com with SMTP id a141so7144675oig.29 for ; Fri, 10 Oct 2014 09:04:25 -0700 (PDT) X-Received: by 10.202.76.213 with SMTP id z204mr2787356oia.76.1412957065321; Fri, 10 Oct 2014 09:04:25 -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.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:04:24 -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:42 -0500 Message-Id: <1412957023-11105-32-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.42 Subject: [Qemu-devel] [PATCH v6 31/32] target-arm: make MAIR0/1 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.217.174 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 Added CP register info entries for the ARMv7 MAIR0/1 secure banks. Signed-off-by: Greg Bellows ========== v5 -> v6 - Changed _el field variants to be array based --- target-arm/cpu.h | 12 +++++++++++- target-arm/helper.c | 8 +++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index e8ede63..73b445a 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -305,7 +305,17 @@ typedef struct CPUARMState { uint32_t c9_pmxevtyper; /* perf monitor event type */ uint32_t c9_pmuserenr; /* perf monitor user enable */ uint32_t c9_pminten; /* perf monitor interrupt enables */ - uint64_t mair_el1; + union { /* Memory attribute redirection */ + struct { + uint64_t _unused_mair_0; + uint32_t mair0_ns; + uint32_t mair1_ns; + uint64_t _unused_mair_1; + uint32_t mair0_s; + uint32_t mair1_s; + }; + uint64_t mair_el[4]; + }; union { /* vector base address register */ struct { uint64_t _unused_vbar; diff --git a/target-arm/helper.c b/target-arm/helper.c index d05eb4d..136a232 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -952,7 +952,7 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { */ { .name = "MAIR_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 0, - .access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.mair_el1), + .access = PL1_RW, .fieldoffset = offsetof(CPUARMState, cp15.mair_el[1]), .resetvalue = 0 }, /* For non-long-descriptor page tables these are PRRR and NMRR; * regardless they still act as reads-as-written for QEMU. @@ -961,11 +961,13 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { */ { .name = "MAIR0", .state = ARM_CP_STATE_AA32, .type = ARM_CP_OVERRIDE, .cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 0, .access = PL1_RW, - .fieldoffset = offsetoflow32(CPUARMState, cp15.mair_el1), + .bank_fieldoffsets = { offsetof(CPUARMState, cp15.mair0_s), + offsetof(CPUARMState, cp15.mair0_ns) }, .resetfn = arm_cp_reset_ignore }, { .name = "MAIR1", .state = ARM_CP_STATE_AA32, .type = ARM_CP_OVERRIDE, .cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 1, .access = PL1_RW, - .fieldoffset = offsetofhigh32(CPUARMState, cp15.mair_el1), + .bank_fieldoffsets = { offsetof(CPUARMState, cp15.mair1_s), + offsetof(CPUARMState, cp15.mair1_ns) }, .resetfn = arm_cp_reset_ignore }, { .name = "ISR_EL1", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 1, .opc2 = 0,