summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg: add MmServicesTableLib resolutionArd Biesheuvel2019-01-163-0/+3
| | | | | | | | | | | The SMM based FTW and variable drivers are going to depend on MmServicesTableLib after a subsequent patch, so add a resolution for it to various OvmfPkg .dsc files. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: require GCC48 or laterLaszlo Ersek2019-01-082-17/+5
| | | | | | | | | | | | | | | | | | | | We're about to remove BaseTools support for GCC44..GCC47. Reject those gcc versions cleanly in "OvmfPkg/build.sh". In "OvmfPkg/README", upgrade any mentions of the same gcc versions to GCC48. No GCC44..GCC47 references remain under OvmfPkg after this patch. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377 Contributed-under: TianoCore Contribution Agreement 1.1 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> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* OvmfPkg: Remove PcdPeiCoreMaxXXX PCDs' statementStar Zeng2018-12-193-6/+0
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1405 The codes have been updated to not use PcdPeiCoreMaxFvSupported, PcdPeiCoreMaxPeimPerFv and PcdPeiCoreMaxPpiSupported, so their statement in platform DSC could be removed. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg: Don't include TftpDynamicCommand in XCODE5 tool chainLiming Gao2018-11-276-0/+12
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1355 XCODE doesn't support HII resource section. TftpDynamicCommand driver depends on HII resource section. To let OvmfPkg boot to shell on XCODE5 tool chain, don't include TftpDynamicCommand driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: simply use the Bochs interface for vmsvgayuchenlin2018-11-203-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | BAR | std vga | vmsvga --------------------------------- 0 | Framebuffer | I/O space 1 | Reserved | Framebuffer 2 | MMIO | FIFO - We cannot recognize VMW SVGA as BOCHS because that would confuse the IsQxl setting in QemuVideoControllerDriverStart(), - We cannot recognize VMW SVGA as BOCHS_MMIO because BAR2 on VMW SVGA is not the BOCHS MMIO BAR (we can only use port IO). Therefore the list of reasons for which we should introduce QEMU_VIDEO_VMWARE_SVGA should name three reasons: (1) Get framebuffer from correct PCI BAR (2) Prevent using BAR2 for MMIO (3) Prevent mis-recognizing VMW SVGA as QXL Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* Revert "OvmfPkg: VMWare SVGA display device register definitions"yuchenlin2018-11-201-104/+0
| | | | | | | | | | | | | This reverts commit 9bcca53fe466cdff397578328d9d87d257aba493. We reverted VMWare SVGA driver. We don't need these definitions too. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 328409ce8de7f318ee9c929b64302bd361cd1dbd) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."yuchenlin2018-11-206-359/+0
| | | | | | | | | | | | | | | | | This reverts commit 05a5379458725234de8a05780fcb5da2c12680e4. The VMWare SVGA display device implemented by Qemu (-vga vmware) uses an I/O-type BAR which is laid out such that some register offsets are not aligned to the read/write width with which they are expected to be accessed. However, we reverted the initialization of VMWare SVGA device, we don't need such unaligned I/O. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 438ada5aa5a1174940795678c2dae07cde8f3869) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"yuchenlin2018-11-204-379/+7
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2. The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU -- falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA FIFO. To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA FIFO setup feature. It means our current VMW SVGA driver code is basically dead. To simplify the problem, we will replace the old VMWare SVGA driver to Bochs interface. It should work on all QEMU version. The first step for using Bochs interface is to revert old driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 98856a724c2acdc0094220d4de615a557dad0f88) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"yuchenlin2018-11-201-1/+0
| | | | | | | | | | | | | | | | | This reverts commit b2959e9f1a57279506ca46d56bc424fd7fa6b62a. The VMWare SVGA display device implemented by Qemu (-vga vmware) uses an I/O-type BAR which is laid out such that some register offsets are not aligned to the read/write width with which they are expected to be accessed. However, we will revert the initialization of VMWare SVGA device later, we don't need such unaligned I/O. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit e038bde2679bbd200086c25ab43090ad3b8b25a3) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* OvmfPkg: Remove EdkShellBinPkg in FDFshenglei2018-11-196-24/+0
| | | | | | | | | | | | | | | | Remove EdkShellBinPkg in OvmfPkgIa32.fdf, OvmfPkg/OvmfPkgIa32X64.fdf amd OvmfPkg/OvmfPkgX64.fdf. https://bugzilla.tianocore.org/show_bug.cgi?id=1108 v2: Remove USE_OLD_SHELL in DSC and FDF because it will be unnecessary to use it. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* Reapply "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"Laszlo Ersek2018-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | This reverts commit e038bde2679bbd200086c25ab43090ad3b8b25a3, reapplying b2959e9f1a57279506ca46d56bc424fd7fa6b62a. Note that the commit now being reverted is technically correct; the only reason we're reverting it is because it should not have been pushed past the Soft Feature Freeze for the edk2-stable201811 tag. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: yuchenlin <yuchenlin@synology.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: yuchenlin <yuchenlin@synology.com>
* Reapply "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"Laszlo Ersek2018-11-124-7/+379
| | | | | | | | | | | | | | | | | | | | | This reverts commit 98856a724c2acdc0094220d4de615a557dad0f88, reapplying c137d95081690d4877fbeb5f1856972e84ac32f2. Note that the commit now being reverted is technically correct; the only reason we're reverting it is because it should not have been pushed past the Soft Feature Freeze for the edk2-stable201811 tag. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: yuchenlin <yuchenlin@synology.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: yuchenlin <yuchenlin@synology.com>
* Reapply "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."Laszlo Ersek2018-11-126-0/+359
| | | | | | | | | | | | | | | | | | | | | This reverts commit 438ada5aa5a1174940795678c2dae07cde8f3869, reapplying 05a5379458725234de8a05780fcb5da2c12680e4. Note that the commit now being reverted is technically correct; the only reason we're reverting it is because it should not have been pushed past the Soft Feature Freeze for the edk2-stable201811 tag. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: yuchenlin <yuchenlin@synology.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: yuchenlin <yuchenlin@synology.com>
* Reapply "OvmfPkg: VMWare SVGA display device register definitions"Laszlo Ersek2018-11-121-0/+104
| | | | | | | | | | | | | | | | | | | | | This reverts commit 328409ce8de7f318ee9c929b64302bd361cd1dbd, reapplying 9bcca53fe466cdff397578328d9d87d257aba493. Note that the commit now being reverted is technically correct; the only reason we're reverting it is because it should not have been pushed past the Soft Feature Freeze for the edk2-stable201811 tag. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: yuchenlin <yuchenlin@synology.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: yuchenlin <yuchenlin@synology.com>
* Revert "OvmfPkg: VMWare SVGA display device register definitions"yuchenlin2018-11-061-104/+0
| | | | | | | | | | | This reverts commit 9bcca53fe466cdff397578328d9d87d257aba493. We reverted VMWare SVGA driver. We don't need these definitions too. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."yuchenlin2018-11-066-359/+0
| | | | | | | | | | | | | | | This reverts commit 05a5379458725234de8a05780fcb5da2c12680e4. The VMWare SVGA display device implemented by Qemu (-vga vmware) uses an I/O-type BAR which is laid out such that some register offsets are not aligned to the read/write width with which they are expected to be accessed. However, we reverted the initialization of VMWare SVGA device, we don't need such unaligned I/O. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"yuchenlin2018-11-064-379/+7
| | | | | | | | | | | | | | | | | | | | | This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2. The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU -- falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA FIFO. To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA FIFO setup feature. It means our current VMW SVGA driver code is basically dead. To simplify the problem, we will replace the old VMWare SVGA driver to Bochs interface. It should work on all QEMU version. The first step for using Bochs interface is to revert old driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"yuchenlin2018-11-061-1/+0
| | | | | | | | | | | | | | | This reverts commit b2959e9f1a57279506ca46d56bc424fd7fa6b62a. The VMWare SVGA display device implemented by Qemu (-vga vmware) uses an I/O-type BAR which is laid out such that some register offsets are not aligned to the read/write width with which they are expected to be accessed. However, we will revert the initialization of VMWare SVGA device later, we don't need such unaligned I/O. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Replace obsoleted network drivers from platform DSC/FDF.Fu Siyuan2018-11-066-48/+18
| | | | | | | | | | | | | | | | | | V2: Add missed library instance for NetworkPkg iSCSI driver. This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively maintained and will be removed from edk2 master soon. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformPei: clear CPU cachesMarc-André Lureau2018-10-054-0/+125
| | | | | | | | | | | | | | | | | | | | | | | This is for conformance with the TCG "Platform Reset Attack Mitigation Specification". Because clearing the CPU caches at boot doesn't impact performance significantly, do it unconditionally, for simplicity's sake. Flush the cache on all logical processors, thanks to EFI_PEI_MP_SERVICES_PPI and CacheMaintenanceLib. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> [lersek@redhat.com: remove bogus Message-Id line from commit msg]
* OvmfPkg: link Sha384 and Sha512 support into Tcg2Pei and Tcg2DxeGary Lin2018-08-163-0/+12
| | | | | | | | | | | | | | Sha384 and Sha512 were added to HashInstanceLib recently. To make them available in Tcg2Pei and Tcg2Dxe, we have to link both libraries. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Build-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE CoreLaszlo Ersek2018-08-061-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DXE Core is one of those modules that call ProcessLibraryConstructorList() manually. Before DxeMain() [MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c] calls ProcessLibraryConstructorList(), and through it, our PlatformDebugLibIoPortConstructor() function, DxeMain() invokes the DEBUG() macro multiple times. That macro lands in our PlatformDebugLibIoPortFound() function -- which currently relies on the "mDebugIoPortFound" global variable that has (not yet) been set by the constructor. As a result, early debug messages from the DXE Core are lost. Move the device detection into PlatformDebugLibIoPortFound(), also caching the fact (not just the result) of the device detection. (We could introduce a separate DebugLib instance just for the DXE Core, but the above approach works for all modules that currently consume the PlatformDebugLibIoPort instance (which means "everything but SEC").) This restores messages such as: > CoreInitializeMemoryServices: > BaseAddress - 0x7AF21000 Length - 0x3CDE000 MinimalMemorySizeNeeded - 0x10F4000 Keep the empty constructor function -- OVMF's DebugLib instances have always had constructors; we had better not upset constructor dependency ordering by making our instance(s) constructor-less. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Fixes: c09d9571300a089c35f5df2773b70edc25050d0d Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Brijesh Singh <brijesh.singh@amd.com> [lersek@redhat.com: sanitize blank lines around "mDebugIoPortChecked"]
* OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBootRuiyu Ni2018-07-271-1/+60
| | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org>
* OvmfPkg: Correct ResourcePublicationLib class name in DSC/INF filesLiming Gao2018-07-244-4/+4
| | | | | | | | | | | ResourcePublicationLib class name is ResourcePublicationLib. INF and DSC files are updated to use the correct one. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Dongao Guo <dongao.guo@intel.com> [lersek@redhat.com: insert empty line between commit msg body and tags] Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/XenPvBlkDxe: remove gEfiDevicePathProtocolGuid from [Protocols]Laszlo Ersek2018-07-201-1/+0
| | | | | | | | | | | | | | | | XenPvBlkDxe doesn't reference gEfiDevicePathProtocolGuid; remove it from the INF file. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Steven Shi <steven.shi@intel.com> Reported-by: Steven Shi <steven.shi@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1034 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: clean up libs and protos in "AcpiPlatformDxe.inf"Laszlo Ersek2018-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | None of the source files referenced by "AcpiPlatformDxe.inf" #include "MdePkg/Include/Library/DxeServicesLib.h" or use interfaces declared therein, so drop DxeServicesLib from [LibraryClasses]. "AcpiPlatformDxe.inf" references "AcpiPlatform.c", which installs ACPI tables built into the firmware image from under "OvmfPkg/AcpiTables/", in case dynamically generated ACPI tables are not available from Xen or QEMU. For this, the driver consumes gEfiFirmwareVolume2ProtocolGuid. Account for that in [Protocols]. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reported-by: Steven Shi <steven.shi@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1014 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Restore C-bit when SEV is activeBrijesh Singh2018-07-062-0/+18
| | | | | | | | | | | | | | | | AmdSevDxe maps the flash memory range with C=0, but SetMemorySpaceAttributes() unconditionally resets the C-bit to '1'. Lets restore the mapping back to C=0. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Justen Jordan L <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Do not expose MMIO in SMM buildBrijesh Singh2018-07-064-50/+70
| | | | | | | | | | | | | | | In the SMM build, only an SMM driver is using the address range hence we do not need to expose the flash MMIO range in EFI runtime mapping. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Justen Jordan L <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/QemuFlashFvbServicesRuntimeDxe: mark Flash memory range as MMIOBrijesh Singh2018-07-061-8/+22
| | | | | | | | | | | | | | | | | | | | The flash memory range is an IO address and should be presented as Memory Mapped IO in EFI Runtime mapping. This information can be used by OS when mapping the flash memory range. It is especially helpful in SEV guest case, in which IO addresses should be mapped as unencrypted. If memory region is not marked as MMIO then OS maps the range as encrypted. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Justen Jordan L <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Removing ipf which is no longer supported from edk2.chenc22018-06-2925-50/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg: add QemuRamfb to platform consoleGerd Hoffmann2018-06-141-0/+51
| | | | | | | | | | Add QemuRamfbDxe device path to the list of platform console devices, so ConSplitter will pick up the device even though it isn't a PCI GPU. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: add QemuRamfbDxeGerd Hoffmann2018-06-148-0/+459
| | | | | | | | | | | Add a driver for the qemu ramfb display device. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> [lersek@redhat.com: fix INF banner typo] [lersek@redhat.com: make some local variable definitions more idiomatic] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: add QEMU_RAMFB_GUIDGerd Hoffmann2018-06-142-0/+26
| | | | | | | | | Add GUID header file for the QemuRamfbDxe driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformBootManagerLib: add missing report status code callArd Biesheuvel2018-05-292-0/+5
| | | | | | | | | | | Consumers of status code reports may rely on a status code to be reported when the ReadyToBoot event is signalled. For instance, FirmwarePerformanceDxe will fail to install the FPDT ACPI table in this case. So add the missing call. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg BasePciCapLib: Fix VS build failureLiming Gao2018-05-291-2/+2
| | | | | | | | | | | Fix VS warning C4244: 'function': conversion from 'UINT32' to 'UINT16', possible loss of data. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: remove whitespace after casts] Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: raise DXEFV size to 11 MBLaszlo Ersek2018-05-293-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost exactly two years after commit 2f7b34b20842f, we've grown out the 10MB DXEFV: > build -a IA32 -a X64 -p OvmfPkg/OvmfPkgIa32X64.dsc -b NOOPT -t GCC48 \ > -D SMM_REQUIRE -D SECURE_BOOT_ENABLE -D TLS_ENABLE -D E1000_ENABLE \ > -D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE > > [...] > > GenFv: ERROR 3000: Invalid > the required fv image size 0xa28d48 exceeds the set fv image size > 0xa00000 Raise the DXEFV size to 11MB. (For builds that don't need this DXEFV bump, I've checked the FVMAIN_COMPACT increase stemming from the additional 1MB padding, using NOOPT + GCC48 + FD_SIZE_2MB, and no other "-D" flags. In the IA32 build, FVMAIN_COMPACT grows by 232 bytes. In the IA32X64 build, FVMAIN_COMPACT shrinks by 64 bytes. In the X64 build, FVMAIN_COMPACT shrinks by 376 bytes.) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Gary Lin <glin@suse.com>
* OvmfPkg/Virtio10Dxe: convert to PciCapLibLaszlo Ersek2018-05-243-93/+53
| | | | | | | | | | | | | | | | | Replace the manual capability list parsing in OvmfPkg/Virtio10Dxe with PciCapLib and PciCapPciIoLib API calls. The VIRTIO_PCI_CAP_LINK structure type is now superfluous. (Well, it always has been; we should have used EFI_PCI_CAPABILITY_HDR.) Also, EFI_PCI_CAPABILITY_VENDOR_HDR is now included at the front of VIRTIO_PCI_CAP. No driver other than Virtio10Dxe relies on VIRTIO_PCI_CAP. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg/PciHotPlugInitDxe: convert to PciCapLibLaszlo Ersek2018-05-242-171/+103
| | | | | | | | | | | Replace the manual capability list parsing in OvmfPkg/PciHotPlugInitDxe with PciCapLib and PciCapPciSegmentLib API calls. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLibLaszlo Ersek2018-05-243-0/+9
| | | | | | | | | | | | Resolve the PciCapLib, PciCapPciSegmentLib, and PciCapPciIoLib classes to their single respective instances. Later patches will use these lib classes in OvmfPkg drivers. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg: introduce PciCapPciIoLibLaszlo Ersek2018-05-245-0/+386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a library class, and a UEFI_DRIVER lib instance, that are layered on top of PciCapLib, and allow clients to plug an EFI_PCI_IO_PROTOCOL backend into PciCapLib, for config space access. (Side note: Although the UEFI spec says that EFI_PCI_IO_PROTOCOL_CONFIG() returns EFI_UNSUPPORTED if "[t]he address range specified by Offset, Width, and Count is not valid for the PCI configuration header of the PCI controller", this patch doesn't directly document the EFI_UNSUPPORTED error code, for ProtoDevTransferConfig() and its callers ProtoDevReadConfig() and ProtoDevWriteConfig(). Instead, the patch refers to "unspecified error codes". The reason is that in edk2, the PciIoConfigRead() and PciIoConfigWrite() functions [1] can also return EFI_INVALID_PARAMETER for the above situation. Namely, PciIoConfigRead() and PciIoConfigWrite() first call PciIoVerifyConfigAccess(), which indeed produces the standard EFI_UNSUPPORTED error code, if the device's config space is exceeded. However, if PciIoVerifyConfigAccess() passes, and we reach RootBridgeIoPciRead() and RootBridgeIoPciWrite() [2], then RootBridgeIoCheckParameter() can still fail, e.g. if the root bridge doesn't support extended config space (see commit 014b472053ae3). For all kinds of Limit violations in IO, MMIO, and config space, RootBridgeIoCheckParameter() returns EFI_INVALID_PARAMETER, not EFI_UNSUPPORTED. That error code is then propagated up to, and out of, PciIoConfigRead() and PciIoConfigWrite(). [1] MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c [2] MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c ) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg: introduce PciCapPciSegmentLibLaszlo Ersek2018-05-245-0/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a library class, and a BASE lib instance, that are layered on top of PciCapLib, and allow clients to plug a PciSegmentLib backend into PciCapLib, for config space access. (Side note: The "MaxDomain" parameter is provided because, in practice, platforms exist where a PCI Express device may show up on a root bridge such that the root bridge doesn't support access to extended config space. Earlier the same issue was handled for MdeModulePkg/PciHostBridgeDxe in commit 014b472053ae3. However, that solution does not apply to the PciSegmentLib class, because: (1) The config space accessor functions of the PciSegmentLib class, such as PciSegmentReadBuffer(), have no way of informing the caller whether access to extended config space actually succeeds. (For example, in the UefiPciSegmentLibPciRootBridgeIo instace, which could in theory benefit from commit 014b472053ae3, the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read() status code is explicitly ignored, because there's no way for the lib instance to propagate it to the PciSegmentLib caller. If the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read() call fails, then DxePciSegmentLibPciRootBridgeIoReadWorker() returns Data with indeterminate value.) (2) There is no *general* way for any firmware platform to provide, or use, a PciSegmentLib instance in which access to extended config space always succeeds. In brief, on a platform where config space may be limited to 256 bytes, access to extended config space through PciSegmentLib may invoke undefined behavior; therefore PciCapPciSegmentLib must give platforms a way to prevent such access.) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg: introduce PciCapLibLaszlo Ersek2018-05-245-0/+1540
| | | | | | | | | | | | | | Add a library class, and a BASE lib instance, to work more easily with PCI capabilities in PCI config space. Functions are provided to parse capabilities lists, and to locate, describe, read and write capabilities. PCI config space access is abstracted away. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Suggested-by: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg/PlatformBootManagerLib: process TPM PPI requestMarc-André Lureau2018-05-222-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Call Tcg2PhysicalPresenceLibProcessRequest() to process pending PPI requests from PlatformBootManagerAfterConsole(). Laszlo understanding of edk2 is that the PPI operation processing was meant to occur *entirely* before End-Of-Dxe, so that 3rd party UEFI drivers couldn't interfere with PPI opcode processing *at all*. He suggested that we should *not* call Tcg2PhysicalPresenceLibProcessRequest() from BeforeConsole(). Because, an "auth" console, i.e. one that does not depend on a 3rd party driver, is *in general* impossible to guarantee. Instead we could opt to trust 3rd party drivers, and use the "normal" console(s) in AfterConsole(), in order to let the user confirm the PPI requests. It will depend on the user to enable Secure Boot, so that the trustworthiness of those 3rd party drivers is ensured. If an attacker roots the guest OS from within, queues some TPM2 PPI requests, and also modifies drivers on the EFI system partition and/or in GPU option ROMs (?), then those drivers will not load after guest reboot, and thus the dependent console(s) won't be used for confirming the PPI requests. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: add Tcg2PhysicalPresenceLibQemuMarc-André Lureau2018-05-226-3/+1046
| | | | | | | | | | | | | | | | | | | | | | | | | Cloned "SecurityPkg/Library/DxeTcg2PhysicalPresenceLib" and: - removed all the functions that are unreachable from Tcg2PhysicalPresenceLibProcessRequest() [called from platform BDS], or SubmitRequestToPreOSFunction() and ReturnOperationResponseToOsFunction() [called from Tcg2Dxe]. - replaced everything that's related to the TCG2_PHYSICAL_PRESENCE*_VARIABLE variables, with direct access to the QEMU structures. This commit is based on initial experimental work from Stefan Berger. In particular, he wrote most of QEMU PPI support, and designed the qemu/firmware interaction. Initially, Stefan tried to reuse the existing SecurityPkg code, but we eventually decided to get rid of the variables and simplify the ovmf/qemu version. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [lersek@redhat.com: clean up non-idiomatic coding style] [lersek@redhat.com: null mPpi on invalid PPI address] Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/IndustryStandard: add QemuTpm.h headerMarc-André Lureau2018-05-221-0/+69
| | | | | | | | | Add some common macros and type definitions corresponding to the QEMU TPM interface. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: add Tcg2PhysicalPresenceLibNull when !TPM2_ENABLEMarc-André Lureau2018-05-225-0/+66
| | | | | | | | | | | This NULL library will let us call Tcg2PhysicalPresenceLibProcessRequest() unconditionally from BdsPlatform when building without TPM2_ENABLE. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [lersek@redhat.com: replace MdeModulePkg.dec w/ MdePkg.dec] Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformBootManagerLib: connect Virtio RNG devices againLaszlo Ersek2018-05-182-0/+106
| | | | | | | | | | | | | | | | | | | Virtio RNG devices are never boot devices, so in commit 245c643cc8b7 we stopped connecting them. This is a problem because an OS boot loader may depend on EFI_RNG_PROTOCOL to seed the OS's RNG. Connect Virtio RNG devices again. And, while commit 245c643cc8b7 removed that from PlatformBootManagerAfterConsole(), reintroduce it now to PlatformBootManagerBeforeConsole() -- this way Driver#### options launched between both functions may access EFI_RNG_PROTOCOL too. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Fixes: 245c643cc8b73240c3b88cb55b2911b285a8c10d Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1579518 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg/QemuVideoDxe: Enable DISPLAY_OTHER pci class for qemu stdvgaGerd Hoffmann2018-05-171-0/+6
| | | | | | | | This makes QemuVideo bind to the secondary-vga device. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/QemuVideoDxe: Add SubClass field to QEMU_VIDEO_CARDGerd Hoffmann2018-05-172-4/+14
| | | | | | | | | | Then check for PCI_CLASS_DISPLAY_VGA using the new field. This allows to enable/disable non-vga display classes per card entry. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformBootManagerLib: connect consoles unconditionallyLaszlo Ersek2018-05-141-83/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | If both ConIn and ConOut exist, but ConIn references none of the PS/2 keyboard, the USB wild-card keyboard, and any serial ports, then PlatformInitializeConsole() currently allows the boot to proceed without any input devices at all. This makes for a bad user experience -- the firmware menu could only be entered through OsIndications, set by a guest OS. Do what ArmVirtQemu does already, namely connect the consoles, and add them to ConIn / ConOut / ErrOut, unconditionally. (The underlying EfiBootManagerUpdateConsoleVariable() function checks for duplicates.) The issue used to be masked by the EfiBootManagerConnectAll() call that got conditionalized in commit 245c643cc8b7. This patch is best viewed with "git show -b -W". Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Fixes: 245c643cc8b73240c3b88cb55b2911b285a8c10d Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1577546 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>