[PATCH 1/1] OvmfPkg PlatformBootManagerLib: Move TryRunningQemuKernel()


Christoph Willing
 

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3504

This change ensures that PlatformBdsConnectSequence() is run
before TryRunningQemuKernel().

It reverses commit a34a886962561f6d8550b2a1bb193798ca456431 which aimed
to improve UEFI boot time. Unfortunately that commit now results in boot
failure when using qemu's -kernel option, therefore rendering the -initrd
& -append options useless.

Such failures are seen in all releases from edk2-stable201808 to
edk2-stable202105 as well as the master branch.

The last releases which actually work correctly are vUDK2017 and vUDK2018
as they don't contain the a34a88 commit.

This change has been tested with edk2-stable201808, edk2-stable201811,
edk2-stable202105 as well as master (at 21/7/2021). It results in correct
booting using the -kernel option in all the test cases. No measurable
change in boot times was discernible compared with the unaffected vUDK2017
& vUDK2018 releases.

Signed-off-by: Christoph Willing <chris.willing@linux.com>
---
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg=
/Library/PlatformBootManagerLib/BdsPlatform.c
index b0e9742937..f08ace87b3 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -1517,14 +1517,14 @@ PlatformBootManagerAfterConsole (
Tcg2PhysicalPresenceLibProcessRequest (NULL);=0D
=0D
//=0D
- // Process QEMU's -kernel command line option=0D
+ // Perform some platform specific connect sequence=0D
//=0D
- TryRunningQemuKernel ();=0D
+ PlatformBdsConnectSequence ();=0D
=0D
//=0D
- // Perform some platform specific connect sequence=0D
+ // Process QEMU's -kernel command line option=0D
//=0D
- PlatformBdsConnectSequence ();=0D
+ TryRunningQemuKernel ();=0D
=0D
EfiBootManagerRefreshAllBootOption ();=0D
=0D
--=20
2.32.0


Ard Biesheuvel
 

On Wed, 28 Jul 2021 at 04:18, Christoph Willing <chris.willing@linux.com> wrote:

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3504

This change ensures that PlatformBdsConnectSequence() is run
before TryRunningQemuKernel().

It reverses commit a34a886962561f6d8550b2a1bb193798ca456431 which aimed
to improve UEFI boot time. Unfortunately that commit now results in boot
failure when using qemu's -kernel option, therefore rendering the -initrd
& -append options useless.

Such failures are seen in all releases from edk2-stable201808 to
edk2-stable202105 as well as the master branch.
Can we pinpoint the failure condition a bit more? I heavily rely on
-kernel for my local OVMF testing and other uses, and I am pretty sure
it hasn't been broken for 3 years.

So what else are you doing that triggers this failure? Is it related
to boot order, the type of devices, etc?


The last releases which actually work correctly are vUDK2017 and vUDK2018
as they don't contain the a34a88 commit.

This change has been tested with edk2-stable201808, edk2-stable201811,
edk2-stable202105 as well as master (at 21/7/2021). It results in correct
booting using the -kernel option in all the test cases. No measurable
change in boot times was discernible compared with the unaffected vUDK2017
& vUDK2018 releases.

Signed-off-by: Christoph Willing <chris.willing@linux.com>
---
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index b0e9742937..f08ace87b3 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -1517,14 +1517,14 @@ PlatformBootManagerAfterConsole (
Tcg2PhysicalPresenceLibProcessRequest (NULL);

//
- // Process QEMU's -kernel command line option
+ // Perform some platform specific connect sequence
//
- TryRunningQemuKernel ();
+ PlatformBdsConnectSequence ();

//
- // Perform some platform specific connect sequence
+ // Process QEMU's -kernel command line option
//
- PlatformBdsConnectSequence ();
+ TryRunningQemuKernel ();

EfiBootManagerRefreshAllBootOption ();

--
2.32.0



------------
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78261): https://edk2.groups.io/g/devel/message/78261
Mute This Topic: https://groups.io/mt/84497355/5717338
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [ardb+tianocore@kernel.org]
------------