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=-11.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 00901C35257 for ; Fri, 2 Oct 2020 17:55:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 845CA206DD for ; Fri, 2 Oct 2020 17:55:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="V41u6yxa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388358AbgJBRzu (ORCPT ); Fri, 2 Oct 2020 13:55:50 -0400 Received: from mout.gmx.net ([212.227.17.21]:56939 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbgJBRzu (ORCPT ); Fri, 2 Oct 2020 13:55:50 -0400 X-Greylist: delayed 305 seconds by postgrey-1.27 at vger.kernel.org; Fri, 02 Oct 2020 13:55:48 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601661347; bh=eL7JBhoz2JAsNQSLXLYFbl1LIBlnoiLRV7VFXGdcSh8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=V41u6yxajc7EQVyp3OOC23a8iT6HOGkTlqv0uIIc/0KpTuwpcdO+H/QaGsmXSZVHW DjeZCJ3RLjSLNVIq+Mnk2tp9tYoDKyzarOT8ybdG1Qb4jGYtJ6/kmhi7ubuOocDhzJ YIQPGpuMkp/UFlb6dnqCp5MB6Ta3yM3L554Qztbc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.70] ([178.202.41.107]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxDou-1kdskl2AJc-00xcR4; Fri, 02 Oct 2020 19:50:35 +0200 Subject: Re: [PATCH 1/1] docs: admin-guide: fdt and initrd load in EFI stub To: Ard Biesheuvel Cc: Jonathan Corbet , linux-efi , Linux Doc Mailing List , Linux Kernel Mailing List , =?UTF-8?Q?Fran=c3=a7ois_Ozog?= , Ilias Apalodimas References: <20201002171112.22738-1-xypron.glpk@gmx.de> From: Heinrich Schuchardt Autocrypt: addr=xypron.glpk@gmx.de; prefer-encrypt=mutual; keydata= mQINBE2g3goBEACaikqtClH8OarLlauqv9d9CPndgghjEmi3vvPZJi4jvgrhmIUKwl7q79wG IATxJ1UOXIGgriwoBwoHdooOK33QNy4hkjiNFNrtcaNT7uig+BG0g40AxSwVZ/OLmSFyEioO BmRqz1Zdo+AQ5RzHpu49ULlppgdSUYMYote8VPsRcE4Z8My/LLKmd7lvCn1kvcTGcOS1hyUC 4tMvfuloIehHX3tbcbw5UcQkg4IDh4l8XUc7lt2mdiyJwJoouyqezO3TJpkmkayS3L7o7dB5 AkUwntyY82tE6BU4quRVF6WJ8GH5gNn4y5m3TMDl135w27IIDd9Hv4Y5ycK5sEL3N+mjaWlk 2Sf6j1AOy3KNMHusXLgivPO8YKcL9GqtKRENpy7n+qWrvyHA9xV2QQiUDF13z85Sgy4Xi307 ex0GGrIo54EJXZBvwIDkufRyN9y0Ql7AdPyefOTDsGq5U4XTxh6xfsEXLESMDKQMiVMI74Ec cPYL8blzdkQc1MZJccU+zAr6yERkUwo1or14GC2WPG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yy2fF0Xq6Kyjx7msPj3XtDZQnhknBwA7mqSZ DDw0aNy1mlCv6KmJBRENfOIZBFUqXCtODPvO5TcduJV/5XuxbTR/33Zj7ez2uZkOEuTs/pPN oKMATC28qfg0qM59YjDrrkdXi/+iDe7qCX93XxdIxpA5YM/ZiqgwziJX8ZOKV7UDV+Ph5KwF lTPJMPdQZYXDOt5DjG5l5j0cQWqE05QtYR/V6g8un6V2PqOs9WzaT/RB12YFcaeWlusa8Iqs Eg== Message-ID: Date: Fri, 2 Oct 2020 19:50:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:rMYBeFJ6gKllVZl69fPnc4RDZH7lOvdbzwihXS6AWamAWUvSMEh A5o0rltp/6TNN0K3RdOA/C8iMzJImCxlMmyABNlcuL5gGfMhYQTaOtW6VyLrbaJj1L0k8lg 8qcEToKi8fBROiRk6+3N3CgzwEjrx/LCORVVDel/ZEaKlmmKX9vaIu9wy15Intbpvco7NzJ Cti/79uBsIzn8OrqvucvA== X-UI-Out-Filterresults: notjunk:1;V03:K0:APT0gqF5AtA=:94YK69IYJi901UJOjz1721 Dn6BDFNUr8okpeojJOBL4ymdoDNLOkfFJiEFCC2MPWHrMta28iTMOnBxpC8q8rKsj1TAAJ6F+ 8ZVi6yIZYAMgBDfDFst8rqRjL0OpuSu4BG3XQ9+rC21mQ5nbRwsJvk7oSuF6G+V1tgwaiKIgj 6pps7qp88T/IbOSyNhs+W7YDV/M2UCdEl8l5ND5eut/WnXBWMXM9cSn9K9ZlGm3ZNqQ9W2zSf N7Vx10nmk7GygEn3XUpfDrulJ/XQuodNTZvxlBiL4sIo/J854GeUwqeBWHxEUBKSWIW76x8ZW H5z6djIDVJ0/dKvQmX4MKXNA/EqB/KEDPgW+wiXHnEZQMy2ht+ECR3DXjNjpfLrI4M/m8WXN0 ywyKm+GoaqQjJm7FhRLUNo0/Rgy6jK82kgc+vO3QYmlbGKPb5Lb6XY1uiDWjDVvzGRRlsMslF Erj45UQT5C/i3Kb6t+RHrJKGzuA1bNUBy+umnJ6N7S71/502gxrG1V6RqW0ikFmwPDG71r/JM XcGMgpHD3dijxEc+yDXLyP44GKe4EoeBmKpAhnlKQ+gt/MHTuCUUu4TqBhXurMQpHnrr+jpB4 Ntf6BQXKRJaLU3cGlFaOP+FHKxsSKkjHbYdnnQNsjggjlZsbTPr6jlm3BXTYNTiWkui6EBmR5 o/79x2TLZETLvSbhQBWl+LV26Yz4MOkA+fuEM1/AD3Ma0HmAGxd8/roonmCtRfWZq/MBh4D4D zMsLCwhFLILOfGcIRDC0yaSHxAhuI42wTqMWbRFKaUCJgYfzyNrQGtqW504J+io0/k03SfvpT EgU5thtp6lVJJk/hYHx2XYaWy5O5ux/dMJ0OuA9xMqu4gwFZwZcOxbU4syZzzP9KPubRWiEV4 jnQqTsCjDOv5jzngNEE2VXWGW4EawR2M+3DmzDptxr3D3SaqzIUE4RQE2ZsM8XhUrmxiv3/Xn HuWW3LjXaDyDYAihYhBLf5Od4TGxzMEIB0HXkE36LCndunTDUi4k1a7OCRIXOS+W//L4jEKVz i4qEA6a96YY/UftjlBMkE5jQOUToV/8xsWnH2CWbGjIs7rDEpP0r244yb1b5+r97f8jrDj3H6 Asqc29nrpZOLRwC/KifWUxOy2CSkmtYpriBeyGBjgXjVXrwiNo5kElcZ1WLXmILLcUNz1Zzpa Ttd0rAawRWqteEqAACK5aD/DX5i8fxw8h8jZwKYp8MxETgDJBE3gfsv29Y90/JoLKgs8xO1h5 kp9qkxzTA6cmXbwzT8PGxfB+8teDW7TYdMezAag== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.10.20 19:21, Ard Biesheuvel wrote: > Hi Heinrich, > > Thanks for documenting this. > > > On Fri, 2 Oct 2020 at 19:11, Heinrich Schuchardt wr= ote: >> >> Describe how a device tree and an initial RAM disk can be passed to the= EFI >> Boot Stub. >> >> Signed-off-by: Heinrich Schuchardt >> --- >> Documentation/admin-guide/efi-stub.rst | 35 ++++++++++++++++++++++++++ >> 1 file changed, 35 insertions(+) >> >> diff --git a/Documentation/admin-guide/efi-stub.rst b/Documentation/adm= in-guide/efi-stub.rst >> index 833edb0d0bc4..86f50a33884c 100644 >> --- a/Documentation/admin-guide/efi-stub.rst >> +++ b/Documentation/admin-guide/efi-stub.rst >> @@ -38,6 +38,34 @@ arch/arm/boot/zImage should be copied to the system = partition, and it >> may not need to be renamed. Similarly for arm64, arch/arm64/boot/Image >> should be copied but not necessarily renamed. >> >> +Passing an initial RAM disk to the EFI Boot Stub >> +------------------------------------------------ >> + >> +The following means sorted by decreasing priority can be used to provi= de an >> +initial RAM disk to the EFI Boot Stub: >> + >> +* The firmware may provide a UEFI Load File 2 Protocol. The stub will = try to >> + load the RAM disk by calling the LoadFile() service of the protocol = using >> + a vendor device path with the vendor GUID >> + 5568e427-0x68fc-4f3d-ac74-ca555231cc68. >> +* Next the EFI stub will try to load the file indicated by the "initrd= =3D" command >> + line parameter. >> +* The prior boot stage may pass the location of the initial RAM disk v= ia the >> + "linux,initrd-start" and "linux,initrd-end" properties of the "/chos= en" node >> + of the device-tree. >> + > > On x86, the boot_params struct is used to pass the address and size of > the initrd in memory. Maybe include that for completeness? Sure we should add it. But I will just wait for more review comments. > >> +The first two items are inhibited by the "noinitrd" command line param= eter. >> + > > Interesting. Are you saying noinitrd is ignored by the kernel itself? > > Looking at the code, it might only work for preventing the load of old > style initrd ramdisks, whereas initramfs images are handled > separately. > > This is something that we should probably fix one way or the other. > initrd_load() seems to depend on the value and will not create /dev/ram if "noinitrd" is set. init/do_mounts_initrd.o is compiled for ARMv8. But my ARMv8 Odroid C2 boots fine via U-Boot->GRUB->EFI stub->Linux with: [ +0.000000] Kernel command line: BOOT_IMAGE=3D/vmlinuz-5.9.0-rc6-arm64+ root=3DUUID=3D.. ro earlycon=3Dmeson,0xc81004c0,115200n8 noinitrd So I assume initrd_load() is either not called or at least not needed for the FDT case. Best regards Heinrich > >> +Passing a device-tree to the EFI Boot Stub >> +------------------------------------------ >> + >> +A device-tree can be passed to the EFI Boot Stub in decreasing priorit= y using >> + >> +* command line option dtb=3D >> +* a UEFI configuration table with GUID b1b621d5-f19c-41a5-830b-d9152c6= 9aae0. >> + >> +The command line option is only available if CONFIG_EFI_ARMSTUB_DTB_LO= ADER=3Dy >> +and secure boot is disabled. >> >> Passing kernel parameters from the EFI shell >> -------------------------------------------- >> @@ -46,6 +74,10 @@ Arguments to the kernel can be passed after bzImage.= efi, e.g.:: >> >> fs0:> bzImage.efi console=3DttyS0 root=3D/dev/sda4 >> >> +The "noinitrd" option >> +--------------------- >> + >> +The "noinitrd" option stops the EFI stub from loading an initial RAM d= isk. >> >> The "initrd=3D" option >> -------------------- >> @@ -98,3 +130,6 @@ CONFIGURATION TABLE. >> >> "dtb=3D" is processed in the same manner as the "initrd=3D" option tha= t is >> described above. >> + >> +This option is only available if CONFIG_EFI_ARMSTUB_DTB_LOADER=3Dy and= secure >> +boot is disabled. >> -- >> 2.28.0 >>