From patchwork Thu Oct 30 21:28:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 39936 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A13FF2405B for ; Fri, 31 Oct 2014 16:14:35 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf801989wiv.6 for ; Fri, 31 Oct 2014 09:14:34 -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=CpgsdzhN9mxwkVrtgNiwSiARIl7IdHOzyKyLyyrGS6w=; b=TArKErdQgijqEhqCZcf1UPINs4BKQCY1PMsI4lwnsclD7ToiDq6rMruGaBZ6njq8H0 qhabV0b4LDiX9qS9hwpNVjfiq6tnJLCljC3x6oMueCL5IXZwV5R+7i3c1qvaGxBMXa25 7VN6ZnTFF7MfZ7oEFmQGnm2MIh9aW2nprYIkMYsfAYTO+T8xO+E1oz6GeIAXis/oFrDX t8XhgYZ2trzAXClm14WNarEyop5CDm8m0L04+hT6zhnkUiXdvrFlEdxMvs/rFyOlOqcG ypdOHio9FJHai35OXExAlIjEnfcSkB6BaxWcTP+sXA0Fs/Z5xt/v9S8oRHAnUK3m6IGB FLkw== X-Gm-Message-State: ALoCoQkW9iUk8XLAZV2CrcBCWv6KMG926kO7pJ+tGhwwbyuPVcRYF4ZAB2HCiKEfboGMucGF3kmq X-Received: by 10.194.91.208 with SMTP id cg16mr510622wjb.5.1414772074649; Fri, 31 Oct 2014 09:14:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.4 with SMTP id ky4ls511867lab.23.gmail; Fri, 31 Oct 2014 09:14:34 -0700 (PDT) X-Received: by 10.153.7.170 with SMTP id dd10mr27577354lad.45.1414772074301; Fri, 31 Oct 2014 09:14:34 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id f1si17511236lam.8.2014.10.31.09.14.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:14:34 -0700 (PDT) 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 pn19so1132222lab.18 for ; Fri, 31 Oct 2014 09:14:34 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr27159320lap.44.1414772074009; Fri, 31 Oct 2014 09:14:34 -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 c5csp226465lbz; Fri, 31 Oct 2014 09:14:33 -0700 (PDT) X-Received: by 10.224.23.67 with SMTP id q3mr37666314qab.92.1414772072249; Fri, 31 Oct 2014 09:14:32 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 21si17744942qga.74.2014.10.31.09.14.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:14:32 -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]:38779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEqN-0007yt-CF for patch@linaro.org; Fri, 31 Oct 2014 12:14:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkE66-000672-LP for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:27:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjxHY-0004qe-44 for qemu-devel@nongnu.org; Thu, 30 Oct 2014 17:29:28 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:39348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjxHX-0004py-UJ for qemu-devel@nongnu.org; Thu, 30 Oct 2014 17:29:24 -0400 Received: by mail-pa0-f41.google.com with SMTP id rd3so6288300pab.28 for ; Thu, 30 Oct 2014 14:29:23 -0700 (PDT) X-Received: by 10.68.168.100 with SMTP id zv4mr20317345pbb.132.1414704563262; Thu, 30 Oct 2014 14:29:23 -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 o5sm8017713pdr.50.2014.10.30.14.29.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 14:29:22 -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: Thu, 30 Oct 2014 16:28:41 -0500 Message-Id: <1414704538-17103-11-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1414704538-17103-1-git-send-email-greg.bellows@linaro.org> References: <1414704538-17103-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.41 Cc: greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v8 10/27] 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 --- 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 | 6 ++++++ target-arm/helper.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 6bb7d39..88e22fb 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. */ @@ -634,6 +635,11 @@ static inline void xpsr_write(CPUARMState *env, uint32_t val, uint32_t mask) #define SCR_AARCH32_MASK (0x3fff & ~(SCR_RW | SCR_ST)) #define SCR_AARCH64_MASK (0x3fff & ~SCR_NET) +#define NSACR_NSTRCDIS (1U << 20) +#define NSACR_RFR (1U << 19) +#define NSACR_NSASEDIS (1U << 15) +#define NSACR_NSD32DIS (1U << 14) + /* Return the current FPSCR value. */ uint32_t vfp_get_fpscr(CPUARMState *env); void vfp_set_fpscr(CPUARMState *env, uint32_t val); diff --git a/target-arm/helper.c b/target-arm/helper.c index e73756d..3c12eb3 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2344,6 +2344,9 @@ static const ARMCPRegInfo el3_cp_reginfo[] = { .cp = 15, .crn = 1, .crm = 1, .opc1 = 0, .opc2 = 0, .access = PL3_RW, .resetvalue = 0, .writefn = scr_write, .fieldoffset = offsetoflow32(CPUARMState, cp15.scr_el3) }, + { .name = "NSACR", .cp = 15, .crn = 1, .crm = 1, .opc1 = 0, .opc2 = 2, + .access = PL3_RW | PL1_R, .resetvalue = 0, + .fieldoffset = offsetof(CPUARMState, cp15.nsacr) }, REGINFO_SENTINEL };