From patchwork Fri Apr 21 13:12:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9692809 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 1825960328 for ; Fri, 21 Apr 2017 13:17:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A6DA25EA6 for ; Fri, 21 Apr 2017 13:17:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F37D826419; Fri, 21 Apr 2017 13:17:22 +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 6597225EA6 for ; Fri, 21 Apr 2017 13:17:22 +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 1d1YOf-0002qf-53; Fri, 21 Apr 2017 13:14:49 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1YOd-0002qZ-Jf for xen-devel@lists.xen.org; Fri, 21 Apr 2017 13:14:47 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id ED/54-03613-6C50AF85; Fri, 21 Apr 2017 13:14:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRWlGSWpSXmKPExsVysyfVTfcY668 Ig/3fpC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oxVP30KZvJVvHsb2sD4hruLkYtDSGATo8Ss q6tYIZztjBJ3+84BOZwcbALaElN/T2QGsUUEpCWufb7MCGIzC0RKTOnpA4pzcAgL+Em8PhYFE mYRUJU4tuktG4jNK2AlsXDTEjBbQkBeYlfbRdYJjJwLGBlWMaoXpxaVpRbpmuolFWWmZ5TkJm bm6BoamOnlphYXJ6an5iQmFesl5+duYgR6igEIdjBOv+x/iFGSg0lJlDfk988IIb6k/JTKjMT ijPii0pzU4kOMMhwcShK8W1l+RQgJFqWmp1akZeYAQwYmLcHBoyTCOxUkzVtckJhbnJkOkTrF qCglztsAkhAASWSU5sG1wcL0EqOslDAvI9AhQjwFqUW5mSWo8q8YxTkYlYR514JM4cnMK4Gb/ gpoMRPQ4rN+P0AWlyQipKQaGOf5R5hb89habdnYp/A90M5zlb2cy4flTH8dtRJjXiQtXd2m1n 1WMry3Wozzf2FeqtEJvV1bl28w/32jKn2pksif1mMGq2SapkdI3Je6skg8efHDq065p0OvvP1 +IVwztUp1H1Pjd4PNx1Wrpt5Me/366+eU3IMbEsoDyjavk3zYfM9VMtf6jhJLcUaioRZzUXEi AKXqp/ZOAgAA X-Env-Sender: punit.agrawal@arm.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1492780486!75123284!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 33740 invoked from network); 21 Apr 2017 13:14:46 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-10.tower-27.messagelabs.com with SMTP; 21 Apr 2017 13:14:46 -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 A909DB16; Fri, 21 Apr 2017 06:14:45 -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 795C73F4FF; Fri, 21 Apr 2017 06:14:45 -0700 (PDT) From: Punit Agrawal To: xen-devel@lists.xen.org Date: Fri, 21 Apr 2017 14:12:54 +0100 Message-Id: <20170421131254.18876-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 v2 for-4.9] 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 Reviewed-by: Stefano Stabellini --- v1 -> v2 * Changed tab to spaces * Added tag --- 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..046905f6c3 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();