From patchwork Mon Nov 17 16:47: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: 40953 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA6BB24035 for ; Mon, 17 Nov 2014 16:54:07 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id y19sf1377904wgg.3 for ; Mon, 17 Nov 2014 08:54:07 -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=SPAC4IqBcKhNt6PVnBClGFSDuHlIBSJEXBHF1XhXoiY=; b=HJOziqBc2cOse5cYPOjuMaCLnJDB7EtQEovIidGu3mZ/VjHP29SKNRq/e8Xi0aoInw JDsfZCT+hE0z3TYcF1RTykJZVhP9jdGlGZ1821p0J5vKvomM8VuPBROwpp/sTQNGjnlX FCJVgSZLr9hmFZnU0s0XQsz8KuiftUtnc26wfiqgXAszr/SqgCHB6/5KWoLU7YWzsK1K ewe6VnmlqkYUn8eRMQBvz3OIbN2YeEvLi2cuE0t+Eok/WsPQ8jZPeB7TY6EYkwP7rqLV Sidkhvrt5VqPEPnI7v/bbQmCmn8a7WO43qN+ROMgPIGn5Rfu7gbDgPA4Y8d8rZwEPk8P 6Uvg== X-Gm-Message-State: ALoCoQlXKsLPJkTgb7cNAAtTn0PExAo2DcCZWoAMpUo79l7dKaeeku7tdHfIWV0/IkLSKvY5i0E9 X-Received: by 10.180.37.105 with SMTP id x9mr2253260wij.7.1416243247263; Mon, 17 Nov 2014 08:54:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.9 with SMTP id p9ls1234431lag.80.gmail; Mon, 17 Nov 2014 08:54:06 -0800 (PST) X-Received: by 10.153.11.133 with SMTP id ei5mr11800598lad.75.1416243246703; Mon, 17 Nov 2014 08:54:06 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id uf7si37247923lac.99.2014.11.17.08.54.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 08:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id hz20so8571432lab.3 for ; Mon, 17 Nov 2014 08:54:06 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr28588301laz.27.1416243246617; Mon, 17 Nov 2014 08:54:06 -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 ew9csp1187783lbc; Mon, 17 Nov 2014 08:54:05 -0800 (PST) X-Received: by 10.140.102.169 with SMTP id w38mr35661307qge.95.1416243244892; Mon, 17 Nov 2014 08:54:04 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c1si64486218qcq.32.2014.11.17.08.54.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Nov 2014 08:54:04 -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]:48876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqPYy-0002AQ-6H for patch@linaro.org; Mon, 17 Nov 2014 11:54:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqPTZ-0001ZK-LO for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:48:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqPTU-0007BY-Rz for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:48:29 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:46074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqPTU-0007BU-NI for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:48:24 -0500 Received: by mail-pd0-f172.google.com with SMTP id r10so21538110pdi.31 for ; Mon, 17 Nov 2014 08:48:24 -0800 (PST) X-Received: by 10.68.221.162 with SMTP id qf2mr4768215pbc.148.1416242904254; Mon, 17 Nov 2014 08:48:24 -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 r2sm18499056pdi.60.2014.11.17.08.48.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 08:48:23 -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: Mon, 17 Nov 2014 10:47:42 -0600 Message-Id: <1416242878-876-11-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1416242878-876-1-git-send-email-greg.bellows@linaro.org> References: <1416242878-876-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.172 Cc: greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v11 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.44 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 532f698..2afe93a 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 8651bbc..691bb8e 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 };