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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 B5902C11F66 for ; Tue, 29 Jun 2021 12:56:28 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 142A361DED for ; Tue, 29 Jun 2021 12:56:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 142A361DED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E4CA83171; Tue, 29 Jun 2021 14:56:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hb4d3P2X"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5EA0D83173; Tue, 29 Jun 2021 14:56:24 +0200 (CEST) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2515682E8E for ; Tue, 29 Jun 2021 14:56:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x52e.google.com with SMTP id y17so6135218pgf.12 for ; Tue, 29 Jun 2021 05:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=vTcF1cXwLL2JcSPwrI4OZO0EjRqp5XqGMQFiiybbgeI=; b=hb4d3P2Xovte5yWr6icgVB+M8U9yS1Y7BkpNbxiQwJGypeX4NK/uIqG7uRX57ilDr8 ZjgLykR6jqW1KWP6qWJ1TtIFeEM34LOAQJ13+0gsfCGhgeBW21S2Pgdp+BtpgetVBQhi 0cefXXKNj0+STk3DLNhsDwuFdZ6BPonZUYdic3d446qGN3JQl4eAFPb8NBBzFd6L+k8n Fq8w2EnqBzyL/nzHzxAkYmwXskm8cK87PFb8WhPZh8F8d3zeyLpVxWbWfzt3IesHvpIg PfUh12/3NYjtU+tfvOWjio4xx0Y5rZDrTJRjAHX1cRnjl9WsD9HIJZr9dFbq9QzoSA7y /aHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=vTcF1cXwLL2JcSPwrI4OZO0EjRqp5XqGMQFiiybbgeI=; b=aVdh33RrqMuq/HL/cGLgVeIvUDdPU50ptSy4E3RHb8uLcNKZU0KWc5USOtetoOD0gD knUzgdw1mE4rGHEHj/0KPXKyeKvuNpx/OCADt/GBh2cJI4y5gD/DUkbyuUdlMrq4bstq hwr1hE1f9tBjA8ZRipx3hJdMFOFNSRZIiAviRjB/uzDZQBO9jQOCsIVzRH9H1Y1AXLBy XE5p3XswCmds6asJ675B2jxZZF3QcXpawIrWEm+eSa1wUqIcMeTJevJ7KFTx/Y27BkU6 hTDDqC2+QjYpx3RGPUoZLyys3CRj+btyBJKKfJtINWIVwHvgGnl1Tst4rO8W8MhWvEUC ljnw== X-Gm-Message-State: AOAM531p6fBayoLQQw7sCk9zwUwf48Gek/W9pjR4qdeyGATK5kxQClKU X60gtVRiEIeybrCXY3VMRDrjtmAwKoJ7tw== X-Google-Smtp-Source: ABdhPJyIBqwWOq5mUHNnnOIk2FMjq3uhhVMsqIM7Q+re9tTIcxzSQYf886248BMI9/av1Qi8Rf+TkA== X-Received: by 2002:a63:445b:: with SMTP id t27mr28345375pgk.413.1624971378484; Tue, 29 Jun 2021 05:56:18 -0700 (PDT) Received: from laputa (p3dd30534.tkyea130.ap.so-net.ne.jp. [61.211.5.52]) by smtp.gmail.com with ESMTPSA id j10sm18320509pjb.36.2021.06.29.05.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 05:56:18 -0700 (PDT) Date: Tue, 29 Jun 2021 21:56:13 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Tom Rini , Heinrich Schuchardt , Mark Kettenis , U-Boot Mailing List , Pali Roh??r , Ilias Apalodimas , Alex Graf , Masahiro Yamada Subject: Re: [PATCH 0/7] efi: Various tidy-ups and drop the default Message-ID: <20210629125613.GA48515@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , Tom Rini , Heinrich Schuchardt , Mark Kettenis , U-Boot Mailing List , Pali Roh??r , Ilias Apalodimas , Alex Graf , Masahiro Yamada References: <20210628014841.501036-1-sjg@chromium.org> <5613706c36261e2a@bloch.sibelius.xs4all.nl> <20210628133711.GY9516@bill-the-cat> <5a197768-3d0a-3b3b-5897-ed28d4e0f566@gmx.de> <20210628172744.GQ9516@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Mon, Jun 28, 2021 at 12:08:27PM -0600, Simon Glass wrote: > Hi Tom, > > On Mon, 28 Jun 2021 at 11:27, Tom Rini wrote: > > > > On Mon, Jun 28, 2021 at 10:26:35AM -0600, Simon Glass wrote: > > > Hi Heinrich, > > > > > > On Mon, 28 Jun 2021 at 09:20, Heinrich Schuchardt wrote: > > > > > > > > On 6/28/21 4:18 PM, Simon Glass wrote: > > > > > Hi Tom, Mark, > > > > > > > > > > On Mon, 28 Jun 2021 at 07:37, Tom Rini wrote: > > > > >> > > > > >> On Mon, Jun 28, 2021 at 10:38:50AM +0200, Mark Kettenis wrote: > > > > >>>> From: Simon Glass > > > > >>>> Date: Sun, 27 Jun 2021 19:48:34 -0600 > > > > >>>> > > > > >>>> It has come to light that EFI_LOADER adds an extraordinary amount of > > > > >>>> code to U-Boot. For example, with nokia_rx51 the size delta is about > > > > >>>> 90KB. About 170 boards explicitly disable the option, but is is clear > > > > >>>> that many more could, thus saving image size and boot time. > > > > >>> > > > > >>> EFI_LOADER used to be a lot smaller. It is great to see that over the > > > > >>> years UEFI support has become more complete, but a lot of that new > > > > >>> code implements features that are not at all essential for just > > > > >>> booting an OS from storage. If that growth leads to the suggestion to > > > > >>> disable EFI_LOADER completely by default, we're putting the cart > > > > >>> before the horse. > > > > >> > > > > >> Well, I see I forgot to prefix my patch with RFC, but I hadn't found > > > > >> EFI_LOADER being used in the wild on armv7, but wasn't sure about the > > > > >> BSD families. I did see that Debian doesn't use it, and that Armbian > > > > >> doesn't even use it on aarch64. > > > > >> > > > > >>>> The current situation is affecting U-Boot's image as a svelt bootloader. > > > > >>> > > > > >>> Really? I know UEFI has a bad reputation in the Open Source world, > > > > >>> and some of its Microsoft-isms are really annoying (yay UCS-2). But > > > > >>> it works, it provides a standardized approach across several platforms > > > > >>> (ARMv7, AMRv8, RISC-V) and the industry seems to like it. Personally > > > > >>> I'd wish the industry had standardized on Open Firmware instead, but > > > > >>> that ship sailed a long time ago... > > > > >>> > > > > >>> I find it hard to imagine that 90k is a serious amount of storage for > > > > >>> something that is going to include a multi-MB Linux kernel. This > > > > >>> isn't code that lives in SPL or TPL where severe size restrictions > > > > >>> apply. > > > > >> > > > > >> In one of those cases where I need to pop back in to the other (Nokia > > > > >> N900 specific) thread and see if the big size reduction really was just > > > > >> disabling EFI_LOADER, it's perhaps just one of those "fun" things about > > > > >> Kconfig and anything other than "make oldconfig" for spotting new config > > > > >> options that default to enabled. > > > > > > > > > > Yes it will be interesting to see what you find there. My results on > > > > > nokia_rx51 were something like this: > > > > > > > > > > default > > > > > arm: (for 1/1 boards) all +129370.0 bss +1136.0 data +7399.0 > > > > > rodata +10989.0 text +109846.0 > > > > > > > > > > without ebbr > > > > > arm: (for 1/1 boards) all +38460.0 bss +1040.0 data +2375.0 > > > > > rodata +5333.0 text +29712.0 > > > > > > > > > > with various other things: > > > > > CONFIG_OF_LIBFDT_ASSUME_MASK=7 > > > > > # CONFIG_OF_TRANSLATE is not set > > > > > # CONFIG_SIMPLE_BUS is not set > > > > > # CONFIG_TI_SYSC is not set > > > > > # CONFIG_CMD_FDT is not set > > > > > > > > > > arm: (for 1/1 boards) all +19170.0 bss -16.0 data +360.0 rodata > > > > > +3274.0 text +15552.0 > > > > > > > > > > (Mark, in the same email:) > > > > >>> FIT simply isn't fit for purpose (pun intended). It only really works > > > > >>> for booting Linux, and forces people to combine u-boot, kernel, > > > > >>> initial ramdisk and other firmware components into a single image. > > > > >>> That is really undesirable as: > > > > >>> - This makes it sigificantly harder to update individual components of > > > > >>> such an image. Making it hard to update a kernel is obviously a > > > > >>> serious security risk. > > > > >>> - This makes it impossible to build an OS install image that works om > > > > >>> multiple boards/SoCs. > > > > > > > > > > > > > > > I would really like to understand this better. The whole thing is a > > > > > complete mystery to me. > > > > > > > > > > Firstly I have sometimes fiddled with booting other OSes using FIT. It > > > > > seemed OK. I can't see why it only works with Linux. > > > > > > > > > > Secondly, I don't expect that U-Boot itself would be in the FIT. > > > > > > > > > > Thirdly, do you really want the kernel and initrd to be separate? At > > > > > least in the systems I have used, they are built together, even having > > > > > the same name, e.g.: > > > > > > > > > > initrd.img-5.10.40-1rodete1-amd64 > > > > > System.map-5.10.40-1rodete1-amd64 > > > > > vmlinuz-5.10.28-1rodete2-amd64 > > > > > > > > I have not hit any distro that builds FIT images. All install vmlinux > > > > and initrd as separate files. > > > > > > > > Why would you want to change that? > > > > > > Well there is no point in having two files if one will do. Also it > > > allows for a hash / signature check. > > > > The question of "how great would it be and how many problems would it > > have solved if FIT images had become popular" is one for another time. > > It will always have its use cases and users but never the broad adoption > > many of us felt it should have. Bringing it up in this context won't > > change that. > > I see Peter's reply below so will make time to dig into this and > understand the problems with FIT better. I feel that EFI comes with > all sorts of problems so I'm far from convinced, at this point. Sorry. It seems to me that we are discussing three different things: - the code size increase by enabling UEFI interfaces - how the UEFI interface be implemented on U-Boot - The primary (or default/standard) boot mechanism in the future I don't think they are totally independent, but we'd better distinguish them some how in the following discussions. > > > > I'm saying this because I think there are some important technical > > questions within U-Boot to resolve because the EFI loader part of U-Boot > > is critical to our long term future. And DM is an important part of our > > internal design and we're (probably later than I should have) pulling > > out the parts that haven't been updated so that we can deliver on some > > of the overall promise of DM better, too. > > Yes, migration has certainly been slow. As you know I mostly stopped > pushing it a few years back when I saw all the reluctance. I'm very > pleased you are taking that on and I think it will help a lot. I posted this patch[1] two years ago and I thought that we had had some sort of consensus that UEFI interfaces be integrated more elegantly with DM in the future. So I was a bit surprised with Heinrich's recent patch. In [1], I was trying to define all the UEFI handles, including some protocols?, as DM objects. I thought that it was the best way for unifying the two worlds even if there are no corresponding *notions* in the existing DM objects. [1] https://lists.denx.de/pipermail/u-boot/2019-February/357923.html -Takahiro Akashi > If what you say comes to pass, it is even more important that EFI is > more integrated, rather than being a bolt on. Thanks largely to > Heinrich, the tests are in quite good shape, so refactoring should be > feasible. > > Regards, > Simon