# OemErrorLogDxe

- **Module:** 0090
- **File:** OemErrorLogDxe.efi
- **Size:** 6176 bytes (0x1820)
- **Phase:** DXE (Driver Execution Environment)

## Overview

OEM error logging DXE driver for HR650X BIOS. Registers to check CPU microcode version, stepping, and frequency consistency across all Application Processors (APs) versus the Boot Strap Processor (BSP). When mismatches are detected, it sends an IPMI SEL (System Event Log) entry via the IPMI transport protocol. Uses the EFI MP Services Protocol to enumerate processors and collect CPU configuration data via MSR reads and CPUID instructions.

## Key Functions

| Function | Description |
|---|---|
| `_ModuleEntryPoint` | UEFI driver entry point; initializes globals, registers OemCheckCpuInfoNotify as a notification callback |
| `OemCheckCpuInfoNotify` | Main callback; locates MP Services, allocates data arrays, collects BSP+AP CPU info, compares for mismatches, sends IPMI SEL if found |
| `ApCollectCpuInfo` | AP worker; reads microcode version (MSR 0x8B), stepping (CPUID leaf 1), frequency (MSR 0xCE Platform Info MSR) |
| `GetBmcLogBus` | Determines BMC bus number via IPMI command or "Setup" UEFI variable |
| `LocateIpmiTransport` | Locates the IPMI transport protocol |
| `GetHobList` | Retrieves HOB list pointer from system table |
| `DebugPrintWrapper` | CMOS-aware debug print routing |
| `DebugPrintCmosAware` | Wrapper for DEBUG() macro redirection |
| `GetDebugPrintProtocol` | Locates the debug print protocol |
| `CpuId` | CPUID instruction wrapper |
| `CompareGuidByQwords` | GUID comparison using 64-bit reads |

## Protocols/Dependencies

- **MP Services Protocol** - Multi-processor enumeration (StartupAllAPs, WhoAmI, GetNumberOfProcessors)
- **IPMI Transport Protocol** - For sending IPMI SEL records to BMC
- **Debug Print Protocol** - Debug output support
- IPMI commands: NetFn 0x2E (0x46, 0x01) for BMC bus detection
- MSR 0x8B (microcode version), MSR 0xCE (platform info / frequency), CPUID leaf 1 (stepping)
- Setup UEFI variable - BMC bus number configuration

## Platform

Lenovo ThinkSystem HR650X (Purley platform, Intel Xeon Scalable) - OEM error monitoring