edk2 icon indicating copy to clipboard operation
edk2 copied to clipboard

UefiPayloadPkg: Add support for logging to CBMEM console

Open gdong1 opened this issue 2 years ago • 1 comments

Writes TianoCore debug logs into the CBMEM console ringbuffer, from where the user can retrieve them with the cbmem userspace utility.

The intention is to aid in debugging non-fatal issues even in release builds, or simply make TianoCore's logs available to those interested. Consequently, MDEPKG_NDEBUG must be masked. As an in-memory debug logging library, ASSERTs must be non-fatal to be seen, so they neither dead-loop nor create a breakpoint. It is assumed that ASSERT() neither enforces fatal conditions nor security integrity, as release builds do not call DebugAssert() from the ASSERT macro.

More detailed debug logs are produced with the DEBUG_CODE macro, but this guards other debug-related code throughout the codebase. To avoid changing behaviour on release builds, this is only set for debug builds.

Tested on QEMU, dumping the appropriate memory region in the UEFI shell shows the TianoCore log. An improved revision of the debug library used in several coreboot-related EDK2 forks, including MrChromebox's. Previous revisions also tested on an Acer Aspire VN7-572G laptop.

Cc: Guo Dong [email protected] Cc: Ray Ni [email protected] Cc: Maurice Ma [email protected] Cc: Benjamin You [email protected] Cc: Sean Rhodes [email protected] Signed-off-by: Benjamin Doron [email protected] Reviewed-by: Lean Sheng Tan [email protected] Reviewed-by: Sean Rhodes [email protected] Reviewed-by: Guo Dong [email protected]

gdong1 avatar Jul 11 '22 16:07 gdong1

PR can not be merged due to conflict. Please rebase and resubmit

mergify[bot] avatar Jul 18 '22 22:07 mergify[bot]

PR can not be merged due to conflict. Please rebase and resubmit

mergify[bot] avatar Sep 23 '22 17:09 mergify[bot]