Newer
Older
AMI-Aptio-BIOS-Reversed / CpPlatPkg / Whea / WheaErrorLog / README.md
@Ajax Dong Ajax Dong 7 days ago 2 KB Recovering names

WheaErrorLog

Index: 0226 | Size: 38,368 bytes (153,472 body) | Phase: SMM

Overview

SMM WHEA (Windows Hardware Error Architecture) error logging driver for Intel Purley platform. It initializes WHEA error record storage in SMRAM, registers SMI handlers and notification callbacks, and coordinates platform MP sync state and MM config-space access. It is the SMM counterpart to DXE WHEA infrastructure and persists error-record buffers across SMI reentry.

Public Flow

  • _ModuleEntryPoint -- SMM/DXE driver entry, chains context initialization, main init, and failure cleanup.
  • WheaErrorLogInitializeContext -- Constructor/constructor-like chain pre-initialization (ASSERT-checked setup path).
  • WheaErrorLogInitialize -- Main SMM init path that sets up protocol installs and dispatch registration.
  • WheaErrorLogCleanupOnError -- Unload/cleanup helper used when WheaErrorLogInitialize returns failure.

Internal Functions (Recovered Names)

  • WheaErrorLogRegisterSmiHandlers -- Protocol resolution and SMI registration orchestration.
  • WheaErrorLogHandler -- Core WHEA error record SMI handler.
  • WheaErrorLogEnableLoggingCallback -- SwSmi callback to enable WHEA logging.
  • WheaErrorLogDisableLoggingCallback -- SwSmi callback to disable WHEA logging.
  • WheaErrorLogSmiNotifyCallback -- SMM notify callback that clears transient logging flags.
  • WheaErrorLogClassifyErrorRecord -- Error record subtype classification and GUID handling.
  • WheaErrorLogGetStatusBlockBySeverity -- Selects status block for corrected / nonfatal severity.
  • WheaErrorLogInitMPSyncData -- Builds per-CPU sync-data arrays for up to 512 CPUs.

Recovered State Variables

  • gWheaErrorLoggingEnabled (formerly byte_40A0) -- master gate for WHEA logging.
  • gWheaStatusBlockReady (formerly byte_40A3) -- set when per-entry status blocks are ready.
  • gWheaErrorStatusBlockTable (at 0x3F28) -- status block array and entry count at qword_3F90.
  • gWheaPcdToken5 (formerly qword_40E0) -- cached platform configuration token result.
  • gWheaSmramDescriptorCount / gWheaSmramDescriptors (0x25328/0x25330) -- SMRAM range metadata.

Protocols/Dependencies

  • EFI_SMM_BASE2_PROTOCOL, EFI_SMM_CPU_PROTOCOL, EFI_SMM_SW_DISPATCH2
  • WHEA Boot Protocol, MP Service Protocol, PCD Protocol
  • MM PCI Root Bridge Protocol, SMM Access Protocol

Platform

Intel Purley (Skylake-SP Xeon), HR650X
Source: PurleyPlatPkg/Ras/Whea/WheaErrorLog/