On 08/02/2018 07:30 PM, Laszlo Ersek wrote:
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 <[email protected]>
Cc: Brijesh Singh <[email protected]>
Cc: Jordan Justen <[email protected]>
Fixes: c09d9571300a089c35f5df2773b70edc25050d0d
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <[email protected]>
---
Notes:
Brijesh, can you please test this patch on SEV, with and without
capturing the debug port? (In the first case, the debug log should just
work; in the second case, the boot should remain fast.) Thanks!
I have tested the patch on SEV and it works well with and without the
debug flag. thank you!
Tested-by: Brijesh Singh <[email protected]>
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel