summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library
AgeCommit message (Collapse)AuthorFilesLines
2016-05-27OvmfPkg/PlatformBootManagerLib: keep the logo after connecting devicesLaszlo Ersek1-5/+0
OVMF (unlike ArmVirtPkg) has traditionally cleared the screen after connecting devices. This is not really necessary, and keeping the logo up while the progress bar is advancing at the bottom looks great. So don't clear the screen. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27OvmfPkg/PlatformBootManagerLib: bring back the progress barLaszlo Ersek1-0/+17
OVMF's Platform BDS used to have a nice progress bar (with IntelFrameworkModulePkg BDS). We can restore it by copying the PlatformBootManagerWaitCallback() function verbatim from Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c It can be tested by passing the following option to QEMU (5 seconds): -boot menu=on,splash-time=5000 Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-27OvmfPkg/PlatformBootManagerLib: rebase boot logo display to BootLogoLibLaszlo Ersek4-712/+9
In the course of porting OvmfPkg to the MdeModulePkg BDS, commit 817fb3ac2a78 OvmfPkg/PlatformBootManagerLib: Add EnableQuietBoot & DisableQuietBoot open-coded the EnableQuietBoot() function (and its dependencies / friends) from IntelFrameworkModulePkg BDS. This code duplication can be avoided; the functionality is available from the following three libraries in MdeModulePkg: - BootLogoLib: provides the BootLogoEnableLogo() function. It does not provide the internal ConvertBmpToGopBlt() function -- that one is delegated to ImageDecoderLib (function DecodeImage()). - ImageDecoderLib: a general library that registers decoder plugins for specific image formats, and provides the generic DecodeImage() on top. - BmpImageDecoderLib: one of said decoder plugins, for handling BMP images (which is the format of our logo). In this patch, we revert 817fb3ac2a78, and atomically incorporate the above libraries. This is inspired by Nt32Pkg commit 859e75c4fc42: Nt32Pkg: Use BootLogoLib for logo and progress bar drawing. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-26OvmfPkg/SerializeVariablesLib: Relax check for the read-only variableGary Lin1-0/+5
When OVMF tried to restore the variables from the file-based NvVars, it failed to set the read-only variable and aborted the restoration with this message: Variable Check ReadOnly variable fail Write Protected - 04B37FE8-F6AE-480B-BDD5-37D98C5E89AA:VarErrorFlag Since it's a read-only variable maintained by the firmware, it's pointless to restore the previous value, so the check can be relaxed to allow EFI_WRITE_PROTECTED returned from SetVariable. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-26OvmfPkg/SerializeVariablesLib: convert line endings to uniform CRLFLaszlo Ersek2-889/+889
"SerializeVariablesLib.h" is pure LF, while "SerializeVariablesLib.c" is mixed (its only CRLF terminators are from commit e678f9db899ad). Convert them both with "unix2dos". "git show -b" produces no code hunks for this patch. Due to its simple and mechanic nature (and because it blocks the application of another patch), it's being committed without review. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2016-05-25OvmfPkg, ArmVirtPkg: rename QemuNewBootOrderLib to QemuBootOrderLibLaszlo Ersek4-1/+1
This completes the transition to the new BDS. The FILE_GUID in "QemuBootOrderLib.inf" is intentionally not changed. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-25OvmfPkg, ArmVirtPkg: clean up SetBootOrderFromQemu() parameter listLaszlo Ersek2-16/+6
With OvmfPkg's original QemuBootOrderLib (and USE_OLD_BDS) gone, we no longer need the BootOptionList parameter in the SetBootOrderFromQemu() prototype. Update the library class header file (including the function's documentation), and adapt the library instance and the call sites. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-25OvmfPkg: remove QemuBootOrderLib instanceLaszlo Ersek4-2312/+0
This library instance is no longer referenced. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-25OvmfPkg: remove PlatformBdsLib instanceLaszlo Ersek5-2178/+0
This library instance is no longer referenced. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-17OvmfPkg: determine PMBA value dependent on host bridge device IDLaszlo Ersek3-4/+34
In this patch, the AcpiTimerLib instances, ResetSystemLib, and PlatformPei are modified together in order to keep VMs functional across a bisection: they all must agree on the PMBA value used. ResetSystemLib must not use dynamic PCDs. With SOURCE_DEBUG_ENABLE, it gets linked into the debug agent, therefore the same restrictions apply to it as to BaseRomAcpiTimerLib. Luckily, AcpiPmControl() is only used for powering off the virtual machine, thus the extra cost of a PCI config space read, compared to a PcdGet16(), should be negligible. This is the patch that moves the PMBA to IO port 0x0600 on Q35 in practice. The ResetSystemLib change is easiest to verify with the "reset -s" command in the UEFI shell (which goes through gRT->ResetSystem() and, in OVMF, PcAtChipsetPkg/KbcResetDxe). Cc: Gabriel Somlo <somlo@cmu.edu> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1333238 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Gabriel Somlo <somlo@cmu.edu>
2016-05-17OvmfPkg: add and use industry standard macro PIIX4_PMBA_MASKLaszlo Ersek2-2/+2
We already have the identical purpose (but different value) macro for ICH9, namely ICH9_PMBASE_MASK in "OvmfPkg/Include/IndustryStandard/Q35MchIch9.h". Also, stop bit-negating signed integer constants. Cc: Gabriel Somlo <somlo@cmu.edu> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1333238 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Gabriel Somlo <somlo@cmu.edu>
2016-05-17OvmfPkg: replace PcdAcpiPmBaseAddress with PIIX4_PMBA_VALUELaszlo Ersek6-18/+8
In the next patches, we'll differentiate the PMBA IO port address that we program on PIIX4 vs. Q35. Normally we'd just turn PcdAcpiPmBaseAddress into a dynamic PCD. However, because we need this value in BaseRomAcpiTimerLib too (which cannot access RAM and dynamic PCDs), it must remain a build time constant. We will introduce its Q35 counterpart later. As first step, replace the PCD with a new macro in "OvmfPlatforms.h"; Jordan prefers the latter to fixed PCDs in this instance. Cc: Gabriel Somlo <somlo@cmu.edu> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1333238 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Gabriel Somlo <somlo@cmu.edu>
2016-05-17OvmfPkg/AcpiTimerLib: don't use possibly unset PMBA register (PEI phase)Laszlo Ersek1-2/+1
We should store the right value to the PMBA (if the PMBA needs initialization) before setting mAcpiTimerIoAddr from the PMBA. Cc: Gabriel Somlo <somlo@cmu.edu> Cc: Jordan Justen <jordan.l.justen@intel.com> Fixes: f122712b42af3d63902c2c141e90d2c200df6790 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Gabriel Somlo <somlo@cmu.edu>
2016-05-12OvmfPkg/PlatformBootManagerLib: Postpone the shell registrationGary Lin1-6/+7
We currently register the shell before creating the boot options for the block devices and the network devices, so the boot manager boots into the internal shell if the user doesn't specify the boot order. However, Xen doesn't support fw_cfg, so there is no way to change the boot order with the external command, and the firmware will always boot into the internal shell if the user doesn't interfere the boot process. This patch postpones the shell registration after MdeModulePkg/BDS creates all the boot options for the block and network devices, so that firmware will try to boot the block/network devices first. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-05-12OvmfPkg/QemuBootOrderLib: adapt Q35 SATA PMPN to UEFI spec Mantis 1353Laszlo Ersek1-5/+5
On the Q35 machine type of QEMU, there is no port multiplier connected to the on-board SATA controller. Therefore the AtaAtapiPassThru driver update for Mantis ticket 1353 <https://mantis.uefi.org/mantis/view.php?id=1353> changes the middle number (the Port Multiplier Port Number) in the Sata() device path nodes from 0x0 to 0xFFFF. Adapt the translation from OpenFirmware in QemuBootOrderLib. (Note: QemuBootOrderLib is deprecated at this point (see USE_OLD_BDS in the DSC files), but until we remove it, it should be kept in sync with QemuNewBootOrderLib.) Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-12OvmfPkg/QemuNewBootOrderLib: adapt Q35 SATA PMPN to UEFI spec Mantis 1353Laszlo Ersek1-5/+5
On the Q35 machine type of QEMU, there is no port multiplier connected to the on-board SATA controller. Therefore the AtaAtapiPassThru driver update for Mantis ticket 1353 <https://mantis.uefi.org/mantis/view.php?id=1353> changes the middle number (the Port Multiplier Port Number) in the Sata() device path nodes from 0x0 to 0xFFFF. Adapt the translation from OpenFirmware in QemuNewBootOrderLib. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-11OvmfPkg/PciHostBridgeLib: Scan for root bridges when running over XenRuiyu Ni4-1/+539
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Gary Lin <glin@suse.com>
2016-05-11OvmfPkg/PciHostBridgeLib: Change InitRootBridge prototypeRuiyu Ni1-38/+93
The patch re-factors the code without functionality impact. Next patch will add code to support OVMF above Xen. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-11OvmfPkg/PciHostBridgeLib: Set correct Base/Limit for absent resourceRuiyu Ni1-3/+3
In order to match the previous commit, Base must be strictly larger than Limit if some type of aperture is not available on a PCI root bridge. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Remove unused C structures definitionsRuiyu Ni1-47/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Fix gcc-4.8 Ia32 build failureRuiyu Ni1-0/+2
The Width and Height assignment suppresses an invalid gcc-4.8 warning on Ia32. These warnings look unjustified to me. Namely, near the beginning of the function, there is a while(1) loop. In that loop, ConvertBmpToGopBlt() is called unconditionally. If the call fails, the rest of the loop body is not reached (where the Height and Width variables are used -- the compiler warns about their use in the switch statement). If the call succeeds, then the variables are set. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Add EnableQuietBoot & DisableQuietBootRuiyu Ni3-0/+709
EnableQuietBoot and DisableQuietBoot are copied from IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c. Because these two functions are not in UefiBootManagerLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Remove unused vars and func prototypesRuiyu Ni2-53/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Remove unnecessary memory testRuiyu Ni2-63/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Use GetBootModeHob() in HobLibRuiyu Ni1-2/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Remove PlatformBdsGetDriverOption()Ruiyu Ni2-36/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Use EfiBootManagerRefreshAllBootOption()Ruiyu Ni2-8/+4
The patch uses EfiBootManagerRefreshAllBootOption() to collect all boot options and uses SetBootOrderFromQemu exposed by QemuNewBootOrderLib to adjust the boot option order. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: port PlatformBdsConnectSequence to ↵Ruiyu Ni1-6/+3
UefiBootManagerLib The patch changes PlatformBdsConnectSequence() to use library API exposed from UefiBootManagerLib and removes the additional connect ALL action. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Remove unused local functions.Ruiyu Ni1-94/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Register boot options and hot keysRuiyu Ni3-0/+110
The patch registers "Enter" key as the continue key (hot key to skip the boot timeout wait), maps "F2" key to UI, and registers Shell boot option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Do not launch Boot Manager MenuRuiyu Ni3-8/+2
MdeModulePkg/BDS doesn't launch UI (Boot Manager Menu) from platform side. The change removes the code which launches the UI but still set the boot timeout. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Init console vars in *BeforeConsole()Ruiyu Ni3-109/+21
The major difference between IntelFrameworkModulePkg/BDS and MdeModulePkg/BDS is the latter connects the consoles in core code while the former connects in platform code. The change initializes the console variables in PlatformBootManagerBeforeConsole() and removes the console connection code. It also removes unused functions: PlatformBdsNoConsoleAction() and LockKeyboards(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Use ConvertDevicePathToText()Ruiyu Ni2-3/+4
The DevicePathToStr() function (in "IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c") is a simple wrapper around ConvertDevicePathToText(). DevicePathToStr() passes DisplayOnly=TRUE and AllowShortcuts=TRUE to ConvertDevicePathToText(), whereas in this patch, both parameters are flipped to FALSE. The formatted devpaths are used only for debugging purposes, so this change is safe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: link to UefiBootManagerLibRuiyu Ni2-2/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariableRuiyu Ni1-16/+16
Call EfiBootManagerUpdateConsoleVariable in UefiBootManagerLib instead of BdsLibUpdateConsoleVariable in GenericBdsLib. Still cannot pass build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/PlatformBootManagerLib: Follow PlatformBootManagerLib interfacesRuiyu Ni3-27/+22
Change the function name to follow new library class PlatformBootManagerLib interfaces. NOTE: There is no progress bar during BDS timeout waiting. In order to show the progress bar, PlatformBootManagerWaitCallback () needs to change to draw it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg: Duplicate PlatformBdsLib to PlatformBootManagerLibRuiyu Ni5-0/+2178
It will be changed to build with MdeModulePkg/BDS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg/QemuNewBootOrderLib: Build with UefiBootManagerLibRuiyu Ni2-51/+114
NOTE: SetBootOrderFromQemu() interface is not changed. But when the old IntelFrameworkModulePkg/BDS is no longer used in OVMF and ArmVirtPkg, additional patch will be submitted to change this interface to remove parameter BootOptionList. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04OvmfPkg: Duplicate QemuBootOrderLib to QemuNewBootOrderLibRuiyu Ni4-0/+2312
QemuNewBootOrderLib will be changed to work with MdeModulePkg/BDS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-28OvmfPkg: PlatformBdsLib: lock down SMM regardless of S3Laszlo Ersek1-13/+16
At the moment, the EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is only installed if S3 is enabled -- at the end of SaveS3BootScript(). While a runtime OS is never booted with SMM unlocked (because the SMM IPL locks down SMM as a last resort: > SMM IPL! DXE SMM Ready To Lock Protocol not installed before Ready To > Boot signal > SmmInstallProtocolInterface: [EfiSmmReadyToLockProtocol] 0 > Patch page table start ... > Patch page table done! > SMM IPL locked SMRAM window ), we shouldn't allow UEFI drivers and applications either to mess with SMM just because S3 is disabled. So install EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL in PlatformBdsInit() unconditionally. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-04-28OvmfPkg: PlatformBdsLib: lock down SMM in PlatformBdsInit()Laszlo Ersek1-25/+39
OVMF's PlatformBdsLib currently makes SMM vulnerable to the following attack: (1) a malicious guest OS copies a UEFI driver module to the EFI system partition, (2) the OS adds the driver as a Driver#### option, and references it from DriverOrder, (3) at next boot, the BdsEntry() function in "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" processes Driver#### and DriverOrder between the calls to PlatformBdsInit() and PlatformBdsPolicyBehavior(), (4) OVMF locks down SMM only in PlatformBdsPolicyBehavior(), hence the driver runs with SMM unlocked. The BdsEntry() function of the MdeModulePkg BDS driver (in file "MdeModulePkg/Universal/BdsDxe/BdsEntry.c") recommends to "Signal ReadyToLock event" in PlatformBootManagerBeforeConsole() -- which corresponds to PlatformBdsInit() --, not in PlatformBootManagerAfterConsole() -- which corresponds to PlatformBdsPolicyBehavior(). Albeit an independent question, but it's worth mentioning: this patch also brings OvmfPkg's PlatformBdsInit() closer to ArmVirtPkg's. Namely, the latter signals End-of-Dxe in PlatformBdsInit() already. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-04-13OvmfPkg/XenIoMmioLib: add missing MemoryAllocationLib dependency to INFArd Biesheuvel1-0/+1
XenIoMmioLib depends on MemoryAllocationLib, and uses its header, but failed to declare the dependency in its INF. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-07OvmfPkg: Install LockBox protocol in constructor of LockBoxDxeLibStar Zeng2-3/+34
Currently, the LockBox protocol is installed in entrypoint of OVMF AcpiS3SaveDxe. We can let the first driver run with LockBoxDxeLib linked to have its library constructor to install LockBox protocol on the ImageHandle. As other drivers may have gEfiLockBoxProtocolGuid dependency, the first driver should run before them. The later patches to retire AcpiS3SaveDxe for OVMF depends on this patch. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-06OvmfPkg: VirtioLib: add Virtio10WriteFeatures() functionLaszlo Ersek1-0/+75
In VirtIo 1.0, a device can reject a self-inconsistent feature bitmap through the new VSTAT_FEATURES_OK status bit. (For example if the driver requests a higher level feature but clears a prerequisite feature.) This function is a small wrapper around VIRTIO_DEVICE_PROTOCOL.SetGuestFeatures() that also verifies if the VirtIo 1.0 device accepts the feature bitmap. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-04-06OvmfPkg: VIRTIO_DEVICE_PROTOCOL: pass VRING object to SetQueueAddress()Laszlo Ersek2-5/+6
In virtio-1.0, it is not enough to pass the base address of the virtio queue to the hypervisor (as a frame number); instead it will want the addresses of the descriptor table, the available ring, and the used ring separately. Pass the VRING object to the SetQueueAddress() member function; this will enable a virtio-1.0 implementation. Convert the current producers and consumers to this prototype. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-04-06OvmfPkg: VIRTIO_DEVICE_PROTOCOL: remove GetQueueAddress() memberLaszlo Ersek3-28/+0
This function was never consumed by drivers, and the current prototype is unsupportable with virtio-1.0. Remove the function from the protocol definition, and drop the current (unused) implementations. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-04-06OvmfPkg: VIRTIO_DEVICE_PROTOCOL: widen the Features bitmap to 64 bitsLaszlo Ersek2-5/+9
The virtio-1.0 spec widens the Features bitmap to 64 bits. Modify the declarations of the GetDeviceFeatures() and SetGuestFeatures() protocol member functions accordingly. Normally, a protocol cannot be changed in incompatible ways if the GUID stays the same; however, we've always been extremely clear that VIRTIO_DEVICE_PROTOCOL is internal to edk2. See for example the top of "OvmfPkg/Include/Protocol/VirtioDevice.h". In this patch, all producers and consumers of the GetDeviceFeatures() and SetGuestFeatures() protocol members are updated. The drivers that currently produce these members are "legacy" drivers (in virtio-1.0 terminology), and they cannot (and will not) handle feature bits above BIT31. Therefore their conversion is only for compatibility with the modified protocol interface. The consumers will be responsible for checking the VIRTIO_DEVICE_PROTOCOL.Revision field, and for not passing feature bits that these backends cannot handle. The VirtioMmioGetDeviceFeatures() implementation stores the result of an MmioRead32() call with normal assignment, so it needs no change beyond adapting its prototype. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-23OvmfPkg: PciHostBridgeLib: install 64-bit PCI host apertureLaszlo Ersek2-0/+9
On the normal boot path (which is when PciHostBridgeDxe runs), the PCDs have been calculated; report the 64-bit PCI host aperture to PciHostBridgeDxe. In the Ia32 build, the PCD values (zeros) come directly from the DEC file, and this patch makes no difference. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Thomas Lamprecht <t.lamprecht@proxmox.com> Ref: https://github.com/tianocore/edk2/issues/59 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-23OvmfPkg: PlatformBdsLib: signal gRootBridgesConnectedEventGroupGuidLaszlo Ersek2-0/+7
The explanation is in the patch titled OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid At this point, this signal doesn't do anything yet. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-23OvmfPkg/PlatformBdsLib: rebase to EfiEventGroupSignalLaszlo Ersek1-29/+1
Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>