From patchwork Fri Jan 31 15:45:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23975 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B0AD4202B2 for ; Fri, 31 Jan 2014 15:58:18 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g12sf17949651oah.6 for ; Fri, 31 Jan 2014 07:58:16 -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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=d8T4xYkIGRaCanzYKjwqDZSNYtfm4GvYKLT0CqeDMog=; b=h2PfYhcsk5s7VdKimBpgbrpECz9BgWZIAOsMh026QIgaKvq78Z126moalkRVLIBz6S rssDBoMKqeNAluxfGarjshiZMsE1+NPyeLMya4xCjm0zT1AZq4azGO20lpKqaL7ETmld U1PfINQHzgYbOjhvkhh5sMut3s9JqETNYdRdWf277FBgI8eLm8j3BsJh9cVMj5nzYcSB G6pavJSWpShRrbyUQPD1+G56o/j22mSsWnzSjaLugLc2izObtBLRvnLeIQnVs2k0IsmY UjzaacfWpT+11Jp956RLY4N3uC5RhBmCWFzdmQGgO0vlT9ULG/M3eIVEfdpGIT/sL6gr Xzvg== X-Gm-Message-State: ALoCoQmra09YooYEAiPlA7D48azYKYO9TJ7e1iB7hW7ak1jz+7TvIs7TWH98HEe+j7bIQKcMky97 X-Received: by 10.182.81.7 with SMTP id v7mr8118581obx.28.1391183896659; Fri, 31 Jan 2014 07:58:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.44.102 with SMTP id f93ls1010343qga.75.gmail; Fri, 31 Jan 2014 07:58:16 -0800 (PST) X-Received: by 10.52.171.68 with SMTP id as4mr14279800vdc.0.1391183896544; Fri, 31 Jan 2014 07:58:16 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id n8si3651341vdv.42.2014.01.31.07.58.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 07:58:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id cz12so3284337veb.12 for ; Fri, 31 Jan 2014 07:58:16 -0800 (PST) X-Received: by 10.58.90.202 with SMTP id by10mr16413437veb.6.1391183896474; Fri, 31 Jan 2014 07:58:16 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp106470vcz; Fri, 31 Jan 2014 07:58:15 -0800 (PST) X-Received: by 10.195.13.164 with SMTP id ez4mr14102596wjd.11.1391183895497; Fri, 31 Jan 2014 07:58:15 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id z14si5394341wjr.144.2014.01.31.07.58.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 31 Jan 2014 07:58:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W9GHp-00082D-8T; Fri, 31 Jan 2014 15:45:45 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite , Rob Herring Subject: [PATCH v2 34/35] target-arm: Implement AArch64 dummy breakpoint and watchpoint registers Date: Fri, 31 Jan 2014 15:45:42 +0000 Message-Id: <1391183143-30724-35-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391183143-30724-1-git-send-email-peter.maydell@linaro.org> References: <1391183143-30724-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In AArch64 the breakpoint and watchpoint registers are mandatory, so the kernel always accesses them on bootup. Implement dummy versions, which read as written but have no actual effect. Signed-off-by: Peter Maydell --- target-arm/cpu.h | 4 ++++ target-arm/helper.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 24a8e93..267d5ae 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -216,6 +216,10 @@ typedef struct CPUARMState { uint32_t c15_diagnostic; /* diagnostic register */ uint32_t c15_power_diagnostic; uint32_t c15_power_control; /* power control */ + uint64_t dbgbvr[16]; /* breakpoint value registers */ + uint64_t dbgbcr[16]; /* breakpoint control registers */ + uint64_t dbgwvr[16]; /* watchpoint value registers */ + uint64_t dbgwcr[16]; /* watchpoint control registers */ } cp15; struct { diff --git a/target-arm/helper.c b/target-arm/helper.c index eb37e7e..1621030 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1787,6 +1787,37 @@ static CPAccessResult ctr_el0_access(CPUARMState *env, const ARMCPRegInfo *ri) return CP_ACCESS_OK; } +static void define_aarch64_debug_regs(ARMCPU *cpu) +{ + /* Define breakpoint and watchpoint registers. These do nothing + * but read as written, for now. + */ + int i; + + for (i = 0; i < 16; i++) { + ARMCPRegInfo dbgregs[] = { + { .name = "DBGBVR", .state = ARM_CP_STATE_AA64, + .opc0 = 2, .opc1 = 0, .crn = 0, .crm = i, .opc2 = 4, + .access = PL1_RW, + .fieldoffset = offsetof(CPUARMState, cp15.dbgbvr[i]) }, + { .name = "DBGBCR", .state = ARM_CP_STATE_AA64, + .opc0 = 2, .opc1 = 0, .crn = 0, .crm = i, .opc2 = 5, + .access = PL1_RW, + .fieldoffset = offsetof(CPUARMState, cp15.dbgbcr[i]) }, + { .name = "DBGWVR", .state = ARM_CP_STATE_AA64, + .opc0 = 2, .opc1 = 0, .crn = 0, .crm = i, .opc2 = 6, + .access = PL1_RW, + .fieldoffset = offsetof(CPUARMState, cp15.dbgwvr[i]) }, + { .name = "DBGWCR", .state = ARM_CP_STATE_AA64, + .opc0 = 2, .opc1 = 0, .crn = 0, .crm = i, .opc2 = 7, + .access = PL1_RW, + .fieldoffset = offsetof(CPUARMState, cp15.dbgwcr[i]) }, + REGINFO_SENTINEL + }; + define_arm_cp_regs(cpu, dbgregs); + } +} + void register_cp_regs_for_features(ARMCPU *cpu) { /* Register all the coprocessor registers based on feature bits */ @@ -1928,6 +1959,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) }; define_arm_cp_regs(cpu, v8_idregs); define_arm_cp_regs(cpu, v8_cp_reginfo); + define_aarch64_debug_regs(cpu); } if (arm_feature(env, ARM_FEATURE_MPU)) { /* These are the MPU registers prior to PMSAv6. Any new