19STATIC UINT32 *mHestErrorSourceCount;
20STATIC UINT16 *mHestErrorSourceType;
21STATIC UINT8 *mHestIA32HardwareBankCount;
29 L
"External Interrupt",
38 L
"External Interrupt - GSIV",
39 L
"Software Delegated Exception",
47 { L
"Error Source Count", 4, 36, L
"%d",
NULL,
48 (VOID **)&mHestErrorSourceCount,
NULL,
NULL },
68 { L
"Type", 2, 0, L
"%d",
NULL, (VOID **)&mHestErrorSourceType,
NULL,
NULL },
93 { L
"Address Register MSR Address", 4, 20, L
"0x%lx",
NULL,
NULL,
NULL,
NULL },
105 { L
"Switch To Polling Threshold Value", 1, 2, L
"%d",
NULL,
NULL,
NULL,
NULL },
106 { L
"Switch To Polling Threshold Window", 1, 3, L
"%d",
NULL,
NULL,
NULL,
NULL },
131 Type = *(UINT8 *)Ptr;
134 EFI_ACPI_6_5_HARDWARE_ERROR_NOTIFICATION_SOFTWARE_DELEGATED_EXCEPTION)
138 L
"\nERROR: Notification Structure Type must be <= 0x%x.",
139 EFI_ACPI_6_5_HARDWARE_ERROR_NOTIFICATION_SOFTWARE_DELEGATED_EXCEPTION
155 IN CONST CHAR16 *Format OPTIONAL,
160 if (Format !=
NULL) {
161 Print (Format, *(UINT32 *)Ptr);
165 Print (L
"0x%x\n", *Ptr);
187 IN CONST CHAR16 *Format OPTIONAL,
192 if (Format !=
NULL) {
193 Print (Format, *Ptr);
197 if (*Ptr <= EFI_ACPI_6_5_HARDWARE_ERROR_NOTIFICATION_SOFTWARE_DELEGATED_EXCEPTION) {
215 IN CONST CHAR16 *Format OPTIONAL,
220 if (Format !=
NULL) {
221 Print (Format, *(UINT32 *)Ptr);
225 Print (L
"0x%x\n", *Ptr);
246 { L
"Switch To Polling Threshold Value", 4, 12, L
"%d",
NULL,
NULL,
NULL,
NULL },
247 { L
"Switch To Polling Threshold Window", 4, 16, L
"%d ms",
NULL,
NULL,
NULL,
NULL },
272 Print (L
"\nERROR: bits[31:24] should must be zero...");
305 SourceFlags = *(UINT8 *)Ptr;
308 ~(EFI_ACPI_6_5_ERROR_SOURCE_FLAG_FIRMWARE_FIRST |
309 EFI_ACPI_6_5_ERROR_SOURCE_FLAG_GHES_ASSIST)) != 0)
312 Print (L
"\nERROR: Invalid IA32 source flags field value...");
315 if (((SourceFlags & EFI_ACPI_6_5_ERROR_SOURCE_FLAG_FIRMWARE_FIRST) != 0) &&
316 ((SourceFlags & EFI_ACPI_6_5_ERROR_SOURCE_FLAG_GHES_ASSIST) != 0))
319 Print (L
"\nERROR: GHES_ASSIST should be reserved if FIRMWARE_FIRST is set...");
343 SourceFlags = *(UINT8 *)Ptr;
346 ~(EFI_ACPI_6_5_ERROR_SOURCE_FLAG_FIRMWARE_FIRST |
347 EFI_ACPI_6_5_ERROR_SOURCE_FLAG_GLOBAL)) != 0)
350 Print (L
"\nERROR: Invalid PCI source flags field value...");
374 SourceFlags = *(UINT8 *)Ptr;
376 if (SourceFlags != 0) {
378 Print (L
"\nERROR: Ghes'source flags should be reserved...");
400 if (*(UINT8 *)Ptr > 1) {
402 Print (L
"\nERROR: Invalid Enabled field value must be either 0 or 1.");
426 BOOLEAN CheckRecordCount;
429 CheckRecordCount = ((BOOLEAN)(
UINTN)Context);
431 if ((CheckRecordCount) && (RecordCount == 0)) {
433 Print (L
"\nERROR: Record count must be >= 1...");
448 IN CONST CHAR16 *Format OPTIONAL,
466 if (Offset != Size) {
468 Print (L
"ERROR: Failed to parse Hardware Error Notification Structure!\n");
483 IN CONST CHAR16 *Format OPTIONAL,
488 if (Format !=
NULL) {
489 Print (Format, *(UINT32 *)Ptr);
493 Print (L
"0x%x\n", *Ptr);
520 UINT32 AcpiTableLength,
525 UINT8 *IA32BankStructPtr;
526 UINT32 TotalBankStructSize;
528 TotalBankStructSize = *mHestIA32HardwareBankCount *
531 if ((*Offset + TotalBankStructSize) > AcpiTableLength) {
534 L
"ERROR: Not enough data for "
535 "IA-32 Architecture Machine Check Exception Error source.\n"
537 return EFI_INVALID_PARAMETER;
540 for (Idx = 0; Idx < *mHestIA32HardwareBankCount; Idx++) {
541 IA32BankStructPtr = HestTable + *Offset;
545 "IA-32 Architecture Machine Check Bank Structure",
554 *mHestIA32HardwareBankCount = 0;
563#define PARSE_HEST_ERROR_SOURCE_COMMON_HEADER(FlagsValidateFunc, CheckRecordCount) \
564 { L"Type", 2, 0, L"%d", NULL, NULL, NULL, NULL }, \
565 { L"Source Id", 2, 2, L"%d", NULL, NULL, NULL, NULL }, \
566 { L"Reserved", 2, 4, NULL, NULL, NULL, NULL, NULL }, \
567 { L"Flags", 1, 6, NULL, DumpSourceFlags, NULL, \
568 FlagsValidateFunc, NULL }, \
569 { L"Enabled", 1, 7, L"%d", NULL, NULL, ValidateEnabledField, NULL }, \
570 { L"Number of Records to Pre-allocate", 4, 8, L"%d", NULL, NULL, \
571 ValidateRecordCount, (VOID *) ((UINTN) CheckRecordCount) }, \
572 { L"Max Sections Per Record", 4, 12, L"%d", NULL, NULL, \
573 ValidateRecordCount, (VOID *) ((UINTN) CheckRecordCount) }
579#define PARSE_HEST_PCI_ERROR_SOURCE_COMMON_HEADER() \
580 PARSE_HEST_ERROR_SOURCE_COMMON_HEADER(ValidatePciErrorSourceFlags, TRUE), \
581 { L"Bus", 4, 16, NULL, DumpPciBus, NULL, NULL, NULL }, \
582 { L"Device", 2, 20, L"%d", NULL, NULL, NULL, NULL }, \
583 { L"Function", 2, 22, L"%d", NULL, NULL, NULL, NULL }, \
584 { L"Device Control", 2, 24, L"%d", NULL, NULL, NULL, NULL }, \
585 { L"Reserved", 2, 26, NULL, NULL, NULL, NULL, NULL }, \
586 { L"Uncorrectable Error Mask", 4, 28, L"0x%lx", NULL, NULL, NULL, NULL }, \
587 { L"Uncorrectable Error Severity", 4, 32, L"%d", NULL, NULL, NULL, NULL }, \
588 { L"Correctable Error Mask", 4, 36, L"0x%lx", NULL, NULL, NULL, NULL }, \
589 { L"Advanced Error Capabilities and Control", 4, 40, L"%d", NULL, NULL, \
596#define PARSE_HEST_GHES_ERROR_SOURCE() \
597 { L"Type", 2, 0, L"%d", NULL, NULL, NULL, NULL }, \
598 { L"Source Id", 2, 2, L"%d", NULL, NULL, NULL, NULL }, \
599 { L"Related Source Id", 2, 4, L"0x%x", NULL, NULL, NULL, NULL }, \
600 { L"Flags", 1, 6, L"0x%x", NULL, NULL, ValidateGhesSourceFlags, NULL }, \
601 { L"Enabled", 1, 7, L"%d", NULL, NULL, ValidateEnabledField, NULL }, \
602 { L"Number of Records to Pre-allocate", 4, 8, L"%d", NULL, NULL, \
603 ValidateRecordCount, (VOID *) ((UINTN) TRUE) }, \
604 { L"Max Sections Per Record", 4, 12, L"%d", NULL, NULL, \
605 ValidateRecordCount, (VOID *) ((UINTN) TRUE) }, \
606 { L"Max Raw Data Length", 4, 16, L"%d", NULL, NULL, NULL, NULL }, \
607 { L"Error Status Address", 12, 20, NULL, DumpGas, NULL, NULL, NULL }, \
608 { L"Notification Structure", 28, 32, NULL, DumpNotificationStructure, \
609 NULL, NULL, NULL }, \
610 { L"Error Status Block Length", 4, 60, L"%d", NULL, NULL, NULL, NULL }
619 { L
"Global Capability Init Data",
621 { L
"Global Control Init Data",
623 { L
"Number of Hardware Banks",
624 1, 32, L
"%d",
NULL, (VOID **)&mHestIA32HardwareBankCount,
NULL,
NULL },
638 { L
"Notification Structure",
640 { L
"Number of Hardware Banks",
641 1, 44, L
"%d",
NULL, (VOID **)&mHestIA32HardwareBankCount,
NULL,
NULL },
657 { L
"Number of Records to Pre-allocate", 4, 8, L
"%d",
NULL,
NULL,
659 { L
"Max Sections Per Record", 4, 12, L
"%d",
NULL,
NULL,
671 { L
"Root Error Command",
691 { L
"Secondary Uncorrectable Error Mask",
693 { L
"Secondary Uncorrectable Error Severity",
695 { L
"Secondary Advanced Error Capabilities and Control",
727 { L
"Number of Hardware Banks", 1, 44, L
"%d",
NULL,
728 (VOID **)&mHestIA32HardwareBankCount,
NULL,
NULL },
751 IN UINT32 AcpiTableLength,
752 IN UINT8 AcpiTableRevision
757 UINT8 *ErrorSourcePtr;
758 UINT32 ParsedErrorSourceCount;
759 UINT32 CurErrorSourceType;
775 if (mHestErrorSourceCount ==
NULL) {
777 Print (L
"ERROR: Invalid Hardware Error Source Table Header...\n");
781 ParsedErrorSourceCount = 0;
782 CurErrorSourceType = EFI_ACPI_6_5_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION;
784 while ((Offset < AcpiTableLength) && (ParsedErrorSourceCount < *mHestErrorSourceCount)) {
785 ErrorSourcePtr = Ptr + Offset;
793 AcpiTableLength - Offset,
798 if (mHestErrorSourceType ==
NULL) {
800 Print (L
"ERROR: Invalid Error Source Structure...\n");
804 if (CurErrorSourceType > *mHestErrorSourceType) {
806 Print (L
"ERROR: Error Source Structure must be sorted in Type with ascending order...\n");
810 switch (*mHestErrorSourceType) {
811 case EFI_ACPI_6_5_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION:
815 "IA-32 Architecture Machine Check Exception",
829 if (EFI_ERROR (Status)) {
834 case EFI_ACPI_6_5_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK:
838 "IA-32 Architecture Corrected Machine Check",
852 if (EFI_ERROR (Status)) {
857 case EFI_ACPI_6_5_IA32_ARCHITECTURE_NMI_ERROR:
861 "IA-32 Architecture Non-Maskable Interrupt",
870 case EFI_ACPI_6_5_PCI_EXPRESS_ROOT_PORT_AER:
874 "PCI Express RootPort AER Structure",
882 case EFI_ACPI_6_5_PCI_EXPRESS_DEVICE_AER:
886 "PCI Express Device AER Structure",
894 case EFI_ACPI_6_5_PCI_EXPRESS_BRIDGE_AER:
898 "PCI Express Bridge AER Structure",
906 case EFI_ACPI_6_5_GENERIC_HARDWARE_ERROR:
910 "Generic Hardware Error Source Structure",
918 case EFI_ACPI_6_5_GENERIC_HARDWARE_ERROR_VERSION_2:
922 "Generic Hardware Error Source V2 Structure",
935 case EFI_ACPI_6_5_IA32_ARCHITECTURE_DEFERRED_MACHINE_CHECK:
939 "IA-32 Architecture Deferred Machine Check",
953 if (EFI_ERROR (Status)) {
960 Print (L
"ERROR: Invalid Error Source Descriptor Type(%d).\n", *mHestErrorSourceType);
964 ParsedErrorSourceCount++;
967 if (ParsedErrorSourceCount < *mHestErrorSourceCount) {
970 L
"ERROR: Invalid Error Source Count... Real:%d, ErrorSourceCount:%d\n",
971 ParsedErrorSourceCount,
972 *mHestErrorSourceCount
977 if (Offset < AcpiTableLength) {
979 Print (L
"ERROR: Invalid Error Source Count, There's more data...\n");
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI IncrementErrorCount(VOID)
UINT32 EFIAPI ParseAcpi(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
UINT32 EFIAPI ParseAcpiBitFields(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
#define PARSER_PARAMS(Parser)
#define PARSE_ACPI_HEADER(Info)
STATIC CONST ACPI_PARSER HestErrorSourcePciCommonBusParser[]
#define PARSE_HEST_GHES_ERROR_SOURCE()
STATIC CONST ACPI_PARSER HestErrorNotificationParser[]
#define PARSE_HEST_ERROR_SOURCE_COMMON_HEADER(FlagsValidateFunc, CheckRecordCount)
STATIC CONST ACPI_PARSER HestErrorSourcePciExpressBridgeAerParser[]
STATIC CONST ACPI_PARSER HestErrorNotificationCweParser[]
STATIC CONST ACPI_PARSER HestParser[]
STATIC VOID EFIAPI ValidateGhesSourceFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI ValidatePciErrorSourceFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER HestErrorSourceTypeParser[]
STATIC CONST ACPI_PARSER HestErrorSourcePciExpressRootPortAerParser[]
STATIC VOID EFIAPI DumpErrorNotificationCwe(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC CONST ACPI_PARSER HestErrorSourcePciExpressDeviceAerParser[]
STATIC VOID EFIAPI DumpPciBus(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC CONST ACPI_PARSER HestErrorSourceIA32ArchDeferredMachineCheckParser[]
STATIC CONST CHAR16 * HestErrorNotificationStructureTypeStr[]
#define PARSE_HEST_PCI_ERROR_SOURCE_COMMON_HEADER()
STATIC VOID EFIAPI DumpSourceFlags(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC CONST ACPI_PARSER HestErrorIA32ArchMachineCheckBankStructureParser[]
STATIC VOID EFIAPI ValidateIA32ErrorSourceFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER HestErrorSourceIA32ArchNonMaskableInterruptParser[]
STATIC CONST ACPI_PARSER HestErrorSourceGhesv2Parser[]
STATIC CONST ACPI_PARSER HestErrorSourceIA32ArchCorrectedMachineCheckParser[]
STATIC CONST ACPI_PARSER HestErrorSourceFlags[]
STATIC CONST ACPI_PARSER HestErrorSourceGhesParser[]
STATIC VOID EFIAPI ValidateEnabledField(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC EFI_STATUS EFIAPI DumpIA32ArchMachineCheckErrorBankStructure(IN UINT8 *HestTable, UINT32 AcpiTableLength, UINT32 *Offset)
VOID EFIAPI ParseAcpiHest(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC VOID EFIAPI ValidateErrorNotificationType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI ValidatePciBusReservedBits(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DumpNotificationStructure(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC VOID EFIAPI ValidateRecordCount(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER HestErrorSourceIA32ArchMachineCheckExceptionParser[]
STATIC VOID EFIAPI DumpErrorNotificationType(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)