From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0364BC07E9A for ; Wed, 14 Jul 2021 08:19:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C877561183 for ; Wed, 14 Jul 2021 08:19:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C877561183 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: CC:To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=icN3G+P7etF4ofS6wXVK8R4LbNHKlNgswawxXLuFvvk=; b=TK72a34gAeLB2tn3jqnZcdT+zB JO66YDN8tDnUGk7B83Buz4VW+2K/vLB7LHae9BhJ8BvgUhltlMD5fjEj9Q+NI3clYCFEyOhyxfF5b EBEg7Kko/rqoihnxJklL9Jblex2rml7HKNRy6kuyYEsnABAMkhv6Abm9H7ZbnGeUHC7HuBvPYPhxh IzzFax4PYnelo/ZWVKwZbRgmPXipCklv77IxaUTarCJ91aPHAzkl3MMONXXAPiu4j2wDvKXcSi0/3 xhGZe5P/MUBpAwrk/iOGJ03ZEZnN+Y/imB0aajxtpUHU+77oqYrMUoNhMxbJ1QPC5LoATDtPhL3MF 55+83Y3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3a5U-00CbJa-57; Wed, 14 Jul 2021 08:17:48 +0000 Received: from esa3.mentor.iphmx.com ([68.232.137.180]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3a5I-00CbI7-R6 for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 08:17:38 +0000 IronPort-SDR: K9/J1ViLuoIXByr2gjqEOVXHfl4nZhAIdanB0+FMLEsVC5XpaQPQjRU1Zc2XFy3R9SdxDTAYSp OctPXOwUxKU/F0qiBSW3Y4vEr4UetZV3BeUF6LoLkvQT48A41nFNHeOCe2Bi9dy6RHUqF57cjS sOdDEOL6dvKVwW0HRXSHC4IMLnQhMvZ8LnVxFKJuhouJosvb9rOGvhfc3g+gpCUxWGxRYDwF0U xad29+mSyYefN1Ez5klU//i/6cXDay79ojbqPk2+BkLRBaGTapRIPT7+lJMw/XqmgZuZt2iikO YfAjPkPusDhBVKVI6YZSs3mN X-IronPort-AV: E=Sophos;i="5.84,238,1620720000"; d="scan'208";a="63496982" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 14 Jul 2021 00:17:35 -0800 IronPort-SDR: 2Va4E/JxzIQEDtwDo7DY976TesyNf6w+UWrnVYI4rNaED2gFzhEWPOkjx/mD/25gEjjz+3hTY3 PfQMWvleMj4ppGLMwB/IpLJn0XDkGTdjdO+xpjfarxTMwx00IVtFCHXk2KVQVyrYDbb3LOfi8q IhHMnBmK6jc5xqxgrr/D0S2b5qtE+A2LsKrNZE1eMLjVYA9cwhJG2xOx6KDhIW7Z7MSBXs/C+1 kuKkbB4RePPtvjKsFZJeSWAdKvxOFigYZIg5k7pzxBEGFfnGAHSQKMD/e2+jqFB0zdSpKQWOuf E74= Subject: Re: U-Boot: Arm64: bootm gets stuck if RANDOMIZE_BASE is disabled From: Ahsan Hussain To: Mark Rutland CC: , , References: <55bdb150-ac99-26a5-76e5-a1d559b34f33@mentor.com> <20210713092549.GA13027@C02TD0UTHF1T.local> Message-ID: Date: Wed, 14 Jul 2021 13:17:27 +0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_011737_016923_ED1ACF80 X-CRM114-Status: GOOD ( 20.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello folks, Any insight would be highly appreciated. On 7/13/21 2:53 PM, Ahsan Hussain wrote: > > On 7/13/21 2:25 PM, Mark Rutland wrote: >> On Tue, Jul 13, 2021 at 02:15:08PM +0500, Ahsan Hussain wrote: >>> Hello, >>> >>> I'm dumbfounded by a seemingly unrelated early kernel hang/failing >>> to boot >>> when CONFIG_RANDOMIZE_BASE=n is set in kernel and we use FIT uImage. >>> I've >>> verified this behavior on a couple of i.MX8 SoCs (i.MX8M plus and >>> i.MX8QXP) >>> and the results remain consistent. >>> >>> I'm able to boot kernel when I use booti command. However when I use >>> bootm >>> to boot a U-Boot fitImage (with kernel and fdt load >>> addresses/entrypoint in >>> .its file same as I used for booti command; also tried disabling >>> relocation >>> for fdt by setting fdt_high=~0UL), the boot gets stuck at "Starting >>> kernel >>> ...". On disabling RANDOMIZE_BASE kconfig in Linux the same fitImage >>> is able >>> to boot. >> Can you say which address you're trying to load the kernel to? > At 0xf0000000, towards the end of first DRAM bank which starts at > 0x40000000. >>> I've tried enabling earlycon and U-Boot debug messages in >>> common/bootm.c and >>> arch/arm/lib/bootm.c but found no helpful difference in both boot >>> flows. >>> Please let me know if I'm missing something obvious or where do I start >>> looking to debug this issue. >> IIUC, the booti command respects the text_offset from the kernel header, >> whereas bootm will not. If you have a hard-coded offset, it's possible >> you're violating the offset the kernel expects, and where the kernel is >> not relocatable, if can't fix itself up. > > A minor correction is that when CONFIG_RANDOMIZE_BASE is _enabled_ the > issue is gone. It is only observed when RANDOMIZE_BASE is _disabled_. > Both booti and bootm calculate text_offset the same way based on arm64 > image header->image_size field, in booti_setup() routine from U-Boot > arch/arm/lib/image.c. > > > Regards, > Ahsan > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel