qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Too slow edk2 bios boot?
@ 2021-06-18 10:46 Bin Meng
  2021-06-18 11:46 ` Gerd Hoffmann
  0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2021-06-18 10:46 UTC (permalink / raw)
  To: Laszlo Ersek, qemu-devel@nongnu.org Developers

Hi Laszlo,

Using the QEMU shipped edk2 bios, for i386, it boots very quickly to
the EFI shell.

$ qemu-system-i386 -nographic -pflash edk2-i386-code.fd

However with x86_64, it takes a very long time to boot to the EFI
shell. It seems it got stuck in the PXE boot. Any ideas?

$ qemu-system-x86_64 -nographic -pflash edk2-x86_64-code.fd

BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00003 " from
PciRoot(0x0)/Pci(0x1,0x1)/Ata(Secondary,Master,0x0): Not Found

>>Start PXE over IPv4.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0002 "UEFI PXEv4 (MAC:525400123456)" from
PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0):
Not Fd

>>Start PXE over IPv6.
  PXE-E16: No valid offer received.

I checked the boot manager, and it seems only 64-bit edk2 bios has
built-in PXE boot while 32-bit does not.

Any idea to speed up this whole PXE boot thing?

BTW it seems the shipped edk2 bios image does not work with QEMU
'-bios'. Only '-pflash' works.

Regards,
Bin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Too slow edk2 bios boot?
  2021-06-18 10:46 Too slow edk2 bios boot? Bin Meng
@ 2021-06-18 11:46 ` Gerd Hoffmann
  2021-06-18 13:06   ` Bin Meng
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2021-06-18 11:46 UTC (permalink / raw)
  To: Bin Meng; +Cc: Laszlo Ersek, qemu-devel@nongnu.org Developers

On Fri, Jun 18, 2021 at 06:46:57PM +0800, Bin Meng wrote:
> Hi Laszlo,
> 
> Using the QEMU shipped edk2 bios, for i386, it boots very quickly to
> the EFI shell.
> 
> $ qemu-system-i386 -nographic -pflash edk2-i386-code.fd
> 
> However with x86_64, it takes a very long time to boot to the EFI
> shell. It seems it got stuck in the PXE boot. Any ideas?

One year ago ia32 efi netboot support was dropped (and you are the first
who noticed 😎 ).

commit 9ed02fbb847277bef88dbe6a677cf3e5f39e5a38
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Wed Jul 22 12:24:35 2020 +0200

    ipxe: drop ia32 efi roms
    
    UEFI on ia32 never really took off.  Basically the BIOS -> UEFI shift
    came too late, x64 was widespread already, so vendors went from BIOS
    straight to UEFI on x64.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


> I checked the boot manager, and it seems only 64-bit edk2 bios has
> built-in PXE boot while 32-bit does not.

It isn't edk2 but the nic boot roms, but yes, lack of pxe support on
ia32 is the root cause.

> Any idea to speed up this whole PXE boot thing?

qemu -nic none ?

take care,
  Gerd



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Too slow edk2 bios boot?
  2021-06-18 11:46 ` Gerd Hoffmann
@ 2021-06-18 13:06   ` Bin Meng
  2021-06-22 16:13     ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2021-06-18 13:06 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Laszlo Ersek, qemu-devel@nongnu.org Developers

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

On Fri, Jun 18, 2021 at 7:46 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> On Fri, Jun 18, 2021 at 06:46:57PM +0800, Bin Meng wrote:
> > Hi Laszlo,
> >
> > Using the QEMU shipped edk2 bios, for i386, it boots very quickly to
> > the EFI shell.
> >
> > $ qemu-system-i386 -nographic -pflash edk2-i386-code.fd
> >
> > However with x86_64, it takes a very long time to boot to the EFI
> > shell. It seems it got stuck in the PXE boot. Any ideas?
>
> One year ago ia32 efi netboot support was dropped (and you are the first
> who noticed 😎 ).
>

I guess not many people play with ia32 these days :)


>
> commit 9ed02fbb847277bef88dbe6a677cf3e5f39e5a38
> Author: Gerd Hoffmann <kraxel@redhat.com>
> Date:   Wed Jul 22 12:24:35 2020 +0200
>
>     ipxe: drop ia32 efi roms
>
>     UEFI on ia32 never really took off.  Basically the BIOS -> UEFI shift
>     came too late, x64 was widespread already, so vendors went from BIOS
>     straight to UEFI on x64.
>
>     Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>
>
> > I checked the boot manager, and it seems only 64-bit edk2 bios has
> > built-in PXE boot while 32-bit does not.
>
> It isn't edk2 but the nic boot roms, but yes, lack of pxe support on
> ia32 is the root cause.
>

Got it.


> > Any idea to speed up this whole PXE boot thing?
>
> qemu -nic none ?
>

Yep this works. Thanks a lot!

Regards,
Bin

[-- Attachment #2: Type: text/html, Size: 2354 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Too slow edk2 bios boot?
  2021-06-18 13:06   ` Bin Meng
@ 2021-06-22 16:13     ` Laszlo Ersek
  2021-06-23  5:47       ` Bin Meng
  0 siblings, 1 reply; 6+ messages in thread
From: Laszlo Ersek @ 2021-06-22 16:13 UTC (permalink / raw)
  To: Bin Meng, Gerd Hoffmann; +Cc: qemu-devel@nongnu.org Developers

On 06/18/21 15:06, Bin Meng wrote:
> On Fri, Jun 18, 2021 at 7:46 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
>> On Fri, Jun 18, 2021 at 06:46:57PM +0800, Bin Meng wrote:
>>> Hi Laszlo,
>>>
>>> Using the QEMU shipped edk2 bios, for i386, it boots very quickly to
>>> the EFI shell.
>>>
>>> $ qemu-system-i386 -nographic -pflash edk2-i386-code.fd

Ouch. Don't do this. If you use just one pflash chip, then a unified FD file is expected in that chip, containing both varstore and firmware executable.

Upstream QEMU does not bundle / install unified FD files however. What it provides are separate executables and varstore *templates*.

If you don't want to create a permanent variable store file for your VM, from the template called "edk2-i386-vars.fd", then the minimum command line is something like this:

qemu-system-i386 \
  -drive if=pflash,unit=0,format=raw,readonly=on,file=edk2-i386-code.fd \
  -drive if=pflash,unit=1,format=raw,snapshot=on,file=edk2-i386-vars.fd \

(Nowadays I should use the "blockdev" syntax instead of "-drive", but I've not updated my scripts thus far ;))


>>>
>>> However with x86_64, it takes a very long time to boot to the EFI
>>> shell. It seems it got stuck in the PXE boot. Any ideas?
>>
>> One year ago ia32 efi netboot support was dropped (and you are the first
>> who noticed 😎 ).

I certainly noticed:

http://mid.mail-archive.com/e6078611-789f-027b-bea5-759e02b10eee@redhat.com


>>
> 
> I guess not many people play with ia32 these days :)
> 
> 
>>
>> commit 9ed02fbb847277bef88dbe6a677cf3e5f39e5a38
>> Author: Gerd Hoffmann <kraxel@redhat.com>
>> Date:   Wed Jul 22 12:24:35 2020 +0200
>>
>>     ipxe: drop ia32 efi roms
>>
>>     UEFI on ia32 never really took off.  Basically the BIOS -> UEFI shift
>>     came too late, x64 was widespread already, so vendors went from BIOS
>>     straight to UEFI on x64.
>>
>>     Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>>
>>
>>> I checked the boot manager, and it seems only 64-bit edk2 bios has
>>> built-in PXE boot while 32-bit does not.
>>
>> It isn't edk2 but the nic boot roms, but yes, lack of pxe support on
>> ia32 is the root cause.
>>
> 
> Got it.
> 
> 
>>> Any idea to speed up this whole PXE boot thing?
>>
>> qemu -nic none ?
>>
> 
> Yep this works. Thanks a lot!

If you need neither NICs nor disks in your guest at all, then "-nic none" is indeed the simplest solution.

Thanks,
Laszlo



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Too slow edk2 bios boot?
  2021-06-22 16:13     ` Laszlo Ersek
@ 2021-06-23  5:47       ` Bin Meng
  2021-06-23 15:23         ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2021-06-23  5:47 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Gerd Hoffmann, qemu-devel@nongnu.org Developers

[-- Attachment #1: Type: text/plain, Size: 2951 bytes --]

Hi Laszlo,

On Wed, Jun 23, 2021 at 12:13 AM Laszlo Ersek <lersek@redhat.com> wrote:

> On 06/18/21 15:06, Bin Meng wrote:
> > On Fri, Jun 18, 2021 at 7:46 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> >> On Fri, Jun 18, 2021 at 06:46:57PM +0800, Bin Meng wrote:
> >>> Hi Laszlo,
> >>>
> >>> Using the QEMU shipped edk2 bios, for i386, it boots very quickly to
> >>> the EFI shell.
> >>>
> >>> $ qemu-system-i386 -nographic -pflash edk2-i386-code.fd
>
> Ouch. Don't do this. If you use just one pflash chip, then a unified FD
> file is expected in that chip, containing both varstore and firmware
> executable.
>
> Upstream QEMU does not bundle / install unified FD files however. What it
> provides are separate executables and varstore *templates*.
>
> If you don't want to create a permanent variable store file for your VM,
> from the template called "edk2-i386-vars.fd", then the minimum command line
> is something like this:
>
> qemu-system-i386 \
>   -drive if=pflash,unit=0,format=raw,readonly=on,file=edk2-i386-code.fd \
>   -drive if=pflash,unit=1,format=raw,snapshot=on,file=edk2-i386-vars.fd \
>
> (Nowadays I should use the "blockdev" syntax instead of "-drive", but I've
> not updated my scripts thus far ;))
>

Thank you. I suggest we document this in the QEMU documentation [1]


> >>>
> >>> However with x86_64, it takes a very long time to boot to the EFI
> >>> shell. It seems it got stuck in the PXE boot. Any ideas?
> >>
> >> One year ago ia32 efi netboot support was dropped (and you are the first
> >> who noticed 😎 ).
>
> I certainly noticed:
>
> http://mid.mail-archive.com/e6078611-789f-027b-bea5-759e02b10eee@redhat.com
>
>
> >>
> >
> > I guess not many people play with ia32 these days :)
> >
> >
> >>
> >> commit 9ed02fbb847277bef88dbe6a677cf3e5f39e5a38
> >> Author: Gerd Hoffmann <kraxel@redhat.com>
> >> Date:   Wed Jul 22 12:24:35 2020 +0200
> >>
> >>     ipxe: drop ia32 efi roms
> >>
> >>     UEFI on ia32 never really took off.  Basically the BIOS -> UEFI
> shift
> >>     came too late, x64 was widespread already, so vendors went from BIOS
> >>     straight to UEFI on x64.
> >>
> >>     Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> >>
> >>
> >>> I checked the boot manager, and it seems only 64-bit edk2 bios has
> >>> built-in PXE boot while 32-bit does not.
> >>
> >> It isn't edk2 but the nic boot roms, but yes, lack of pxe support on
> >> ia32 is the root cause.
> >>
> >
> > Got it.
> >
> >
> >>> Any idea to speed up this whole PXE boot thing?
> >>
> >> qemu -nic none ?
> >>
> >
> > Yep this works. Thanks a lot!
>
> If you need neither NICs nor disks in your guest at all, then "-nic none"
> is indeed the simplest solution.
>

If using NICs in the guest, then we have to adjust the order in the BIOS
boot menu?

[1] https://qemu.readthedocs.io/en/latest/system/target-i386.html

Regards,
Bin

[-- Attachment #2: Type: text/html, Size: 4383 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Too slow edk2 bios boot?
  2021-06-23  5:47       ` Bin Meng
@ 2021-06-23 15:23         ` Laszlo Ersek
  0 siblings, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2021-06-23 15:23 UTC (permalink / raw)
  To: Bin Meng; +Cc: Gerd Hoffmann, qemu-devel@nongnu.org Developers

On 06/23/21 07:47, Bin Meng wrote:
> Hi Laszlo,
> 
> On Wed, Jun 23, 2021 at 12:13 AM Laszlo Ersek <lersek@redhat.com> wrote:
> 
>> On 06/18/21 15:06, Bin Meng wrote:
>>> On Fri, Jun 18, 2021 at 7:46 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>>>
>>>> On Fri, Jun 18, 2021 at 06:46:57PM +0800, Bin Meng wrote:
>>>>> Hi Laszlo,
>>>>>
>>>>> Using the QEMU shipped edk2 bios, for i386, it boots very quickly to
>>>>> the EFI shell.
>>>>>
>>>>> $ qemu-system-i386 -nographic -pflash edk2-i386-code.fd
>>
>> Ouch. Don't do this. If you use just one pflash chip, then a unified FD
>> file is expected in that chip, containing both varstore and firmware
>> executable.
>>
>> Upstream QEMU does not bundle / install unified FD files however. What it
>> provides are separate executables and varstore *templates*.
>>
>> If you don't want to create a permanent variable store file for your VM,
>> from the template called "edk2-i386-vars.fd", then the minimum command line
>> is something like this:
>>
>> qemu-system-i386 \
>>   -drive if=pflash,unit=0,format=raw,readonly=on,file=edk2-i386-code.fd \
>>   -drive if=pflash,unit=1,format=raw,snapshot=on,file=edk2-i386-vars.fd \
>>
>> (Nowadays I should use the "blockdev" syntax instead of "-drive", but I've
>> not updated my scripts thus far ;))
>>
> 
> Thank you. I suggest we document this in the QEMU documentation [1]

Already documented in "docs/interop/firmware.json".

>>>> qemu -nic none ?
>>>>
>>>
>>> Yep this works. Thanks a lot!
>>
>> If you need neither NICs nor disks in your guest at all, then "-nic none"
>> is indeed the simplest solution.
>>
> 
> If using NICs in the guest, then we have to adjust the order in the BIOS
> boot menu?

No; assuming you have a device (NIC or disk) you'd like to boot off of,
and a NIC you wouldn't, specify the "bootindex" device property for the
devices in the first category (with the desired decimal indices), and
omit the "bootindex" device property for the devices in the second category.

Thanks
Laszlo



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-23 15:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 10:46 Too slow edk2 bios boot? Bin Meng
2021-06-18 11:46 ` Gerd Hoffmann
2021-06-18 13:06   ` Bin Meng
2021-06-22 16:13     ` Laszlo Ersek
2021-06-23  5:47       ` Bin Meng
2021-06-23 15:23         ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).