From patchwork Wed Nov 5 23:22:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 40237 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5C66240A6 for ; Wed, 5 Nov 2014 23:32:18 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf1085470lam.0 for ; Wed, 05 Nov 2014 15:32:17 -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=1S5NEb6gnONUZC/7xQH1s50XIo7uQARNWOsUK/hgkGo=; b=dBd1cVisWp5jRF1CBiIfdKjfSVhp2ejdLuGXbLJVnSV9z/BX3XbpTPymv/2QREKH4l Xz3W4+wkm+xZkbzf1qppSqp3a6oSufkd774YUmRAg8062/+pj54lyY2CyFFtREBmU6KU 3zjtirVZQ0LvJGjm8UQxSyGPmcUqUfJ2eaoTk0XYUasY6EMG8HmH0ao4/evw8r1AlQg4 s5O1K1Fc7UF47vuo6oDuA/YxwFSdyDgmOXwQ0vYiNOttkpVg+DuwuP6ROFnKqfMFLFm3 hRnpmZeFqMsvxT1HSaFg62WGmr2u4zs9cMdPUj6v5ECj+sAq948NGCTeutFzkgz5SAtY xBjw== X-Gm-Message-State: ALoCoQlA2xhQAA/H86GF+r7jahGuJCnzmovy4n6k34xbnmLIzTBXQvk6+DHTCND8bXnZtS+hjNmZ X-Received: by 10.194.191.137 with SMTP id gy9mr92883wjc.0.1415230337790; Wed, 05 Nov 2014 15:32:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.99 with SMTP id bf3ls12772lab.24.gmail; Wed, 05 Nov 2014 15:32:17 -0800 (PST) X-Received: by 10.112.180.198 with SMTP id dq6mr647883lbc.56.1415230337399; Wed, 05 Nov 2014 15:32:17 -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 yf1si8740766lab.63.2014.11.05.15.32.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Nov 2014 15:32:17 -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 gf13so1667020lab.17 for ; Wed, 05 Nov 2014 15:32:17 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr563547lbc.23.1415230337317; Wed, 05 Nov 2014 15:32:17 -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 ew9csp372061lbc; Wed, 5 Nov 2014 15:32:16 -0800 (PST) X-Received: by 10.140.90.111 with SMTP id w102mr939141qgd.88.1415230335900; Wed, 05 Nov 2014 15:32:15 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d9si9135606qaa.7.2014.11.05.15.32.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Nov 2014 15:32:15 -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]:49027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmA3i-0001x8-Vk for patch@linaro.org; Wed, 05 Nov 2014 18:32:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm9vU-0004F5-17 for qemu-devel@nongnu.org; Wed, 05 Nov 2014 18:23:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xm9vO-0004dn-SQ for qemu-devel@nongnu.org; Wed, 05 Nov 2014 18:23:43 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:60900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm9vO-0004dT-LG for qemu-devel@nongnu.org; Wed, 05 Nov 2014 18:23:38 -0500 Received: by mail-pd0-f177.google.com with SMTP id v10so1668145pde.22 for ; Wed, 05 Nov 2014 15:23:38 -0800 (PST) X-Received: by 10.66.158.103 with SMTP id wt7mr426962pab.39.1415229818056; Wed, 05 Nov 2014 15:23:38 -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 r4sm4086349pdm.93.2014.11.05.15.23.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Nov 2014 15:23:37 -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: Wed, 5 Nov 2014 17:22:58 -0600 Message-Id: <1415229793-3278-12-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415229793-3278-1-git-send-email-greg.bellows@linaro.org> References: <1415229793-3278-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 v9 11/26] target-arm: add SDER definition 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 Added CP register defintions for SDER and SDER32_EL3 as well as cp15.sder for register storage. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell --- v8 -> v9 - Fixed declaration order of the SDER register components v7 -> v8 - Added SDER32_EL3 register definition - Changed sder name from c1_sder to sder - Changed sder from uint32_t to uint64_t. --- target-arm/cpu.h | 1 + target-arm/helper.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index d2db3aa..e5c773d 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. */ + uint64_t sder; /* Secure debug enable 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. */ diff --git a/target-arm/helper.c b/target-arm/helper.c index 016cf39..cb15ad4 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2344,6 +2344,14 @@ 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 }, + { .name = "SDER32_EL3", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 1, .opc2 = 1, + .access = PL3_RW, .resetvalue = 0, + .fieldoffset = offsetof(CPUARMState, cp15.sder) }, + { .name = "SDER", + .cp = 15, .opc1 = 0, .crn = 1, .crm = 1, .opc2 = 1, + .access = PL3_RW, .resetvalue = 0, + .fieldoffset = offsetoflow32(CPUARMState, cp15.sder) }, /* 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,