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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 908B8C433EF for ; Fri, 29 Oct 2021 14:39:51 +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 BC499610A0 for ; Fri, 29 Oct 2021 14:39:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BC499610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98907835B9; Fri, 29 Oct 2021 16:39:47 +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="tWPTgdSd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 393E1835C1; Fri, 29 Oct 2021 16:39:45 +0200 (CEST) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (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 ACAD7835B0 for ; Fri, 29 Oct 2021 16:39:40 +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=ilias.apalodimas@linaro.org Received: by mail-yb1-xb32.google.com with SMTP id 67so24725124yba.6 for ; Fri, 29 Oct 2021 07:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=uoUrV63QLS8sk6HOO+mQnSRJm9YA7UXqnaqY9mUPGWM=; b=tWPTgdSdMvsTN+3CQAoxQSvUPgKPCigybmV1YX2bZgs+UPyro0nVhLreTr133LSJar 7t1ybDGOIybAZhyXQdTEl1wrPlB85GLjoDYNAVZ/7Rbn7kzY2xz+AkjXvjBr7H8TSXMr 6/yahLzanw5EV/6NvY89g23/7bW+UO0Mky+bO+Nkl92yof6DG0DL3u3HE1jM3cNOEhs4 UGY4hMXccljrWpJDPLjVp4WdU/lYSUchPyhIxC6JGCxpEjrnfg/b8BOuSDwv4zLwxfDV Jpd3gQY2G+a9RMk8hBo2xmdfJFeJr5NKJQVjUk7CH7k0gSK/9PklWyY7nxR7OjCqvRlc 2XCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=uoUrV63QLS8sk6HOO+mQnSRJm9YA7UXqnaqY9mUPGWM=; b=6PkcRr50yKFyDyYwydL+Xw5w17OIyBmMvF6MJ+BH7ynb5Ko4wHgy1NICqSeQSgqJfk rGyHymGZBHtfD9RP7sEZZKp9GrIGw0kwXb0XLefnvcnn1K91Xgmpzos3nzSGaLKBqk+T 6sX0wzeAx1pSO7CRC3WEb4y/Cl3U+4wE3Z5McYG7kA7dVjX3cl3ocThKsaCDKm+Bssru sinlUFdW3SE8I6DcRZJC/Hct5rDHGTlnFRxNAniiUvWzpnpswNCxt6vT24o204KEvp2l Se1SWpDLBqqhTDKzsS0pLlU46fPinUYjZKyLPpmwskuy0KEUqvkKruvGWmPEglRDdpYh cCXg== X-Gm-Message-State: AOAM5322lAS3uz2urMZVarNQwjTt9/E1od5oWiV9ihIOjxog4VuaYFaC iJAweKzvg/z1HKPsqBhSZoiB66+ge7PH+ZhUyLfQig== X-Google-Smtp-Source: ABdhPJxOj7vYECtub8AFvYDLyqKbiK8olDEqH4qD6lrtkB4BYw4A0Qtb1lzT7iOS4VKD4P/I0sFhAU7TudR05s7TJ5M= X-Received: by 2002:a25:4210:: with SMTP id p16mr12806660yba.242.1635518379366; Fri, 29 Oct 2021 07:39:39 -0700 (PDT) MIME-Version: 1.0 References: <20211023232635.9195-1-sjg@chromium.org> <20211023232635.9195-22-sjg@chromium.org> <20211029123907.GS8284@bill-the-cat> <20211029140315.GA81821@laputa> In-Reply-To: <20211029140315.GA81821@laputa> From: Ilias Apalodimas Date: Fri, 29 Oct 2021 17:39:03 +0300 Message-ID: Subject: Re: [PATCH v2 31/41] bootstd: Add an implementation of EFI boot To: AKASHI Takahiro , Ilias Apalodimas , Tom Rini , Simon Glass , U-Boot Mailing List , Michal Simek , Heinrich Schuchardt , Daniel Schwierzeck , Steffen Jaeckel , "Marek Beh??n" , Lukas Auer , Dennis Gilmore Content-Type: text/plain; charset="UTF-8" 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 Fri, 29 Oct 2021 at 17:03, AKASHI Takahiro wrote: > > On Fri, Oct 29, 2021 at 04:42:45PM +0300, Ilias Apalodimas wrote: > > Hi Tom, > > > > On Fri, 29 Oct 2021 at 15:39, Tom Rini wrote: > > > > > > On Fri, Oct 29, 2021 at 08:45:06AM +0300, Ilias Apalodimas wrote: > > > > On Wed, Oct 27, 2021 at 12:34:40PM -0600, Simon Glass wrote: > > > > > Hi Ilias, > > > > > > > > > > On Wed, 27 Oct 2021 at 08:48, Ilias Apalodimas > > > > > wrote: > > > > > > > > > > > > Hi Simon, > > > > > > > > > > > > On Wed, Oct 27, 2021 at 08:09:04AM -0600, Simon Glass wrote: > > > > > > > Hi Ilias, > > > > > > > > > > > > > > On Wed, 27 Oct 2021 at 02:36, Ilias Apalodimas > > > > > > > wrote: > > > > > > > > > > > > > > > > Hi Simon, > > > > > > > > > > > > > > > > On Sun, 24 Oct 2021 at 02:27, Simon Glass wrote: > > > > > > > > > > > > > > > > > > Add a bootmeth driver which handles EFI boot, using EFI_LOADER. > > > > > > > > > > > > > > > > > > In effect, this provides the same functionality as the 'bootefi' command > > > > > > > > > and shares the same code. But the interface into it is via a bootmeth, > > > > > > > > > so it does not require any special scripts, etc. > > > > > > > > > > > > > > > > > > For now this requires the 'bootefi' command be enabled. Future work may > > > > > > > > > tidy this up so that it can be used without CONFIG_CMDLINE being enabled. > > > > > > > > > > > > > > > > I'll leave this up to Heinrich, but personally I wouldn't include this > > > > > > > > patch at all. EFI has it's bootmgr which can handle booting just fine. > > > > > > > > I don't see why we should duplicate the functionality. The new boot > > > > > > > > method can just have an entry called 'EFI' and then let the existing > > > > > > > > EFI code to decide. > > > > > > > > > > > > > > This is needed so that EFI boot is actually invoked. If bootmgr starts > > > > > > > being used then it can still be invoked from standard boot. The point > > > > > > > is that there is a standard way of booting that supports EFI and other > > > > > > > things. > > > > > > > > > > > > This patch tries to reason about the default naming EFI imposes on it's > > > > > > boot files. distro_efi_read_bootflow() will try to find files following the > > > > > > EFI naming convention (e.g bootaarch64.efi, bootarm.efi etc). If those are > > > > > > found it will try to boot them right? That's not the right thing to do though. > > > > > > On the EFI spec these files are tried if no Boot#### variables are found. > > > > > > So we can get rid of this entirely, add a dummy entry on the bootflow that > > > > > > says 'boot the efi manager' (which is what the next patch does). > > > > > > > > > > > > The efibootmgr then will check Boot#### variables and if none are found, > > > > > > it's going to fallback into loading bootaarch64.efi, bootarm.efi etc > > > > > > essentially offering identical functionality. > > > > > > > > > > Yes that's fine, and when EFI's boot manager is in use I have a driver > > > > > for that too, as you can see in the other patch. We may need to adjust > > > > > the order, by the sound of it, if it needs to run before EFI things. > > > > > But that is easy enough. > > > > > > > > That's the point though. I don't want to have 2 different ways of booting EFI > > > > as I don't see any benefit. Do you? > > > > > > Unless we're saying that "bootefi bootmgr" is ready to be used always > > > and without further pre-req support (which I don't think is quite the > > > case, since we don't have persistent EFI vars, so can't set Boot### > > > persistently or via userspace) _something_ is likely needed to either > > > set those, or scan a configurable list of where, to find the EFI > > > payload. > > > > The efibootmgr will try to boot bootaa64.efi, bootarm.efi etc if > > Boot### variables are not found. > > To be clear, the current efibootmgr (or "bootefi bootmgr" command) > doesn't have this feature. Instead, distro_bootcmd mimics it in some way. > # I have an experimental patch to efibootmgr for the support, though. Ah thanks Akashi! I thought we had that already. In any case it makes much more sense adding that to efibootmgr, instead of inventing yet another way to do that, doesn't it? > > Nevertheless, > > > The Boot#### themselves are > > obviously configurable from U-Boot(at boot time). Since this method > > doesn't allow Linux to edit the boot options either,> > > Yeah. Please remember that, even on normal PCs, specifying an order of > boot devices (for "removable media" with the default path) is done > through UEFI UI. > > -Takahiro Akashi > > > is it something > > we need? Since distros usually name their SHIM as bootaa64.efi, I am > > afraid we are adding code that we will rarely (if at all) ever use. > > > > Regards > > > > > > /Ilias > > > > > > -- > > > Tom Regards /Ilias