summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg: Make more use of ARRAY_SIZE()Gary Lin2016-10-274-12/+9
| | | | | | | | | | | | Convert the remaining pieces to make the code shorter and more readable. Cc: Justen Jordan <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: tweak subject line] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/QemuVideoDxe: rebase to ARRAY_SIZE()Laszlo Ersek2016-10-271-2/+2
| | | | | | | 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>
* OvmfPkg/QemuBootOrderLib: rebase to ARRAY_SIZE()Laszlo Ersek2016-10-271-6/+6
| | | | | | | 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>
* OvmfPkg/XenBusDxe: remove module-local ARRAY_SIZE macroLaszlo Ersek2016-10-271-3/+0
| | | | | | | | | | | Rely on the central macro definition from "MdePkg/Include/Base.h" instead. Cc: Gary Lin <glin@suse.com> 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: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/PlatformBootManagerLib: remove module-local ARRAY_SIZE macroLaszlo Ersek2016-10-271-7/+0
| | | | | | | | | Rely on the central macro definition from "MdePkg/Include/Base.h" instead. 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>
* OvmfPkg/XenBusDxe: guard the definition of ARRAY_SIZELaszlo Ersek2016-10-271-0/+2
| | | | | | | | | | | | | | | In one of the next patches, we'll introduce ARRAY_SIZE in "MdePkg/Include/Base.h". In order to proceed in small steps, make the module-local definition of ARRAY_SIZE conditional. This way the introduction of the macro under MdePkg will silently switch this module over (after which we can remove the module-local definition completely). Cc: Gary Lin <glin@suse.com> 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: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/PlatformBootManagerLib: guard the definition of ARRAY_SIZELaszlo Ersek2016-10-271-0/+2
| | | | | | | | | | | | | In one of the next patches, we'll introduce ARRAY_SIZE in "MdePkg/Include/Base.h". In order to proceed in small steps, make the module-local definition of ARRAY_SIZE conditional. This way the introduction of the macro under MdePkg will silently switch this module over (after which we can remove the module-local definition completely). 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>
* OvmfPkg/XenConsoleSerialPortLib: don't include <Uefi/UefiBaseType.h>Laszlo Ersek2016-10-261-1/+0
| | | | | | | | | | | | | | | XenConsoleSerialPortLib is a BASE type library instance, without being restricted to UEFI client modules. (For example, the "ArmVirtPkg/ArmVirtXen.dsc" platform builds this library instance into "ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf", which is a SEC type module.) For such library instances, including <Uefi/UefiBaseType.h> is not right. 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>
* OvmfPkg: disable deprecated interfacesLaszlo Ersek2016-10-253-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At this point no code in OvmfPkg (and apparently no code outside of OvmfPkg that OVMF depends on) uses the deprecated APIs, so we can disable them in the platform DSC files: BaseLib: - StrCpy - StrnCpy - StrCat - StrnCat - UnicodeStrToAsciiStr - AsciiStrCpy - AsciiStrnCpy - AsciiStrCat - AsciiStrnCat - AsciiStrToUnicodeStr PcdLib: - PcdSet8 - PcdSet16 - PcdSet32 - PcdSet64 - PcdSetPtr - PcdSetBool - PcdSetEx8 - PcdSetEx16 - PcdSetEx32 - PcdSetEx64 - PcdSetExPtr - PcdSetExBool UefiLib: - GetVariable - GetEfiGlobalVariable 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>
* OvmfPkg/QemuFlashFvbServicesRuntimeDxe: eliminate unchecked PcdSetXX() callsLaszlo Ersek2016-10-251-4/+9
| | | | | | | | | | | | | | These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/PlatformPei: eliminate unchecked PcdSetXX() callsLaszlo Ersek2016-10-253-20/+40
| | | | | | | | | | | | | | | | | | These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Anthony PERARD <anthony.perard@citrix.com> Cc: Gary Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gary Lin <glin@suse.com> Tested-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/PlatformDxe: eliminate unchecked PcdSetXX() callsLaszlo Ersek2016-10-251-2/+6
| | | | | | | | | | | | | | | These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/SmbiosVersionLib: eliminate unchecked PcdSetXX() callsLaszlo Ersek2016-10-251-3/+7
| | | | | | | | | | | | | | | | | These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/PlatformBootManagerLib: eliminate unchecked PcdSetXX() callsLaszlo Ersek2016-10-251-4/+10
| | | | | | | | | | | | | | | | | | These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Anthony PERARD <anthony.perard@citrix.com> Cc: Gary Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gary Lin <glin@suse.com> Tested-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/EmuVariableFvbRuntimeDxe: eliminate unchecked PcdSetXX() callsLaszlo Ersek2016-10-251-3/+9
| | | | | | | | | | | | | | | | | | These are deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Introduce a variable called PcdStatus, and use it to assert the success of these operations (there is no reason for them to fail here). Cc: Anthony PERARD <anthony.perard@citrix.com> Cc: Gary Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gary Lin <glin@suse.com> Tested-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/XenBusDxe: eliminate AsciiStrCat() callsLaszlo Ersek2016-10-252-6/+10
| | | | | | | | | | | | | | | | | | | AsciiStrCat() is deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Replace AsciiStrCat() with AsciiSPrint(). Spell out the (already existent) PrintLib dependency in the INF file. Add an explicit ASSERT() to document that XenStoreJoin() assumes that the pool allocation always succeeds. Cc: Anthony PERARD <anthony.perard@citrix.com> Cc: Gary Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gary Lin <glin@suse.com> Tested-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/XenBusDxe: eliminate AsciiStrCpy() callsLaszlo Ersek2016-10-251-5/+2
| | | | | | | | | | | | | | | AsciiStrCpy() is deprecated / disabled under the DISABLE_NEW_DEPRECATED_INTERFACES feature test macro. Cc: Anthony PERARD <anthony.perard@citrix.com> Cc: Gary Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gary Lin <glin@suse.com> Tested-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: Fix typos in commentsGary Lin2016-10-192-8/+8
| | | | | | | | | | | | | | | - Incude -> Include - futhure -> future - Predfined -> Predefined - minimue -> minimum - predeined -> predefined - excute -> execute - dirver -> driver - inforamtion -> information Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuVideoDxe: upgrade VERBOSE debug messages to INFOLaszlo Ersek2016-10-162-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 5b2291f9567a ("OvmfPkg: QemuVideoDxe uses MdeModulePkg/FrameBufferLib"), QemuVideoDxe was rebased to FrameBufferBltLib. The FrameBufferBltLib instance added in commit b1ca386074bd ("MdeModulePkg: Add FrameBufferBltLib library instance") logs many messages on the VERBOSE level; for example, a normal boot with OVMF can produce 500+ "VideoFill" messages, dependent on the progress bar, when the VERBOSE bit is set in PcdDebugPrintErrorLevel. While FrameBufferBltLib is certainly allowed to log such messages on the VERBOSE level, we should separate those frequent messages from the (infrequent) ones produced by QemuVideoDxe itself. QemuVideoDxe logs VERBOSE messages in three locations (in two functions) at the moment. All of them are infrequent: both QemuVideoBochsModeSetup() and InstallVbeShim() are called from QemuVideoControllerDriverStart(), that is, when a device is bound. Upgrade these messages to INFO level, so that VERBOSE can be disabled in PcdDebugPrintErrorLevel -- perhaps selectively for OvmfPkg/QemuVideoDxe -- without hiding these infrequent messages. 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>
* OvmfPkg/QemuVideoDxe: remove useless QEMU_VIDEO_PRIVATE_DATA.LineBufferLaszlo Ersek2016-10-162-17/+0
| | | | | | | | | | | This field is (re)allocated in QemuVideoGraphicsOutputSetMode(), released in QemuVideoGraphicsOutputDestructor(), and used for nothing else. Remove it. 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>
* OvmfPkg/QemuVideoDxe: remove useless QEMU_VIDEO_PRIVATE_DATA.CurrentModeLaszlo Ersek2016-10-161-4/+2
| | | | | | | | | This field is never used. 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>
* OvmfPkg/QemuVideoDxe: drop QEMU_VIDEO_CIRRUS_MODES.RefreshRateLaszlo Ersek2016-10-162-9/+8
| | | | | | | | | | | | Thanks to the previous patch, this field is also unnecessary now. Remove it. The patch is best reviewed with "git show --word-diff". 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>
* OvmfPkg/QemuVideoDxe: drop useless QEMU_VIDEO_MODE_DATA.RefreshRateLaszlo Ersek2016-10-162-9/+4
| | | | | | | | | This field is never used beyond assignment and debug-logging. Remove it. 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>
* OvmfPkg: add NOOPT build target for source level debuggingBruce Cran2016-10-123-3/+3
| | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Bruce Cran <bruce.cran@sandisk.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: beautify subject line] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Remove unused BltLib referenceRuiyu Ni2016-10-123-12/+3
| | | | | | | 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 at redhat.com>
* OvmfPkg: QemuVideoDxe uses MdeModulePkg/FrameBufferLibRuiyu Ni2016-10-123-12/+46
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek at redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: Include MdeModulePkg/FrameBufferLib in OvmfPkgRuiyu Ni2016-10-123-0/+3
| | | | | | | | | | One of the following patches will change QemuVideoDxe driver to use the new FrameBufferLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek at redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: Use the new LogoDxe driverRuiyu Ni2016-09-287-22/+7
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* OvmfPkg/PlatformBds: Do not call BootLogoEnableLogoRuiyu Ni2016-09-282-8/+7
| | | | | | | | | | Prototype of BootLogoEnableLogo will change in following patches, so do not call BootLogoEnableLogo to avoid build failure. Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* OvmfPkg/VirtioGpuDxe: Fix VS toolchain build failureDandan Bi2016-09-221-1/+2
| | | | | | | | | | | | | V2: add the assert codes. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: fix up subject line] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Fix typing errors in header filesThomas Huth2016-09-137-9/+9
| | | | | | | | | Correct some typos in the header files of the OvmfPkg (which have been discovered with the codespell utility). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Fix typing errorsThomas Huth2016-09-129-14/+14
| | | | | | | | | | | Correct some typos (discovered with the codespell utility) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Thomas Huth <thuth@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: convert C files with LF line terminators to CRLFLaszlo Ersek2016-09-125-805/+805
| | | | | | | | | | | | Run "unix2dos" on the affected files. "git show -b" produces no diff for this patch. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Thomas Huth <thuth@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
* OvmfPkg/IndustryStandard: make "Xen/grant_table.h" pure ASCIILaszlo Ersek2016-09-121-1/+1
| | | | | | | | | | | | | The header file includes the UTF-8 encoding (0xE2 0x80 0x99) of the U+2019 (RIGHT SINGLE QUOTATION MARK) code point. Replace it with a simple apostrophe (U+0027, ASCII 0x27). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Thomas Huth <thuth@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
* OvmfPkg/QemuBootOrderLib: drop too strict "/HD(" suffix from vblk prefixLaszlo Ersek2016-09-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translating QEMU's virtio-block OpenFirmware device path to a UEFI device path prefix was one of the earliest case handled in QemuBootOrderLib. At that time, I terminated the translation output (the UEFI devpath prefix) with a "/HD(" suffix. The intent was for the translation to prefix-match only boot options with HD() device path nodes in them, that is, no auto-generated "device level" boot options. This was motivated by prioritizing specific boot options created by OS installers over auto-generated "device level" options. However, practice has shown that: - OS installers place their installed boot options first in the boot order anyway, - other device types (SATA disks, virtio-scsi disks), where "/HD(" is not appended, work just fine, - requiring "/HD(" actually causes problems: after the OS-installed specific boot option has been lost (or purposely removed), the auto-generated "device level" boot option does the right thing (see the Default Boot Behavior under <http://blog.uncooperative.org/blog/2014/02/06/the-efi-system-partition/>). The "/HD(" requirement causes such boot options to be dropped, which prevents "fallback.efi" from running. Relax the matching by removing the "/HD(" suffix from the translated prefix. Cc: Jordan Justen <jordan.l.justen@intel.com> Fixes: e06a4cd134064590aa1a855ff4b973023279e805 Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1373812 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: Use MdeModulePkg/ResetSystemRuntimeDxeRuiyu Ni2016-09-026-6/+6
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/ResetSystemLib: Implement ResetPlatformSpecificRuiyu Ni2016-09-021-1/+22
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/VirtioGpuDxe: implement EFI_GRAPHICS_OUTPUT_PROTOCOLLaszlo Ersek2016-09-014-23/+719
| | | | | | | | | | | | | | | In this patch we replace our "dummy" Graphics Output Protocol interface with the real one. We exploit that EFI_GRAPHICS_OUTPUT_BLT_PIXEL and VirtioGpuFormatB8G8R8X8Unorm have identical representations; this lets us forego any pixel format conversions in the guest. For messaging the VirtIo GPU device, we use the primitives introduced in the previous patch. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/VirtioGpuDxe: provide functions for sending VirtIo GPU commandsLaszlo Ersek2016-09-012-1/+439
| | | | | | | | | | | | | | | | In this patch we add a "workhorse" function called VirtioGpuSendCommand(), and implement seven simple RPCs atop, for the command types listed in "OvmfPkg/Include/IndustryStandard/VirtioGpu.h". These functions will be called by our EFI_GRAPHICS_OUTPUT_PROTOCOL implementation. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/VirtioGpuDxe: initialize and tear down VirtIo GPU deviceLaszlo Ersek2016-09-014-1/+311
| | | | | | | | | | | | | | | | | | This patch implements the steps listed in section "3.1.1 Driver Requirements: Device Initialization" of the Virtio V1.0 Committee Spec 04. The VirtIo GPU is brought up in VirtioGpuDriverBindingStart(), and down in VirtioGpuDriverBindingStop(). We also add an ExitBootServices() callback that resets the device. This ensures that the device model abandons any guest memory areas when we transfer control to the guest OS. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: include VirtioGpuDxe in the platform DSC/FDF filesLaszlo Ersek2016-09-016-0/+6
| | | | | | | | | | | | At this stage, the driver builds, and suffices for testing binding and unbinding. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/VirtioGpuDxe: introduce with Component Name 2 and Driver BindingLaszlo Ersek2016-09-013-0/+984
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the skeleton of the driver: it implements the Component Name 2 Protocol and the Driver Binding Protocol, in accordance with the generic and GOP-specific requirements set forth in the UEFI spec and the Driver Writers' Guide. The basic idea is that VGPU_DEV abstracts the virtio GPU device, while the single VGPU_GOP that we intend to support at this point stands for "head" (aka "scanout") #0. For now, the Virtio Device Protocol is only used for driver binding; no actual virtio operations are done yet. Similarly, we use a "dummy" GOP GUID and protocol structure (a plain UINT8 object) for now, so that GOP-consuming drivers don't look at what we produce just yet. The driver is a bit different from the other virtio device drivers written thus far: - It implements the GetControllerName() member of the Component Name 2 Protocol. (Formatting helpful names is recommended by UEFI.) As a "best effort", we format the PCI BDF into the name (a PCI backend is not guaranteed by VIRTIO_DEVICE_PROTOCOL). It should provide a more friendly experience in the shell and elsewhere. - This driver seeks to support all RemainingDevicePath cases: - NULL: produce all (= one) child handles (= VGPU_GOP heads) at once, - End of Device Path Node: produce no child handles, - specific ACPI ADR Node: check if it's supportable, and produce it (only one specific child controller is supported). This is one of the reasons for separating VGPU_GOP from VGPU_DEV. The driver is a hybrid driver: it produces both child handles (one, to be exact), but also installs a structure (VGPU_DEV) directly on the VirtIo controller handle, using gEfiCallerIdGuid as protocol GUID. This is a trick I've seen elsewhere in edk2 (for example, TerminalDxe), and it is necessary for the following reason: In EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName(), we must be able to "cast down" a VirtIo ControllerHandle to our own private data structure (VGPU_DEV). That's only possible if we install the structure directly on the VirtIo ControllerHandle (thereby rendering the driver a hybrid driver), because a child controller with our GOP implementation on it may not exist / be passed in there. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/IndustryStandard: add type definitions for the virtio GPU deviceLaszlo Ersek2016-09-012-0/+221
| | | | | | | | | | | | | | | | | The GPU additions to VirtIo 1.0 are a work in progress. Mark the relevant URLs in the source code. Incorporate the absolute minimum from the WIP spec that is necessary for implementing a GOP driver. Add the VIRTIO_SUBSYSTEM_GPU_DEVICE macro to "IndustryStandard/Virtio10.h", since all other such macros (dating back to VirtIo 0.9.5) are part of "IndustryStandard/Virtio095.h". Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/PlatformBootManagerLib: relax device class requirement for ConOutLaszlo Ersek2016-09-011-5/+5
| | | | | | | | | | | | | | | | | | | This will add virtio-gpu-pci devices to ConOut automatically. For further benefit, the change also allows OVMF to use the legacy-free / secondary VGA adapter (added in QEMU commit 63e3e24d, "vga: add secondary stdvga variant") as console. ArmVirtPkg's PlatformBootManagerLib already filters with IS_PCI_DISPLAY(); see IsPciDisplay(). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Originally-suggested-by: Gerd Hoffmann <kraxel@redhat.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>
* OvmfPkg/Virtio10Dxe: don't bind virtio-vgaLaszlo Ersek2016-09-011-3/+15
| | | | | | | | | | | | | | | | | | | | | | Commit 9399f68ae359 ("OvmfPkg: Virtio10Dxe: non-transitional driver for virtio-1.0 PCI devices") created a "competition" between Virtio10Dxe and QemuVideoDxe for virtio-vga devices. The binding order between these drivers is unspecified, and the wrong order effectively breaks commit 94210dc95e9f ("OvmfPkg: QemuVideoDxe: add virtio-vga support"). Thus, never bind virtio-vga in Virtio10Dxe; QemuVideoDxe provides better compatibility for guest OSes that insist on inheriting a linear framebuffer. Users who prefer the VirtIo GPU interface at boot time should specify virtio-gpu-pci, which is exactly virtio-vga, minus the VGA compatibility (such as the framebuffer). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Fixes: 9399f68ae359234b142c293ad1bef75f470ced30 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuVideoDxe: don't incorrectly bind virtio-gpu-pciLaszlo Ersek2016-09-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PCI (Vendor ID, Device ID) pair (0x1af4, 0x1050) stands for both the virtio-vga and the virtio-gpu-pci device models of QEMU. They differ in two things: - the former has a VGA-compatibility linear framebuffer on top of the latter, - the former has PCI_CLASS_DISPLAY_VGA device class, while the latter has PCI_CLASS_DISPLAY_OTHER. In commit 94210dc95e9f ("OvmfPkg: QemuVideoDxe: add virtio-vga support"), we enabled QemuVideoDxe to drive virtio-vga simply by adding its (Vendor ID, Device ID) pair to gQemuVideoCardList. This change inadvertently allowed QemuVideoDxe to bind virtio-gpu-pci, which it cannot drive though. Restrict QemuVideoDxe to PCI_CLASS_DISPLAY_VGA, in order to exclude virtio-gpu-pci. For the other cards that QemuVideoDxe drives, this makes no difference. (Note that OvmfPkg's PlatformBootManagerLib instance has always only added PCI_CLASS_DISPLAY_VGA devices to ConOut; see DetectAndPreparePlatformPciDevicePath().) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Fixes: 94210dc95e9f7c6ff4066a9b35a288e6f1c271bf Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: Add MpInitLib reference in DSC files.Jeff Fan2016-08-173-0/+6
| | | | | | | | | | | | | | This update is for CpuMpPei&CpuDxe consuming MP Initialize library. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: use StatusCode Router and Handler from MdeModulePkgCinnamon Shia2016-08-026-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the Platform Init v1.4a spec, - Volume 1 "4.7 Status Code Service" defines the EFI_PEI_SERVICES.ReportStatusCode() service, - Volume 1 "6.3.5 Status Code PPI (Optional)" defines the EFI_PEI_PROGRESS_CODE_PPI (equivalent to the above), - Volume 2 "14.2 Status Code Runtime Protocol" defines the EFI_STATUS_CODE_PROTOCOL. These allow PEIMs and DXE (and later) modules to report status codes. Currently OvmfPkg uses modules from under "IntelFrameworkModulePkg/Universal/StatusCode/", which produce the above abstractions (PPI and PROTOCOL) directly, and write the status codes, as they are reported, to the serial port or to a memory buffer. This is called "handling" the status codes. In the Platform Init v1.4a spec, - Volume 3 "7.2.2 Report Status Code Handler PPI" defines EFI_PEI_RSC_HANDLER_PPI, - Volume 3 "7.2.1 Report Status Code Handler Protocol" defines EFI_RSC_HANDLER_PROTOCOL. These allow several PEIMs and runtime DXE drivers to register callbacks for status code handling. MdeModulePkg offers a PEIM under "MdeModulePkg/Universal/ReportStatusCodeRouter/Pei" that produces both EFI_PEI_PROGRESS_CODE_PPI and EFI_PEI_RSC_HANDLER_PPI, and a runtime DXE driver under "MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe" that produces both EFI_STATUS_CODE_PROTOCOL and EFI_RSC_HANDLER_PROTOCOL. MdeModulePkg also offers status code handler modules under MdeModulePkg/Universal/StatusCodeHandler/ that depend on EFI_PEI_RSC_HANDLER_PPI and EFI_RSC_HANDLER_PROTOCOL, respectively. The StatusCodeHandler modules register themselves with ReportStatusCodeRouter through EFI_PEI_RSC_HANDLER_PPI / EFI_RSC_HANDLER_PROTOCOL. When another module reports a status code through EFI_PEI_PROGRESS_CODE_PPI / EFI_STATUS_CODE_PROTOCOL, it reaches the phase-matching ReportStatusCodeRouter module first, which in turn passes the status code to the pre-registered, phase-matching StatusCodeHandler module. The status code handling in the StatusCodeHandler modules is identical to the one currently provided by the IntelFrameworkModulePkg modules. Replace the IntelFrameworkModulePkg modules with the MdeModulePkg ones, so we can decrease our dependency on IntelFrameworkModulePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Suggested-by: Liming Gao <liming.gao@intel.com> Fixes: https://tianocore.acgmultimedia.com/show_bug.cgi?id=63 [jordan.l.justen@intel.com: point out IntelFareworkModulePkg typos] Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [lersek@redhat.com: rewrap to 74 cols; fix IntelFareworkModulePkg typos] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/Sec: Support SECTION2 DXEFV typesThomas Palmer2016-07-271-3/+13
| | | | | | | | | | | | | | | | Support down-stream projects that require large DXEFV sizes greater than 16MB by handling SECTION2 common headers. These are already created by the build tools when necessary. Use IS_SECTION2 and SECTION2_SIZE macros to calculate accurate image sizes when appropriate. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: fix NB->MB typo in commit message] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/Sec: Use EFI_COMMON_SECTION_HEADER to avoid castsThomas Palmer2016-07-271-4/+5
| | | | | | | | | | | Drop superfluous casts. There is no change in behavior because EFI_FIRMWARE_VOLUME_IMAGE_SECTION is just a typedef of EFI_COMMON_SECTION_HEADER. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>