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>
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>
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>
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>
There is no good reason to keep QemuFwCfgSimpleParserLib arch-specific.
Move it to the LibraryClasses section.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
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>
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>
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>