[edk2] [PATCH 0/6] OvmfPkg, ArmVirtQemu: leaner platform BDS policy for connecting devices

Laszlo Ersek posted 6 patches 6 years, 9 months ago
Failed in applying to current master (apply log)
ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c |  12 +-
OvmfPkg/Include/Library/QemuBootOrderLib.h             |  41 ++++-
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c   |  16 +-
OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c    | 165 +++++++++++++++++++-
4 files changed, 218 insertions(+), 16 deletions(-)
[edk2] [PATCH 0/6] OvmfPkg, ArmVirtQemu: leaner platform BDS policy for connecting devices
Posted by Laszlo Ersek 6 years, 9 months ago
Repo:   https://github.com/lersek/edk2.git
Branch: qemu_bootorder_connect

Adding tens or hundreds of bootable devices to a QEMU VM config slows
the OVMF and ArmVirtQemu boots to a crawl, several people have reported
in the past.

There are at least two reasons for this (high pflash traffic due to
heavy nvvar massaging per device, and PCI config space access slowing
down on QEMU as the number of regions increases). However, part of the
pain is self-inflicted in our PlatformBootManagerLib instances: we
connect all bootable devices (for maximum compatibility with the user's
VM config) even if the user doesn't intend to boot off most of them.

It's oft repeated that the set of devices connected during boot is
platform policy, so this series replaces the culprit
EfiBootManagerConnectAll() calls with a bit smarter algorithm.

I sought to keep the commit messages under control.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Shannon Zhao <zhaoshenglong@huawei.com>
Cc: Xiang Zheng <xiang.zheng@linaro.org>

Thanks,
Laszlo

Laszlo Ersek (6):
  OvmfPkg/QemuBootOrderLib: wrap overlong line
  OvmfPkg/QemuBootOrderLib: add missing EFIAPI specifiers
  OvmfPkg/QemuBootOrderLib: clean up translation of virtio-net over MMIO
  OvmfPkg/QemuBootOrderLib: add ConnectDevicesFromQemu()
  OvmfPkg/PlatformBootManagerLib: minimize the set of connected devices
  ArmVirtPkg/PlatformBootManagerLib: minimize the set of connected
    devices

 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c |  12 +-
 OvmfPkg/Include/Library/QemuBootOrderLib.h             |  41 ++++-
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c   |  16 +-
 OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c    | 165 +++++++++++++++++++-
 4 files changed, 218 insertions(+), 16 deletions(-)

-- 
2.14.1.3.gb7cf6e02401b

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/6] OvmfPkg, ArmVirtQemu: leaner platform BDS policy for connecting devices
Posted by Ard Biesheuvel 6 years, 9 months ago
On 13 March 2018 at 21:22, Laszlo Ersek <lersek@redhat.com> wrote:
> Repo:   https://github.com/lersek/edk2.git
> Branch: qemu_bootorder_connect
>
> Adding tens or hundreds of bootable devices to a QEMU VM config slows
> the OVMF and ArmVirtQemu boots to a crawl, several people have reported
> in the past.
>
> There are at least two reasons for this (high pflash traffic due to
> heavy nvvar massaging per device, and PCI config space access slowing
> down on QEMU as the number of regions increases). However, part of the
> pain is self-inflicted in our PlatformBootManagerLib instances: we
> connect all bootable devices (for maximum compatibility with the user's
> VM config) even if the user doesn't intend to boot off most of them.
>
> It's oft repeated that the set of devices connected during boot is
> platform policy, so this series replaces the culprit
> EfiBootManagerConnectAll() calls with a bit smarter algorithm.
>
> I sought to keep the commit messages under control.
>

This is really nice. Most platforms I've worked with just connect
everything all the time, which is sloppy. I'm glad you fixed this for
*VMF

Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # ArmVirtQemu
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/6] OvmfPkg, ArmVirtQemu: leaner platform BDS policy for connecting devices
Posted by zhengxiang (A) 6 years, 9 months ago

On 2018/3/14 5:22, Laszlo Ersek wrote:
> Repo:   https://github.com/lersek/edk2.git
> Branch: qemu_bootorder_connect
> 
> Adding tens or hundreds of bootable devices to a QEMU VM config slows
> the OVMF and ArmVirtQemu boots to a crawl, several people have reported
> in the past.
> 
> There are at least two reasons for this (high pflash traffic due to
> heavy nvvar massaging per device, and PCI config space access slowing
> down on QEMU as the number of regions increases). However, part of the
> pain is self-inflicted in our PlatformBootManagerLib instances: we
> connect all bootable devices (for maximum compatibility with the user's
> VM config) even if the user doesn't intend to boot off most of them.
> 
> It's oft repeated that the set of devices connected during boot is
> platform policy, so this series replaces the culprit
> EfiBootManagerConnectAll() calls with a bit smarter algorithm.
> 
> I sought to keep the commit messages under control.
> 

Thanks, Laszlo! It works for booting QEMU VM with 60-virtio-scsi and
24-virtio-net on ARM64.
The boot time reduces from more than one hour to ~90 seconds.

Tested-by: Xiang Zheng <xiang.zheng@linaro.org>

Thanks,
Xiang

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/6] OvmfPkg, ArmVirtQemu: leaner platform BDS policy for connecting devices
Posted by Laszlo Ersek 6 years, 9 months ago
On 03/13/18 22:22, Laszlo Ersek wrote:
> Repo:   https://github.com/lersek/edk2.git
> Branch: qemu_bootorder_connect
> 
> Adding tens or hundreds of bootable devices to a QEMU VM config slows
> the OVMF and ArmVirtQemu boots to a crawl, several people have reported
> in the past.
> 
> There are at least two reasons for this (high pflash traffic due to
> heavy nvvar massaging per device, and PCI config space access slowing
> down on QEMU as the number of regions increases). However, part of the
> pain is self-inflicted in our PlatformBootManagerLib instances: we
> connect all bootable devices (for maximum compatibility with the user's
> VM config) even if the user doesn't intend to boot off most of them.
> 
> It's oft repeated that the set of devices connected during boot is
> platform policy, so this series replaces the culprit
> EfiBootManagerConnectAll() calls with a bit smarter algorithm.

Thanks everyone for the super quick feedback!

Commit range 12957e56d26d..ff1d0fbfbaec.

Cheers,
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel