From patchwork Fri Jan 23 16:17:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 43676 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 91626240D9 for ; Fri, 23 Jan 2015 16:18:35 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf4759976lbj.0 for ; Fri, 23 Jan 2015 08:18:34 -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=/7tx8fO9GzUNmKHduj8wJIRuKD9/5ewKT+JzA1ygFec=; b=QkG/pmvYcFF+6vg3zjczpoCggbR0bDpTV+Pctpnw2cN8T1WZpYGMNUXBxV4ORYcyqg SqoSrGvFPoIhB5NNDJXh3fyOWJaH275MEFdYCjqDfpHHyWWjJnOBvWu6xfft36so9zfw 7bhUzUWAsyBDq8yDFATxTsllLbaRVqubXUEQJ+WfDC9My9o4YyLQtgozGyKDKy6IdwTy 0hFOtL9+wkyieRJY+sr3fB5djUddV6gBmnkHItytxi3Vi/8gZ+EV6sF/EN8nvDF8tzAc kOSSzAObBTgATKwmBWbTEwETeju6MUbSFcOXstvqYsYXJX8J57/EOGGpaI4qB1dubdPH KxLA== X-Gm-Message-State: ALoCoQnNONYbwwHel67OQEMyfgbe+WHgifuFDoNHiibdVEluO/Dt8X2HmkPMdRn+OrPd4IwjR9ta X-Received: by 10.180.82.34 with SMTP id f2mr413214wiy.1.1422029914498; Fri, 23 Jan 2015 08:18:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.132 with SMTP id n4ls208627lae.6.gmail; Fri, 23 Jan 2015 08:18:34 -0800 (PST) X-Received: by 10.152.87.16 with SMTP id t16mr8217724laz.63.1422029914205; Fri, 23 Jan 2015 08:18:34 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id yv9si1723753lbb.103.2015.01.23.08.18.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 08:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id hs14so1803467lab.9 for ; Fri, 23 Jan 2015 08:18:34 -0800 (PST) X-Received: by 10.112.131.1 with SMTP id oi1mr8146438lbb.2.1422029914098; Fri, 23 Jan 2015 08:18:34 -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 c8csp307791lbb; Fri, 23 Jan 2015 08:18:33 -0800 (PST) X-Received: by 10.224.45.195 with SMTP id g3mr15467125qaf.59.1422029912766; Fri, 23 Jan 2015 08:18:32 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u4si2460415qac.80.2015.01.23.08.18.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 08:18:32 -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]:60167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEgwJ-0006ea-OY for patch@linaro.org; Fri, 23 Jan 2015 11:18:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEgvP-0005jc-R0 for qemu-devel@nongnu.org; Fri, 23 Jan 2015 11:17:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEgvJ-00035I-KJ for qemu-devel@nongnu.org; Fri, 23 Jan 2015 11:17:35 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:60061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEgvJ-00035C-Eb for qemu-devel@nongnu.org; Fri, 23 Jan 2015 11:17:29 -0500 Received: by mail-pd0-f174.google.com with SMTP id ft15so9342215pdb.5 for ; Fri, 23 Jan 2015 08:17:29 -0800 (PST) X-Received: by 10.68.223.196 with SMTP id qw4mr12747530pbc.26.1422029848917; Fri, 23 Jan 2015 08:17:28 -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 s4sm643214pdd.40.2015.01.23.08.17.27 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 08:17:28 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 23 Jan 2015 10:17:13 -0600 Message-Id: <1422029835-4696-3-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1422029835-4696-1-git-send-email-greg.bellows@linaro.org> References: <1422029835-4696-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.174 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH V2 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.215.50 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..29f3b62 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_EL2", .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