[edk2-devel] [PATCH 1/1] MdeModulePkg: Optimize BmExpandPartitionDevicePath

Laszlo Ersek lersek at redhat.com
Thu Oct 12 15:14:27 UTC 2023


On 10/11/23 19:36, Aaron Young wrote:
> 
>  Thanks for the comments, Laszlo.
> 
>  I could look into optimizing SetBootOrderFromQemu()->Match() by using
>  EfiBootManagerGetNextLoadOptionDevicePath() instead of
> EfiBootManagerGetLoadOptionBuffer().
>  Makes sense to me and at first glance seems like it would work. My main
> concern is some
>  unforeseen change in behavior that manifests in a regression somehow.
> Would require lots
>  of testing beyond what I am capable of doing.

Yes, this is exactly my concern as well.
EfiBootManagerGetLoadOptionBuffer() contains an internal loop around
EfiBootManagerGetNextLoadOptionDevicePath(), and some short form -->
long form expansions that succeed right now may depend on that loop. If
we just replace the current call to EfiBootManagerGetLoadOptionBuffer()
without repeating the same loop, we could regress things.

>  However, I'd prefer to do this as a separate task from this PR as it's
> not really
>  related, right? i.e. EfiBootManagerGetNextLoadOptionDevicePath() still
> ends up
>  calling ConnectAll. just making sure I understand.

Sure, this is totally unrelated. And, it's not a functional issue, just
an opportunity for some slight optimization (at the risk of a functional
regression, of course). So definitely don't get into it without proper
time allocation.

That's why I'm not doing it myself either! I just thought that you might
be able to consider it, given that you're looking at
BmExpandPartitionDevicePath() already. But, certainly feel free to
ignore it.

Basically I wish UefiBootManagerLib offered an interface that did *all*
of what EfiBootManagerGetLoadOptionBuffer() does, except loading the
file contents. But extending UefiBootManagerLib with new interfaces is
difficult.

> 
>  Also, I can look into amending the PR commit to add the call chain for
> ConnectDevicesFromQemu
>  that you menioned above.

That would be welcome.

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109575): https://edk2.groups.io/g/devel/message/109575
Mute This Topic: https://groups.io/mt/101876973/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list