edk2/MdeModulePkg/Library/DxeCorePerformanceLib
Yeoreum Yun 8c50e656c0 MdeModulePkg: : revert EndofDxeEvent TPLs to TPL_NOTIFY for FPDT
commit aa02571 ("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>
2026-03-19 03:39:15 +00:00
..
DxeCorePerformanceLib.c MdeModulePkg: : revert EndofDxeEvent TPLs to TPL_NOTIFY for FPDT 2026-03-19 03:39:15 +00:00
DxeCorePerformanceLib.inf MdeModulePkg/FPDT: Lock boot performance table address variable at EndOfDxe 2021-11-12 07:36:23 +00:00
DxeCorePerformanceLib.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
DxeCorePerformanceLibInternal.h MdeModulePkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00