From patchwork Thu Dec 11 23:29:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42164 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8F2F126666 for ; Thu, 11 Dec 2014 23:33:15 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf4472161eek.0 for ; Thu, 11 Dec 2014 15:33:14 -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=XS/2bRMwadXl6W6ZN2CrnjM8a/3FtbaaXaluj+LQSwg=; b=NhZ1fIJo1QQMMxY9QaN1PBCO6ePhI4cHRfW4T7gESmLHl6r256Lw/f5lyO+8ToZH9d BVSE5AEDNeP3jDtskLcHB1YblaZ4gUT917o903YpwC03+kLr1AWzc65QlRqQUVPEbR5O lP8YwIVTRASFZfdv1h1h//yVpiuB/4WVSNHnFRfoESwMg0wprEv5Y236ztjyzAmNuais UEtYT2ofq4g4lmyMjWDEIpdCMXutGTy9L3j30dkSonUgyS+8V84XqNg4zU4dEVxzANrk 9VaKmKzuaLvOtTbs4YKUgZNSFz1Dcq5Ariz+t3rAFWvII+tiMGzXeS7njZJaIB1ADl1z T0qg== X-Gm-Message-State: ALoCoQmPzrX8uOzko8ChzxE7DYT4Jic1sisypnlqWz08U7pL6Od/eMfhs+2ICFb91ttts/SrXWmJ X-Received: by 10.181.27.135 with SMTP id jg7mr209246wid.5.1418340794672; Thu, 11 Dec 2014 15:33:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.71 with SMTP id da7ls369116lad.31.gmail; Thu, 11 Dec 2014 15:33:14 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr12612448lac.70.1418340794510; Thu, 11 Dec 2014 15:33:14 -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 h9si2755212laa.49.2014.12.11.15.33.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:33:14 -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 pn19so5146686lab.23 for ; Thu, 11 Dec 2014 15:33:14 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr12413308lbb.80.1418340794404; Thu, 11 Dec 2014 15:33:14 -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.142.69 with SMTP id ru5csp686470lbb; Thu, 11 Dec 2014 15:33:13 -0800 (PST) X-Received: by 10.140.95.52 with SMTP id h49mr23236903qge.97.1418340792883; Thu, 11 Dec 2014 15:33:12 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z5si3253519qab.9.2014.12.11.15.33.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:33:12 -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]:54659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDEN-0000Qm-W8 for patch@linaro.org; Thu, 11 Dec 2014 18:33:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDBR-0004EC-LA for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzDBL-0001Bi-Ig for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:09 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:55752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDBL-0001A4-B0 for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:03 -0500 Received: by mail-pd0-f174.google.com with SMTP id fp1so5935705pdb.33 for ; Thu, 11 Dec 2014 15:30:02 -0800 (PST) X-Received: by 10.70.91.142 with SMTP id ce14mr21691638pdb.138.1418340602865; Thu, 11 Dec 2014 15:30:02 -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 ip1sm2362908pbc.0.2014.12.11.15.30.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:30:02 -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: Thu, 11 Dec 2014 17:29:28 -0600 Message-Id: <1418340569-30519-15-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418340569-30519-1-git-send-email-greg.bellows@linaro.org> References: <1418340569-30519-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 14/15] target-arm: Disable EL3 on unsupported machines 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 Disables the CPU ARM_FEATURE_EL3 featuere on machine models that can be configured to use Cortex-A9, Cortex-A15, and ARM1176 but don't officially support EL3. This preserves backwards compatibility. Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell --- hw/arm/exynos4210.c | 11 +++++++++++ hw/arm/highbank.c | 12 ++++++++++++ hw/arm/integratorcp.c | 12 ++++++++++++ hw/arm/realview.c | 12 ++++++++++++ hw/arm/versatilepb.c | 12 ++++++++++++ hw/arm/xilinx_zynq.c | 12 ++++++++++++ 6 files changed, 71 insertions(+) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 582794c..97dafca 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -152,6 +152,17 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem, Object *cpuobj = object_new(object_class_get_name(cpu_oc)); Error *err = NULL; + /* By default A9 CPUs have EL3 enabled. This board does not currently + * support EL3 so the CPU EL3 property is disabled before realization. + */ + if (object_property_find(cpuobj, "has_el3", NULL)) { + object_property_set_bool(cpuobj, false, "has_el3", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(1); + } + } + s->cpu[n] = ARM_CPU(cpuobj); object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR, "reset-cbar", &error_abort); diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 30f744a..f67570a 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -241,6 +241,18 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) cpuobj = object_new(object_class_get_name(oc)); cpu = ARM_CPU(cpuobj); + /* By default A9 and A15 CPUs have EL3 enabled. This board does not + * currently support EL3 so the CPU EL3 property is disabled before + * realization. + */ + if (object_property_find(cpuobj, "has_el3", NULL)) { + object_property_set_bool(cpuobj, false, "has_el3", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(1); + } + } + if (object_property_find(cpuobj, "reset-cbar", NULL)) { object_property_set_int(cpuobj, MPCORE_PERIPHBASE, "reset-cbar", &error_abort); diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index f196189..8c48b68 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -493,6 +493,18 @@ static void integratorcp_init(MachineState *machine) cpuobj = object_new(object_class_get_name(cpu_oc)); + /* By default ARM1176 CPUs have EL3 enabled. This board does not + * currently support EL3 so the CPU EL3 property is disabled before + * realization. + */ + if (object_property_find(cpuobj, "has_el3", NULL)) { + object_property_set_bool(cpuobj, false, "has_el3", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(1); + } + } + object_property_set_bool(cpuobj, true, "realized", &err); if (err) { error_report("%s", error_get_pretty(err)); diff --git a/hw/arm/realview.c b/hw/arm/realview.c index d41ec97..66e51ef 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -101,6 +101,18 @@ static void realview_init(MachineState *machine, Object *cpuobj = object_new(object_class_get_name(cpu_oc)); Error *err = NULL; + /* By default A9,A15 and ARM1176 CPUs have EL3 enabled. This board + * does not currently support EL3 so the CPU EL3 property is disabled + * before realization. + */ + if (object_property_find(cpuobj, "has_el3", NULL)) { + object_property_set_bool(cpuobj, false, "has_el3", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(1); + } + } + if (is_pb && is_mpcore) { object_property_set_int(cpuobj, periphbase, "reset-cbar", &err); if (err) { diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index b74dc15..6c4c2e7 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -206,6 +206,18 @@ static void versatile_init(MachineState *machine, int board_id) cpuobj = object_new(object_class_get_name(cpu_oc)); + /* By default ARM1176 CPUs have EL3 enabled. This board does not + * currently support EL3 so the CPU EL3 property is disabled before + * realization. + */ + if (object_property_find(cpuobj, "has_el3", NULL)) { + object_property_set_bool(cpuobj, false, "has_el3", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(1); + } + } + object_property_set_bool(cpuobj, true, "realized", &err); if (err) { error_report("%s", error_get_pretty(err)); diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index b590392..06e6e24 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -126,6 +126,18 @@ static void zynq_init(MachineState *machine) cpu = ARM_CPU(object_new(object_class_get_name(cpu_oc))); + /* By default A9 CPUs have EL3 enabled. This board does not + * currently support EL3 so the CPU EL3 property is disabled before + * realization. + */ + if (object_property_find(OBJECT(cpu), "has_el3", NULL)) { + object_property_set_bool(OBJECT(cpu), false, "has_el3", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(1); + } + } + object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", &err); if (err) { error_report("%s", error_get_pretty(err));