summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/MemDebugLogLib
AgeCommit message (Collapse)AuthorFilesLines
2026-07-22OvmfPkg/MemDebugLogLib: Add MemDebugLogInit/Copy stubs to Null instanceLuigi Leonardi1-0/+20
The Null instance of MemDebugLogLib only provides MemDebugLogWrite(), MemDebugLogPages(), and MemDebugLogEnabled(). Any module that references MemDebugLogInit() or MemDebugLogCopy() cannot link against the Null instance, forcing the feature to be gated at the build-system level rather than at runtime. Add no-op stubs for MemDebugLogInit() and MemDebugLogCopy(). This will be used by the following commit to add memory debug log support in TDX. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2026-01-30OvmfPkg/MemDebugLogPeiCoreLib: enable for PEIMsGerd Hoffmann1-1/+1
Allow PEIMs use the MemDebugLogPeiCoreLib lib. The difference between MemDebugLogPeiCoreLib and MemDebugLogPeiLib is that the latter does additionally provide the MemDebugLogPages() function, and pulls in QemuFwCfg* libraries as dependency. Most PEIMs do not need MemDebugLogPages() though, only the ones which handle the setup of the memory logging buffer do. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2026-01-30OvmfPkg/MemDebugLogPeiLib: drop duplicate MemDebugLogWrite functionGerd Hoffmann2-41/+1
The MemDebugLogWrite() function is identical in MemDebugLogPei.c and MemDebugLogPeiCore.c So drop it from MemDebugLogPei.c and simply add MemDebugLogPeiCore.c to MemDebugLogPeiLib.inf instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-12-04OvmfPkg/MemDebugLogLib: use AcquireSpinLockOrFailGerd Hoffmann1-3/+5
Drop log lines if we can't get the spin lock. Not nice, but better than risking a deadlock. Some background: Most of edk2 runs single-threaded on the BSP, so if something holds the lock it is rather unlikely that waiting is going to help. Specifically I think a deadlock can happen if (a) a timer interrupt arrives while the lock is held, and (b) some higher-TPL timer handler tries to print something to the debug log. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-08-28OvmfPkg/MemDebugLogLib: move QemuFwCfgSimpleParserLib to LibraryClassesLuigi Leonardi1-5/+0
There is no good reason to keep QemuFwCfgSimpleParserLib arch-specific. Move it to the LibraryClasses section. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-08-28OvmfPkg/MemDebugLogLib: unoptimize PEIM and PEI_CORELuigi Leonardi2-35/+24
In AARCH64, the PEI phase runs from the flash memory, therefore global variables are not allowed. Remove this optimization so that this library can be used for this architecture. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-06-19OvmfPkg: MemDebugLogLibNull: Support Standalone MM core and driversKun Qin1-1/+1
This change extends the supported types to Standalone MM and Standalone MM Core module types to support potential MM usage. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-14OvmfPkg: Add OVMF Memory Debug Logging MemDebugLogLib libraryAaron Young13-0/+864
Add the Memory Debug Logging feature MemDebugLogLib library which provides the key MemDebugLogWrite() function. Several versions (i.e. SEC, PEIM, DXE, runtime) of the function are included to provide the proper method to write the debug messages to the memory debug log buffer. The library also provides the core functions to maintain the circular memory debug log buffer. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Aaron Young <aaron.young@oracle.com>