From patchwork Fri Jan 23 14:49:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 43647 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4BACF218DB for ; Fri, 23 Jan 2015 14:50:41 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id l4sf4500098lbv.1 for ; Fri, 23 Jan 2015 06:50:40 -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=A8FSkrtj2Ph3iZVn3xAj6nnionHWPBPdrLkFT/bAiQE=; b=k9lSeeL+a3ABIl/KnWMOcTkliw8uiHTnhI27FJxhbHOCmo2caHora2e+0ZeVtscdzR IpPUJAOic65Io86dLhsXpGA0FEbBGWtXlVfPibuaVx09OeT67C5L2pEEAiV8p3PQnbaA 8CcrvF/Hlj8XqFgClLlTD6Eo4/Hk+9L97TAc3duYrEMdDtosQyQZzTwXVgqBxH7kJKCm OKWRiU5nl8qyooRt+MJvUX0dDMV+qUvs80xfNBJYiK+Mp/4ncuq3XZSSzm8KKVigbW53 UZeUnwL+tChS2CFKtincobdL3xSmrXcI5POSJw0F514w/CZTnFleMhkt5LaVMu/UEid1 YxQQ== X-Gm-Message-State: ALoCoQmQgxtTtEI2qzvgrM17c6dCaDNFzvEMzQcrQSoOcLF6NIAla/c9HQeY83ekJLQh0UvV25O+ X-Received: by 10.180.82.34 with SMTP id f2mr347064wiy.1.1422024640150; Fri, 23 Jan 2015 06:50:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.38 with SMTP id ld6ls297932lac.50.gmail; Fri, 23 Jan 2015 06:50:40 -0800 (PST) X-Received: by 10.112.158.200 with SMTP id ww8mr6650331lbb.89.1422024640018; Fri, 23 Jan 2015 06:50:40 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id js7si1558238lbc.58.2015.01.23.06.50.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 06:50:40 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so7424433lbi.1 for ; Fri, 23 Jan 2015 06:50:39 -0800 (PST) X-Received: by 10.152.6.132 with SMTP id b4mr7817054laa.59.1422024639925; Fri, 23 Jan 2015 06:50:39 -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.9.200 with SMTP id c8csp278886lbb; Fri, 23 Jan 2015 06:50:39 -0800 (PST) X-Received: by 10.224.156.145 with SMTP id x17mr14688630qaw.84.1422024638656; Fri, 23 Jan 2015 06:50:38 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id y7si2251114qai.22.2015.01.23.06.50.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 06:50:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:59527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEfZF-0001Nf-Ty for patch@linaro.org; Fri, 23 Jan 2015 09:50:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEfYM-0000HN-Ka for qemu-devel@nongnu.org; Fri, 23 Jan 2015 09:49:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEfYI-0005H0-28 for qemu-devel@nongnu.org; Fri, 23 Jan 2015 09:49:42 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:62731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEfYH-0005Gs-TV for qemu-devel@nongnu.org; Fri, 23 Jan 2015 09:49:38 -0500 Received: by mail-pd0-f182.google.com with SMTP id z10so6545129pdj.13 for ; Fri, 23 Jan 2015 06:49:37 -0800 (PST) X-Received: by 10.68.227.201 with SMTP id sc9mr11860528pbc.19.1422024577130; Fri, 23 Jan 2015 06:49:37 -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 oc7sm2146455pdb.68.2015.01.23.06.49.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 06:49:36 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 23 Jan 2015 08:49:21 -0600 Message-Id: <1422024563-27096-3-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1422024563-27096-1-git-send-email-greg.bellows@linaro.org> References: <1422024563-27096-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.182 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH 2/4] target-arm: Add extended RVBAR support 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.217.170 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 RVBAR_EL2 and RVBAR_EL3 CP register support. All RVBAR_EL# registers point to the same location and only the highest EL version exists at any one time. Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell --- target-arm/helper.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index c9b1c08..d5f0997 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -3053,17 +3053,30 @@ 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 = 1, - .type = ARM_CP_CONST, .access = PL1_R, .resetvalue = cpu->rvbar - }; - define_one_arm_cp_reg(cpu, &rvbar); + /* RVBAR_EL1 is only implemented if EL1 is the highest EL */ + if (!arm_feature(env, ARM_FEATURE_EL3) && + !arm_feature(env, ARM_FEATURE_EL2)) { + ARMCPRegInfo rvbar = { + .name = "RVBAR_EL1", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 0, .opc2 = 1, + .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); } if (arm_feature(env, ARM_FEATURE_EL2)) { define_arm_cp_regs(cpu, v8_el2_cp_reginfo); + /* RVBAR_EL2 is only implemented if EL2 is the highest EL */ + if (!arm_feature(env, ARM_FEATURE_EL3)) { + ARMCPRegInfo rvbar = { + .name = "RVBAR_EL3", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .crn = 12, .crm = 0, .opc2 = 1, + .type = ARM_CP_CONST, .access = PL2_R, .resetvalue = cpu->rvbar + }; + define_one_arm_cp_reg(cpu, &rvbar); + } } else { /* If EL2 is missing but higher ELs are enabled, we need to * register the no_el2 reginfos. @@ -3074,6 +3087,12 @@ void register_cp_regs_for_features(ARMCPU *cpu) } if (arm_feature(env, ARM_FEATURE_EL3)) { define_arm_cp_regs(cpu, el3_cp_reginfo); + ARMCPRegInfo rvbar = { + .name = "RVBAR_EL3", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 6, .crn = 12, .crm = 0, .opc2 = 1, + .type = ARM_CP_CONST, .access = PL3_R, .resetvalue = cpu->rvbar + }; + define_one_arm_cp_reg(cpu, &rvbar); } if (arm_feature(env, ARM_FEATURE_MPU)) { /* These are the MPU registers prior to PMSAv6. Any new