edk2/UefiPayloadPkg/Library
Patrick Rudolph 034de59fb7 UefiPayloadPkg: Add SmmStoreLib
Implement all of the FVB protocol functions on top of the SmmStore
as a library. The library consumes the introduced
gEfiSmmStoreInfoHobGuid.

The SMI handler uses a fixed communication buffer in reserved DRAM.
To initiate a transaction you must write to the I/O APM_CNT port.

Tests on Intel(R) Xeon(R) E-2288G CPU @ 3.70G showed that the SMI isn't
triggered with a probability of 1:40 of all cases when called in a tight
loop. The CPU continues running and the SMI is triggered asynchronously
a few clock cycles later. coreboot only handles synchronous APM request
and does nothing on asynchronous APM triggers.

As there's no livesign from SMM it's impossible to tell if the handler
has run. Just wait a bit and try again to trigger a synchronous SMI.

Tests confirmed that out of 5 million tries the SMI is now always
handled.

When a synchronous SMI happens with the correct write to the APM_CNT
port, the ebx register is checked first that it doesn't point to SMRAM.
If it doesn't it's used to read in the arguments that define an SmmStore
transaction.

The SMI handler will only operate on a predefined and memory mapped
region in the boot media.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-04-09 18:12:48 +00:00
..
AcpiTimerLib UefiPayloadPkg: Move FADT check to consumer coode. 2024-09-16 16:34:04 +00:00
BaseSerialPortLibHob UefiPayloadPkg: Support Debug function when Hob was not available. 2024-08-28 11:39:12 +00:00
BuildFdtLib UefiPayloadpkg Add Missing part back 2024-12-30 16:49:59 +00:00
CbParseLib UefiPayloadPkg: Add SmmStoreInfoGuid 2025-04-09 18:12:48 +00:00
CbSerialPortLib UefiPayloadPkg: Add support for logging to CBMEM console 2022-07-27 20:54:35 +00:00
CustomFdtNodeParserLib UefiPayloadPkg: Update FDT parser logic for unaligned data access 2024-12-09 02:23:28 +00:00
CustomFdtNodeParserNullLib UefiPayloadPkg: Add FDT Paser relative LIBs. 2024-08-28 11:39:12 +00:00
DebugPrintErrorLevelLibHob UefiPayloadPkg: Support Debug function when Hob was not available. 2024-08-28 11:39:12 +00:00
DxeHobLib UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DxeHobListLib UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DxeHobListLibNull UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FdtParserLib UefiPayloadPkg: Parse PCI RB Segment info when its available in FDT 2025-03-13 17:40:31 +00:00
FlashDeviceLib UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HobParseLib UniversalPayload: Add RISC-V support for UPL PCDs 2024-09-14 03:38:47 +00:00
PayloadEntryHobLib UefiPayloadPkg: Support Debug function when Hob was not available. 2024-08-28 11:39:12 +00:00
PciHostBridgeLib UefiPayloadPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PciSegmentInfoLibAcpiBoardInfo UefiPayloadPkg: Add AARCH64 support 2025-02-24 12:31:47 +00:00
PlatformBootManagerLib UefiPayloadPkg: Integrate UiApp and BootManagerMenuApp into MultiFv 2023-07-11 06:36:11 +00:00
PlatformHookLib UefiPayloadPkg: Add AARCH64 support 2025-02-24 12:31:47 +00:00
PlatformSupportLibNull UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ResetSystemLib UefiPayloadPkg: Move FADT check to consumer coode. 2024-09-16 16:34:04 +00:00
SblParseLib UefiPayloadPkg: Add SmmStoreInfoGuid 2025-04-09 18:12:48 +00:00
SmmStoreLib UefiPayloadPkg: Add SmmStoreLib 2025-04-09 18:12:48 +00:00
SpiFlashLib UefiPayloadPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00