From patchwork Thu Nov 6 15:50:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 40339 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0B1A420C4E for ; Thu, 6 Nov 2014 15:59:37 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id d17sf2322877eek.11 for ; Thu, 06 Nov 2014 07:59:36 -0800 (PST) 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=JZeqd+ixeRR4ZRTUKcnVKG+NQ+N86ClIsmvTI+4lpIk=; b=nB3BpPyEXCELPScwfteaAG7qXH56FTS2sG94SNieMYQSH57zn1XMYpmlE/CVXaR/3Y FBF8TYeWXwaG0vm0fBPe2zicFm1/R3o69XzEhHlAczhsf2y1/6uMRxvqV/YTe4MW7FoC Y7Ci7xk8BYhxUlqvwUSXju5KlcH/KlVwz3spDFK1PiFD578W0wHEz2GBf0CpREX4Elhd h0RA6Uoo4kdfJptIIDuUo/r4fh/hYJUdX71rzMI2Ud5B+jAx9X6fSlexszhj+vssaMip ihwyixgLYDPDHzGSfSDNqkdw3NRAA1ot75pr8i3kdXVWvA0X/R55g5CCzGir9+97B4PQ Awsg== X-Gm-Message-State: ALoCoQkT4LfUyyWMggnr/1VkWYGf7fcUoZv3GjFv1YEF9RTea7DtNJQJklLVd0oWbcZEp+/NvIIo X-Received: by 10.112.162.6 with SMTP id xw6mr600861lbb.4.1415289576003; Thu, 06 Nov 2014 07:59:36 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.108 with SMTP id lf12ls85880lac.48.gmail; Thu, 06 Nov 2014 07:59:35 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr5783892lal.29.1415289575461; Thu, 06 Nov 2014 07:59:35 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id jd2si11838961lbc.91.2014.11.06.07.59.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 07:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id pn19so2863509lab.32 for ; Thu, 06 Nov 2014 07:59:35 -0800 (PST) X-Received: by 10.112.130.41 with SMTP id ob9mr5740570lbb.74.1415289575322; Thu, 06 Nov 2014 07:59:35 -0800 (PST) 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.184.201 with SMTP id ew9csp66285lbc; Thu, 6 Nov 2014 07:59:34 -0800 (PST) X-Received: by 10.140.48.41 with SMTP id n38mr7705726qga.1.1415289573469; Thu, 06 Nov 2014 07:59:33 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m7si12334869qay.104.2014.11.06.07.59.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Nov 2014 07:59:33 -0800 (PST) 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]:54621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmPTA-0005mi-OG for patch@linaro.org; Thu, 06 Nov 2014 10:59:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmPLj-0001pP-Nb for qemu-devel@nongnu.org; Thu, 06 Nov 2014 10:51:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmPLd-0004IB-HM for qemu-devel@nongnu.org; Thu, 06 Nov 2014 10:51:51 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:60442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmPLd-0004I3-Bd for qemu-devel@nongnu.org; Thu, 06 Nov 2014 10:51:45 -0500 Received: by mail-pd0-f177.google.com with SMTP id v10so1350321pde.8 for ; Thu, 06 Nov 2014 07:51:44 -0800 (PST) X-Received: by 10.68.179.129 with SMTP id dg1mr5047200pbc.113.1415289104825; Thu, 06 Nov 2014 07:51:44 -0800 (PST) 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 z9sm6245585pdp.73.2014.11.06.07.51.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 07:51:43 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch, peter.maydell@linaro.org Date: Thu, 6 Nov 2014 09:50:57 -0600 Message-Id: <1415289073-14681-11-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415289073-14681-1-git-send-email-greg.bellows@linaro.org> References: <1415289073-14681-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.192.177 Cc: greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v10 10/26] target-arm: add NSACR register 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.45 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 Implements NSACR register with corresponding read/write functions for ARMv7 and ARMv8. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell --- v8 -> v9 - Removed unused NSACR constants - Added TODO for trapping secure EL1 accesses to NSACR - Change NSACR access from PL3_RW to PL3_W - Fixed declaration order of the NSACR register components v7 -> v8 - Update naming from c1_nsacr to nsacr to match other registers being changed. - Remove NSACR read/write functions v4 -> v5 - Changed to use renamed arm_current_el() --- target-arm/cpu.h | 1 + target-arm/helper.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index baa709b..97f952c 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -181,6 +181,7 @@ typedef struct CPUARMState { uint64_t c1_sys; /* System control register. */ uint64_t c1_coproc; /* Coprocessor access register. */ uint32_t c1_xscaleauxcr; /* XScale auxiliary control register. */ + uint32_t nsacr; /* Non-secure access control register. */ uint64_t ttbr0_el1; /* MMU translation table base 0. */ uint64_t ttbr1_el1; /* MMU translation table base 1. */ uint64_t c2_control; /* MMU translation table base control. */ diff --git a/target-arm/helper.c b/target-arm/helper.c index 3086c2c..016cf39 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2344,6 +2344,10 @@ static const ARMCPRegInfo el3_cp_reginfo[] = { .cp = 15, .opc1 = 0, .crn = 1, .crm = 1, .opc2 = 0, .access = PL3_RW, .fieldoffset = offsetoflow32(CPUARMState, cp15.scr_el3), .resetfn = arm_cp_reset_ignore, .writefn = scr_write }, + /* TODO: Implement NSACR trapping of secure EL1 accesses to EL3 */ + { .name = "NSACR", .cp = 15, .opc1 = 0, .crn = 1, .crm = 1, .opc2 = 2, + .access = PL3_W | PL1_R, .resetvalue = 0, + .fieldoffset = offsetof(CPUARMState, cp15.nsacr) }, REGINFO_SENTINEL };