From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx.groups.io with SMTP id smtpd.web10.22302.1628513628588656386 for ; Mon, 09 Aug 2021 05:53:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: linux.com, ip: 211.29.132.246, mailfrom: chris.willing@linux.com) Received: from d8.hgw.net.au (pa49-197-140-170.pa.qld.optusnet.com.au [49.197.140.170]) (Authenticated sender: chris.willing@optusnet.com.au) by mail104.syd.optusnet.com.au (Postfix) with ESMTPSA id 12CBC86728B; Mon, 9 Aug 2021 22:53:44 +1000 (AEST) Reply-To: chris.willing@linux.com Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg PlatformBootManagerLib: Move TryRunningQemuKernel() To: devel@edk2.groups.io References: <20210728020232.127332-1-chris.willing@linux.com> <1695D2E15A92C8E7.3876@groups.io> Cc: ardb+tianocore@kernel.org, jiewen.yao@intel.com, jiewen.yao@intel.com From: "Christoph Willing" Message-ID: <62f9ffa0-786f-09dd-9546-c4c118fa2a17@linux.com> Date: Mon, 9 Aug 2021 22:53:44 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <1695D2E15A92C8E7.3876@groups.io> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=Tu+Yewfh c=1 sm=1 tr=0 a=jHkrTDijwrxVdaLaom9wOA==:117 a=jHkrTDijwrxVdaLaom9wOA==:17 a=IkcTkHD0fZMA:10 a=hqBzw_eTAAAA:8 a=NufY4J3AAAAA:8 a=KkI8Y_4Yn56AUZJMm0sA:9 a=QEXdDO2ut3YA:10 a=bkWp_v3HvcftT6DRAIDL:22 a=TPcZfFuj8SYsoCJAFAiX:22 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit With soft feature freeze started, I wonder if this patch could be reviewed and pushed for edk2-stable202108 tag? I think it has languished because I didn't initially Cc appropriately - pls add others as necessary. This patch is a trivial (I think) change which fixes a long standing and annoying bug for those booting Qemu with UEFI using external kernel & initrd. Thanks, chris On 28/7/21 12:02 pm, Christoph Willing 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. > > 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 > --- > 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 (); > >