mirror of
https://github.com/Dasharo/edk2-upstream.git
synced 2026-06-13 19:16:19 -07:00
commitaa02571("MdeModulePkg: Change EndofDxeEvent TPLs to TPL_CALLBACK") changed EndOfDxeEvent TPLs from TPL_NOFIY to TPL_CALLBACK. However this commit makes a boot failure on the FVP platform when FPDT ACPI table generation is enabled: [FirmwarePerformanceDxe] Error when lock variable FirmwarePerformance, Status = Write Protected ASSERT_EFI_ERROR (Status = Write Protected) ASSERT [FirmwarePerformanceDxe] FirmwarePerformanceDxe.c(405): !(((RETURN_STATUS)(Status)) >= 0x8000000000000000ULL) Currently, EVT_NOTIFY_SIGNAL events are managed in FILO order, as new events are inserted using InsertHeadList(). The sequence is as follows: 1. DxeCore initializes DxeCorePerformanceLib, whose constructor creates an EndOfDxe event (gEfiEndOfDxeEventGroupGuid) with the ReportFpdtRecordBuffer() callback. 2. MmCommunicationDxe (in ArmPkg) creates another EndOfDxe event to notify StandaloneMm. This event is inserted ahead of the one created in (1). 3. PlatformBootManagerBeforeConsole() signals EndOfDxe, which triggers the event created in (2) first. 4. When the callback from (2) runs, StandaloneMm calls LockVariablePolicy(). 5. The callback from (1) is then invoked and attempts to update FPDT via InstallFirmwarePerformanceDataTable(). During this process, it tries to register a variable policy for the FirmwarePerformance variable. However, since the Variable Policy interface was locked in (4), the operation fails with EFI_WRITE_PROTECTED. To resolve this issue, revert EndofDxeEvent TPLs to TPL_NOTIFY for FPDT. Fixes:aa02571("MdeModulePkg: Change EndofDxeEvent TPLs to TPL_CALLBACK") Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>