From patchwork Fri Apr 21 09:27:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9692283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 002D860328 for ; Fri, 21 Apr 2017 09:29:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF59F27FA3 for ; Fri, 21 Apr 2017 09:29:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2D1328616; Fri, 21 Apr 2017 09:29:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5626827FA3 for ; Fri, 21 Apr 2017 09:29:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1Uqp-0005xW-9R; Fri, 21 Apr 2017 09:27:39 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1Uqo-0005xK-6p for xen-devel@lists.xen.org; Fri, 21 Apr 2017 09:27:38 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 85/E4-03557-980D9F85; Fri, 21 Apr 2017 09:27:37 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRWlGSWpSXmKPExsVysyfVTbfzws8 Igynv2SyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owf07axFWzgrZh2YhNzA+Ms7i5GLg4hgc2M EouXdLNAONsZJZZt3szUxcjJwSagLTH190RmEFtEQFri2ufLjCA2s0CkxJSePrC4sICzxL1FE 1hAbBYBVYnNix6C1fAKWEms/fGfDcSWEJCX2NV2kXUCI+cCRoZVjBrFqUVlqUW6hkZ6SUWZ6R kluYmZObqGBmZ6uanFxYnpqTmJScV6yfm5mxiBHmMAgh2MlzcGHGKU5GBSEuW92vEzQogvKT+ lMiOxOCO+qDQntfgQowwHh5IEr/N5oJxgUWp6akVaZg4wdGDSEhw8SiK8/eeA0rzFBYm5xZnp EKlTjIpS4rxyIH0CIImM0jy4Nli4XmKUlRLmZQQ6RIinILUoN7MEVf4VozgHo5IwbxvIFJ7Mv BK46a+AFjMBLT7r9wNkcUkiQkqqgTFaYIeKmuPibL+30+rt/ZyfLeCZO3nPqbbCtV8/3TQpv/ TPporxp0rvc40Mx+V7fSzU+JdcYSyTKTG593rhv91nr8/S0NHVmv9YJlEh6Oz05XaBGX3MtnY 6aYc3bAzfI1ByWvuJ6nI9I6E7fpvZfn0O8dqz4lfUzgTlNdOLb8WfKNod0rZgHrsSS3FGoqEW c1FxIgAW6MkcUgIAAA== X-Env-Sender: punit.agrawal@arm.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1492766856!45443068!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10869 invoked from network); 21 Apr 2017 09:27:36 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-15.tower-27.messagelabs.com with SMTP; 21 Apr 2017 09:27:36 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 24F2615A2; Fri, 21 Apr 2017 02:27:36 -0700 (PDT) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.207.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E94AC3F41F; Fri, 21 Apr 2017 02:27:35 -0700 (PDT) From: Punit Agrawal To: xen-devel@lists.xen.org Date: Fri, 21 Apr 2017 10:27:32 +0100 Message-Id: <20170421092732.12656-1-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 Cc: julien.grall@arm.com, Punit Agrawal , sstabellini@kernel.org Subject: [Xen-devel] [PATCH] xen/arm: Don't unflatten DT when booting with ACPI X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Unflattening the device tree when booting with "acpi=force" leads to the following stack trace on AMD Seattle platform - (XEN) Xen call trace: (XEN) [<0000000000204bfc>] dt_irq_translate+0x48/0x58 (PC) (XEN) [<0000000000204f5c>] dt_device_get_irq+0x34/0x38 (LR) (XEN) [<0000000000251a08>] platform_get_irq+0x14/0x44 (XEN) [<00000000002952bc>] smmu.c#arm_smmu_dt_init+0x190/0x100c (XEN) [<0000000000299310>] device_init+0xa8/0xdc (XEN) [<00000000002950f0>] iommu_hardware_setup+0x34/0x68 (XEN) [<0000000000294ef0>] iommu_setup+0x48/0x1c8 (XEN) [<000000000029cecc>] start_xen+0xb94/0xd34 (XEN) [<00000083fbba91dc>] 00000083fbba91dc The problem arises due to the unflattened device tree being unconditionally used in iommu_hardware_setup(). Let's re-arrange the code without changing boot order to unflatten the device tree only when acpi is disabled. Signed-off-by: Punit Agrawal Reviewed-by: Julien Grall --- xen/arch/arm/setup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 92a2de6b70..4d62ea8157 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -753,16 +753,18 @@ void __init start_xen(unsigned long boot_phys_offset, /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); + end_boot_allocator(); + + vm_init(); + if ( acpi_disabled ) + { printk("Booting using Device Tree\n"); + dt_unflatten_host_device_tree(); + } else printk("Booting using ACPI\n"); - end_boot_allocator(); - - vm_init(); - dt_unflatten_host_device_tree(); - init_IRQ(); platform_init();