audk/OvmfPkg/Library
Laszlo Ersek 91a5b13650 OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core
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: c09d957130
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"]
2018-08-06 20:56:12 +02:00
..
AcpiTimerLib OvmfPkg/AcpiTimerLib: list "AcpiTimerLib.h" in the INF files 2018-03-13 14:30:37 +01:00
BaseMemEncryptSevLib OvmfPkg:Fix VS2012 build failure 2018-03-28 09:58:49 +08:00
BasePciCapLib OvmfPkg BasePciCapLib: Fix VS build failure 2018-05-29 10:21:40 +02:00
BasePciCapPciSegmentLib OvmfPkg: introduce PciCapPciSegmentLib 2018-05-24 21:13:11 +02:00
DxePciLibI440FxQ35 OvmfPkg: add DxePciLibI440FxQ35 2016-03-10 21:28:29 +01:00
EmuVariableFvbLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
LoadLinuxLib OvmfPkg/LoadLinuxLib: list "LoadLinuxLib.h" in the INF file 2018-03-13 14:30:41 +01:00
LockBoxLib OvmfPkg/LockBoxLib: list "LockBoxLib.h" in the INF files 2018-03-13 14:30:43 +01:00
NvVarsFileLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
PciHostBridgeLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
PlatformBootManagerLib OvmfPkg/PlatformBds: Implement PlatformBootManagerUnableToBoot 2018-07-27 15:47:52 +08:00
PlatformDebugLibIoPort OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core 2018-08-06 20:56:12 +02:00
PlatformFvbLibNull OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
PlatformHasIoMmuLib OvmfPkg: Add PlatformHasIoMmuLib 2017-07-10 21:17:28 -07:00
PlatformSecureLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
QemuBootOrderLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
QemuFwCfgLib OvmfPkg/QemuFwCfgDxeLib: SEV: zero FW_CFG_DMA_ACCESS before decrypting it 2017-08-29 22:44:33 +02:00
QemuFwCfgS3Lib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
ResetSystemLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
SerializeVariablesLib OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
SmbiosVersionLib OvmfPkg/SmbiosVersionLib: eliminate unchecked PcdSetXX() calls 2016-10-25 10:46:19 +02:00
SmmCpuFeaturesLib OvmfPkg/SmmCpuFeaturesLib: SEV: encrypt+free pages of init. save state map 2018-03-06 13:30:35 +01:00
Tcg2PhysicalPresenceLibNull OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
Tcg2PhysicalPresenceLibQemu OvmfPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:47 +08:00
TlsAuthConfigLib OvmfPkg/TlsAuthConfigLib: configure trusted cipher suites for HTTPS boot 2018-04-13 14:05:10 +02:00
UefiPciCapPciIoLib OvmfPkg: introduce PciCapPciIoLib 2018-05-24 21:20:42 +02:00
VirtioLib OvmfPkg/VirtioLib: change the parameter of VirtioAppendDesc() to UINT64 2017-08-25 10:42:19 +02:00
VirtioMmioDeviceLib OvmfPkg/VirtioMmioDeviceLib: improve style of mMmioDeviceProtocolTemplate 2018-03-13 14:31:05 +01:00
XenConsoleSerialPortLib OvmfPkg/XenConsoleSerialPortLib: don't include <Uefi/UefiBaseType.h> 2016-10-26 12:03:39 +02:00
XenHypercallLib OvmfPkg/XenHypercallLib: enable virt extensions for ARM 2017-11-17 09:56:50 +00:00
XenIoMmioLib OvmfPkg/XenIoMmioLib: add missing MemoryAllocationLib dependency to INF 2016-04-13 17:26:06 +02:00