audk/OvmfPkg/Include/Library
Laszlo Ersek 51bd1f7699 OvmfPkg/QemuBootOrderLib: add ConnectDevicesFromQemu()
QemuBootOrderLib expects PlatformBootManagerLib to call the following
triplet:

(1) EfiBootManagerConnectAll(),
(2) EfiBootManagerRefreshAllBootOption(),
(3) SetBootOrderFromQemu().

This leads to bad performance, when many devices exist such that the
firmware can drive them, but they aren't marked for booting in the
"bootorder" fw_cfg file. Namely,

(1) EfiBootManagerConnectAll() talks to all hardware, which takes long.
    Plus some DriverBindingStart() functions write NV variables, which is
    also slow. (For example, the IP config policy for each NIC is stored
    in an NV var that is named after the MAC).

(2) EfiBootManagerRefreshAllBootOption() generates boot options from the
    protocol instances produced by (1). Writing boot options is slow.

(3) Under the above circumstances, SetBootOrderFromQemu() removes most of
    the boot options produced by (2). Erasing boot options is slow.

Introduce ConnectDevicesFromQemu() as a replacement for (1): only connect
devices that the QEMU user actually wants to boot off of.

(There's a slight loss of compatibility when a platform switches from
EfiBootManagerConnectAll() to ConnectDevicesFromQemu().
EfiBootManagerConnectAll() may produce UEFI device paths that are unknown
to QemuBootOrderLib (that is, for neither PCI- nor virtio-mmio-based
devices). The BootOrderComplete() function lets such unmatched boot
options survive at the end of the boot order. With
ConnectDevicesFromQemu(), these options will not be auto-generated in the
first place. They may still be produced by other means.

SetBootOrderFromQemu() is not modified in any way; reordering+filtering
boot options remains a separate task.)

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>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # ArmVirtQemu
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Xiang Zheng <xiang.zheng@linaro.org>
2018-03-14 11:24:24 +01:00
..
LoadLinuxLib.h OvmfPkg: Fix typing errors in header files 2016-09-13 14:14:31 +02:00
MemEncryptSevLib.h OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map 2018-03-06 13:30:30 +01:00
NvVarsFileLib.h Update the copyright notice format 2010-04-28 12:43:04 +00:00
PlatformFvbLib.h OvmfPkg EMU FVB: Add 2 functions to PlatformFvbLib 2011-01-09 03:51:16 +00:00
QemuBootOrderLib.h OvmfPkg/QemuBootOrderLib: add ConnectDevicesFromQemu() 2018-03-14 11:24:24 +01:00
QemuFwCfgLib.h ArmVirtPkg, OvmfPkg: retire QemuFwCfgS3Enabled() from QemuFwCfgLib 2017-03-14 21:49:16 +01:00
QemuFwCfgS3Lib.h OvmfPkg/QemuFwCfgS3Lib: Fix VS tool chain build failure 2017-03-15 21:18:40 -07:00
SerializeVariablesLib.h OvmfPkg: Add SerializeVariablesLib library class 2011-01-30 19:49:37 +00:00
VirtioLib.h OvmfPkg/VirtioLib: change the parameter of VirtioAppendDesc() to UINT64 2017-08-25 10:42:19 +02:00
VirtioMmioDeviceLib.h OvmfPkg/VirtioMmioDeviceLib: Implement VIRTIO_DEVICE_PROTOCOL for VirtIo Devices over MMIO 2013-12-11 16:57:59 +00:00
XenHypercallLib.h OvmfPkg/XenHypercallLib: Add EFIAPI 2016-12-06 18:00:32 +01:00
XenIoMmioLib.h ArmVirtualizationPkg: add XenIoMmioLib 2015-02-28 20:34:16 +00:00