From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mqHQq-00021H-5O for mharc-grub-devel@gnu.org; Thu, 25 Nov 2021 11:17:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqHQn-0001zH-MC for grub-devel@gnu.org; Thu, 25 Nov 2021 11:17:05 -0500 Received: from dibed.net-space.pl ([84.10.22.86]:45316) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:192) (Exim 4.90_1) (envelope-from ) id 1mqHQl-0002JR-Db for grub-devel@gnu.org; Thu, 25 Nov 2021 11:17:05 -0500 Received: from router-fw.i.net-space.pl ([192.168.52.1]:45678 "EHLO tomti.i.net-space.pl") by router-fw-old.i.net-space.pl with ESMTP id S2091809AbhKYQQl (ORCPT ); Thu, 25 Nov 2021 17:16:41 +0100 X-Comment: RFC 2476 MSA function at dibed.net-space.pl logged sender identity as: dkiper Date: Thu, 25 Nov 2021 17:16:36 +0100 From: Daniel Kiper To: Nikita Ermakov Cc: GRUB development mailing list , Ard Biesheuvel , Atish Patra , Heinrich Schuchardt , Leif Lindholm , Fu Wei Subject: Re: [PATCH v3 4/7] linux: ignore FDT unless we need to modify it Message-ID: <20211125161636.cwp6oy46lc6s62l5@tomti.i.net-space.pl> References: <20211028203118.7908-1-arei@altlinux.org> <20211028203118.7908-5-arei@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211028203118.7908-5-arei@altlinux.org> User-Agent: NeoMutt/20170113 (1.7.2) Received-SPF: pass client-ip=84.10.22.86; envelope-from=dkiper@net-space.pl; helo=dibed.net-space.pl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2021 16:17:05 -0000 On Thu, Oct 28, 2021 at 11:31:17PM +0300, Nikita Ermakov wrote: > From: Ard Biesheuvel > > Now that we implemented supported for the LoadFile2 protocol for initrd > loading, there is no longer a need to pass the initrd parameters via > the device tree. This means there is no longer a reason to update the > device tree in the first place, and so we can ignore it entirely. > > The only remaining reason to deal with the devicetree is if we are > using the 'devicetree' command to load one from disk, so tweak the > logic in grub_fdt_install() to take that into account. > > Signed-off-by: Ard Biesheuvel > --- > grub-core/loader/arm64/linux.c | 22 +++++++++++----------- > grub-core/loader/efi/fdt.c | 7 +++++-- > 2 files changed, 16 insertions(+), 13 deletions(-) > > diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c > index 6b03455d1..65f1275fb 100644 > --- a/grub-core/loader/arm64/linux.c > +++ b/grub-core/loader/arm64/linux.c > @@ -95,21 +95,21 @@ finalize_params_linux (void) > > void *fdt; > > - fdt = grub_fdt_load (GRUB_EFI_LINUX_FDT_EXTRA_SPACE); > + /* Set initrd info */ > + if (initrd_start && initrd_end > initrd_start) > + { > + fdt = grub_fdt_load (GRUB_EFI_LINUX_FDT_EXTRA_SPACE); > > - if (!fdt) > - goto failure; > + if (!fdt) > + goto failure; > > - node = grub_fdt_find_subnode (fdt, 0, "chosen"); > - if (node < 0) > - node = grub_fdt_add_subnode (fdt, 0, "chosen"); > + node = grub_fdt_find_subnode (fdt, 0, "chosen"); > + if (node < 0) > + node = grub_fdt_add_subnode (fdt, 0, "chosen"); > > - if (node < 1) > - goto failure; > + if (node < 1) > + goto failure; > > - /* Set initrd info */ > - if (initrd_start && initrd_end > initrd_start) > - { > grub_dprintf ("linux", "Initrd @ %p-%p\n", > (void *) initrd_start, (void *) initrd_end); You are saying in the commit message that this code is not needed any longer but effectively it stay as is. Something is wrong here. I think the commit message should be improved or the initrd FDT code should be removed entirely. Daniel