From patchwork Mon Dec 15 18:51:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42287 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 AAB9C2456A for ; Mon, 15 Dec 2014 19:00:14 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf4089754lbi.4 for ; Mon, 15 Dec 2014 11:00:13 -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=bmzVhl/7vg6x9BlEWuhNNGprFI+IK/DzYwoEfKFqyls=; b=UcosVE3ugRiaortXushi9itlLy5xb9/cwa3ciztUzlYR0nNaZyb0szP7ov11nOuNn+ BUFdLNEULCl0ESJzo+Hy5svl0jl+PuhCWX3Yg+k4Ix+/FK/gXHR1seorX9om6YQecmIV Gp+DCE8FlxwEpATZUrKrAKNKaCWLBOLwoJEJKckjls7oTCHo0oAhukvvJ9eEBf549I2T tURu/INmiBUce19p3Sv8A2dRbkK47+VuSEKpIrB6YH3wNVeNkSKdIjgnQnViM78RS9Da Erw2B24GdmuYy3mzt8FkX0ERhQaAOPRfiA5LePfCogh8HtKaluCns9A8KfpT2wwCyeJY QQ8Q== X-Gm-Message-State: ALoCoQkBQZ1N7T9dXZ98aEbQZGHTnF4yjWBSlEhFq2MdTbwTJSbe7mlIK3PmfzEGevDjaeK57SNH X-Received: by 10.194.71.48 with SMTP id r16mr4776wju.7.1418670013246; Mon, 15 Dec 2014 11:00:13 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.71 with SMTP id da7ls784729lad.31.gmail; Mon, 15 Dec 2014 11:00:13 -0800 (PST) X-Received: by 10.112.99.71 with SMTP id eo7mr17215956lbb.26.1418670013077; Mon, 15 Dec 2014 11:00:13 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id k1si6588251lah.94.2014.12.15.11.00.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 11:00:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id w7so5413663lbi.30 for ; Mon, 15 Dec 2014 11:00:13 -0800 (PST) X-Received: by 10.112.135.197 with SMTP id pu5mr31585354lbb.22.1418670012939; Mon, 15 Dec 2014 11:00:12 -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 ru5csp810471lbb; Mon, 15 Dec 2014 11:00:12 -0800 (PST) X-Received: by 10.140.39.201 with SMTP id v67mr54976401qgv.45.1418670011278; Mon, 15 Dec 2014 11:00:11 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 61si7127857qgx.12.2014.12.15.11.00.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 11:00:11 -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]:41520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0asM-00064W-8T for patch@linaro.org; Mon, 15 Dec 2014 14:00:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0akR-0000vf-C5 for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:52:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0akL-0005yx-5Y for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:59 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:41770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0akK-0005yX-Og for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:53 -0500 Received: by mail-pa0-f48.google.com with SMTP id rd3so12346222pab.35 for ; Mon, 15 Dec 2014 10:51:52 -0800 (PST) X-Received: by 10.66.186.110 with SMTP id fj14mr50573237pac.98.1418669512153; Mon, 15 Dec 2014 10:51:52 -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 bq7sm9972513pdb.50.2014.12.15.10.51.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:51:51 -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: Mon, 15 Dec 2014 12:51:18 -0600 Message-Id: <1418669479-23908-15-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418669479-23908-1-git-send-email-greg.bellows@linaro.org> References: <1418669479-23908-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.220.48 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v3 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.217.171 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));