From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Simon Glass <sjg@chromium.org>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
u-boot@lists.denx.de,
Masahisa Kojima <masahisa.kojima@linaro.org>
Subject: Re: [PATCH 0/4] introduce EFI_RAM_DISK_PROTOCOL
Date: Wed, 12 Jul 2023 08:41:29 +0200 [thread overview]
Message-ID: <886d92be-d917-2c75-e346-6682ec7eb69c@gmx.de> (raw)
In-Reply-To: <CAPnjgZ1u=dy6c5VEoAkZFvup3-aDE_S4O3UU1=mHtizVtoVKCA@mail.gmail.com>
On 7/11/23 21:13, Simon Glass wrote:
> Hi,
>
> On Tue, 11 Jul 2023 at 00:23, Masahisa Kojima
> <masahisa.kojima@linaro.org> wrote:
>>
>> On Mon, 10 Jul 2023 at 11:28, AKASHI Takahiro
>> <takahiro.akashi@linaro.org> wrote:
>>>
>>> On Mon, Jul 10, 2023 at 11:13:12AM +0900, Masahisa Kojima wrote:
>>>> On Fri, 7 Jul 2023 at 18:12, AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:
>>>>>
>>>>> On Fri, Jul 07, 2023 at 05:19:33PM +0900, Masahisa Kojima wrote:
>>>>>> Hi Akashi-san,
>>>>>>
>>>>>> On Fri, 7 Jul 2023 at 16:16, AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:
>>>>>>>
>>>>>>> On Fri, Jul 07, 2023 at 08:29:12AM +0200, Heinrich Schuchardt wrote:
>>>>>>>> On 7/7/23 06:00, Masahisa Kojima wrote:
>>>>>>>>> This series introduces the EFI_RAM_DISK_PROTOCOL implementation.
>>>>>>>>> The major purpose of this series is a preparation for EFI HTTP(S) boot.
>>>>>>>>>
>>>>>>>>> Now U-Boot can download the distro installer ISO image
>>>>>>>>> via wget or tftpboot commands, but U-Boot can not mount
>>>>>>>>> the downloaded ISO image.
>>>>>>>>> By calling EFI_RAM_DISK_PROTOCOL->register API, user can
>>>>>>>>> mount the ISO image and boot the distro installer.
>>>>>>>>
>>>>>>>> If I understand you correctly, with your design RAM disks will only
>>>>>>>> exist in the EFI sub-system.
>>>>>>>
>>>>>>> Probably, not. As Kojima-san's "dm tree" shows, there is a U-Boot
>>>>>>> block device (and associated partition devices) thanks to your
>>>>>>> efi_driver framework.
>>>>>>
>>>>>> Read/Write the RAM disk is expected to be called from the EFI context, so
>>>>>
>>>>> An associated U-Boot block device should work as well on top of your
>>>>> RAW_DISK_PROTOCOL via a generated RAM disk object (efi_disk).
>>>>> That is why SYMPLE_FILE_SYSTEM_PROTOCOL, which solely relies on U-Boot's proper
>>>>> filesystem subsystem, is installed to the RAM disk object.
>>>>
>>>> I now realize that my RAM_DISK_PROTOCOL implementation happens to work
>>>> thanks to the block cache.
>>>> When I disable CONFIG_BLOCK_CACHE and load some EFI application(it
>>>> does set 'app_gd')
>>>> before calling RAM_DISK_PROTOCOL service, RAM_DISK_PROTOCOL does not work.
>>>> ConnectController fails.
>>>>
>>>>>
>>>>>> native U-Boot can not access the RAM disk.
>>>>>
>>>>> I believe that, in theory, "fatls efidisk 0 1" (or efi_disk as an interface?)
>>>>> should work even under your current implementation.
>>>>
>>>> "fatls efiloader 0:2" does not work.
>>>> I think "efiloader" device is designed to be accessed from EFI application only
>>>> even if it is listed by "dm tree".
>>>
>>> I don't believe so.
>>> (the interface name may be "efi_blk" or "efiblk", though.)
>>>
>>> If the command fails, it's a bug. Must be fixed.
>>
>> "fatls efiloader 0:2" failed here:
>> https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/block/blk-uclass.c#L139
>>
>> This is because the parent is 'dm_root' for the device created by
>> lib/efi_driver/efi_block_device.c,
>> so uclass_id is different.
>
> The parent device of a UCLASS_BLK device MUST be a media uclass. It
> cannot be root. I believe EFI has some suitable classes.
>
> At some point we will remove the uclass_id from struct blk_desc and
> just use the parent's uclass ID.
Hello Simon,
we want to more tightly integrate EFI and DM.
If an EFI program like iPXE creates a handle for an iSCSI drive with the
block IO protocol the parent of that handle will be a network device and
nothing having to do with a block device.
Introducing dummy devices like you did for the sandbox host block
devices will only make integration of EFI and DM more complicated.
As I indicated years before you have to use blk_desc->uclass_id instead
of the parent uclass_id to identify block devices in
blk_get_devnum_by_uclass_idname() [1][2].
Removing class_id from struct blk_desc is a step against better future
integration of EFI and DM.
Best regards
Heinrich
[1]
https://lore.kernel.org/all/20221003093550.106304-1-heinrich.schuchardt@canonical.com/
[2]
https://lore.kernel.org/all/20220802094933.69170-1-heinrich.schuchardt@canonical.com/
next prev parent reply other threads:[~2023-07-12 6:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 4:00 [PATCH 0/4] introduce EFI_RAM_DISK_PROTOCOL Masahisa Kojima
2023-07-07 4:00 ` [PATCH 1/4] efi_loader: add RAM disk device path Masahisa Kojima
2023-07-07 4:00 ` [PATCH 2/4] efi_loader: add EFI_RAM_DISK_PROTOCOL implementation Masahisa Kojima
2023-07-07 4:00 ` [PATCH 3/4] cmd: efidebug: add RAM disk mount command Masahisa Kojima
2023-07-07 4:00 ` [PATCH 4/4] efi_selftest: add EFI_RAM_DISK_PROTOCOL selftest Masahisa Kojima
2023-07-07 5:17 ` [PATCH 0/4] introduce EFI_RAM_DISK_PROTOCOL AKASHI Takahiro
2023-07-07 6:29 ` Heinrich Schuchardt
2023-07-07 7:16 ` AKASHI Takahiro
2023-07-07 8:19 ` Masahisa Kojima
2023-07-07 9:12 ` AKASHI Takahiro
2023-07-10 2:13 ` Masahisa Kojima
2023-07-10 2:28 ` AKASHI Takahiro
2023-07-11 6:23 ` Masahisa Kojima
2023-07-11 19:13 ` Simon Glass
2023-07-12 6:41 ` Heinrich Schuchardt [this message]
2023-07-12 14:00 ` Simon Glass
2023-07-07 8:10 ` Masahisa Kojima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=886d92be-d917-2c75-e346-6682ec7eb69c@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=ilias.apalodimas@linaro.org \
--cc=masahisa.kojima@linaro.org \
--cc=sjg@chromium.org \
--cc=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox