From patchwork Thu Apr 10 16:15:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 28197 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1263B20671 for ; Thu, 10 Apr 2014 16:15:49 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id a108sf7794998qge.0 for ; Thu, 10 Apr 2014 09:15:48 -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: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=uCxyb3fg5JS573U2qlGt4d2UprFs2lX1AYgNzWR3sig=; b=Se4BgF6Hgw2wowrJvkAJLcLMPSZkCW+YCkfOh4eBJvTcLpCiCa2zwnl3S2uQAwYXfn Q87UeZ0prSLBLkZEWWcgyAxf3kFwGcJjplNXloyI5PTQ9LnZAWnSek/EwSXRbXiyD6Bj ogwkmPUI3cYBn2RJUdl0cqYakuzMj+FCEszAliboBrB+CIKxIRsilIzZL6KGK0FNDme7 GgjeGv0cvHdwWb6RYOKxibKmS1XVtMjnMmpb9WtrIuTnTFEFWvV5e4R2YdrULQUpPxn2 /VC1E1dQ8Xuf7AIXP4fIjvJdlchMfr2wc58lkLGX7tzdQMIAPQkxJYUinLC3fdkeUQKJ sScA== X-Gm-Message-State: ALoCoQmB1TP/fOkOLwCfpGiZWdcWX9FKWDhI26z5zJ6i6EUUQQM9M0yhwtPF4QXBKON19rgYB7t0 X-Received: by 10.236.142.212 with SMTP id i60mr6759141yhj.39.1397146548866; Thu, 10 Apr 2014 09:15:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.68 with SMTP id n62ls1242873qge.28.gmail; Thu, 10 Apr 2014 09:15:48 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr12662018vdb.3.1397146548764; Thu, 10 Apr 2014 09:15:48 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id kp12si773093veb.174.2014.04.10.09.15.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 09:15:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hu19so3754734vcb.1 for ; Thu, 10 Apr 2014 09:15:48 -0700 (PDT) X-Received: by 10.52.119.197 with SMTP id kw5mr12479409vdb.5.1397146548677; Thu, 10 Apr 2014 09:15:48 -0700 (PDT) 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.221.72 with SMTP id ib8csp72242vcb; Thu, 10 Apr 2014 09:15:48 -0700 (PDT) X-Received: by 10.112.89.10 with SMTP id bk10mr744009lbb.64.1397146545164; Thu, 10 Apr 2014 09:15:45 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id o7si3628278lbp.226.2014.04.10.09.15.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 10 Apr 2014 09:15:45 -0700 (PDT) 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 1WYHda-0007sH-5B; Thu, 10 Apr 2014 17:15:38 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Peter Crosthwaite , Greg Bellows Subject: [PATCH v6 32/37] target-arm: Implement RVBAR register Date: Thu, 10 Apr 2014 17:15:31 +0100 Message-Id: <1397146536-30116-33-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397146536-30116-1-git-send-email-peter.maydell@linaro.org> References: <1397146536-30116-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.220.170 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: , Implement the AArch64 RVBAR register, which indicates the reset address. Since the reset address is implementation defined and usually configurable by setting config signals in hardware, we also provide a QOM property so it can be set at board level if necessary. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- target-arm/cpu-qom.h | 1 + target-arm/cpu.c | 9 +++++++++ target-arm/helper.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h index 2b6b370..743985e 100644 --- a/target-arm/cpu-qom.h +++ b/target-arm/cpu-qom.h @@ -153,6 +153,7 @@ typedef struct ARMCPU { bool reset_hivecs; /* DCZ blocksize, in log_2(words), ie low 4 bits of DCZID_EL0 */ uint32_t dcz_blocksize; + uint64_t rvbar; } ARMCPU; #define TYPE_AARCH64_CPU "aarch64-cpu" diff --git a/target-arm/cpu.c b/target-arm/cpu.c index a78a36b..783fc73 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -105,6 +105,7 @@ static void arm_cpu_reset(CPUState *s) env->cp15.c1_coproc = deposit64(env->cp15.c1_coproc, 20, 2, 3); #else env->pstate = PSTATE_MODE_EL1h; + env->pc = cpu->rvbar; #endif } else { #if defined(CONFIG_USER_ONLY) @@ -266,6 +267,9 @@ static Property arm_cpu_reset_cbar_property = static Property arm_cpu_reset_hivecs_property = DEFINE_PROP_BOOL("reset-hivecs", ARMCPU, reset_hivecs, false); +static Property arm_cpu_rvbar_property = + DEFINE_PROP_UINT64("rvbar", ARMCPU, rvbar, 0); + static void arm_cpu_post_init(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); @@ -279,6 +283,11 @@ static void arm_cpu_post_init(Object *obj) qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_hivecs_property, &error_abort); } + + if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { + qdev_property_add_static(DEVICE(obj), &arm_cpu_rvbar_property, + &error_abort); + } } static void arm_cpu_finalizefn(Object *obj) diff --git a/target-arm/helper.c b/target-arm/helper.c index 34b0277..4a74249 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2295,6 +2295,12 @@ void register_cp_regs_for_features(ARMCPU *cpu) .resetvalue = cpu->mvfr2 }, REGINFO_SENTINEL }; + ARMCPRegInfo rvbar = { + .name = "RVBAR_EL1", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 0, .opc2 = 2, + .type = ARM_CP_CONST, .access = PL1_R, .resetvalue = cpu->rvbar + }; + define_one_arm_cp_reg(cpu, &rvbar); define_arm_cp_regs(cpu, v8_idregs); define_arm_cp_regs(cpu, v8_cp_reginfo); define_aarch64_debug_regs(cpu);