From 471ddafeea4fbd1599e8b0293499e7ae18d23983 Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Mon, 20 Nov 2017 14:08:32 +0800 Subject: Add GCD test for ACPI resource reporting. Cc: Michael A Kubacki Cc: Amy Chan Cc: Chasel Chiu Cc: Brett Wang Cc: Daocheng Bu Cc: Isaac W Oram Cc: Rangasai V Chaganty Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao Reviewed-by: Amy Chan --- .../Include/Library/TestPointCheckLib.h | 11 +- Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 8 +- .../PlatformInit/PlatformInitDxe/PlatformInitDxe.c | 1 + .../Test/Library/TestPointCheckLib/DxeCheckAcpi.c | 663 ++++++++++++++++++--- .../Library/TestPointCheckLib/DxeCheckAcpiDmar.c | 39 +- .../Library/TestPointCheckLib/DxeCheckAcpiHpet.c | 20 +- .../Library/TestPointCheckLib/DxeCheckAcpiMadt.c | 96 ++- .../Library/TestPointCheckLib/DxeCheckAcpiMcfg.c | 29 + .../Library/TestPointCheckLib/DxeCheckAcpiTpm.c | 158 +++++ .../Library/TestPointCheckLib/DxeCheckAcpiWsmt.c | 3 +- .../TestPointCheckLib/DxeCheckDmaProtection.c | 10 +- .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 40 +- .../Library/TestPointCheckLib/DxeCheckMemoryMap.c | 17 +- .../TestPointCheckLib/DxeCheckTcgTrustedBoot.c | 14 + .../TestPointCheckLib/DxeTestPointCheckLib.c | 116 +++- .../TestPointCheckLib/DxeTestPointCheckLib.inf | 1 + .../TestPointCheckLib/SmmTestPointCheckLib.c | 10 +- .../TestPointCheckLibNull/TestPointCheckLibNull.c | 9 + 18 files changed, 1089 insertions(+), 156 deletions(-) create mode 100644 Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiTpm.c (limited to 'Platform') diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h index be6186dc03..08a5517a15 100644 --- a/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h +++ b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h @@ -137,6 +137,12 @@ TestPointReadyToBootAcpiTableFuntional ( VOID ); +EFI_STATUS +EFIAPI +TestPointReadyToBootGcdResourceFuntional ( + VOID + ); + EFI_STATUS EFIAPI TestPointReadyToBootMemoryTypeInformationFunctional ( @@ -315,6 +321,7 @@ TestPointSmmExitBootServices ( #define TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_BOOT_VARIABLE_FUNCTIONAL BIT2 #define TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_CONSOLE_VARIABLE_FUNCTIONAL BIT3 #define TEST_POINT_BYTE4_READY_TO_BOOT_ACPI_TABLE_FUNCTIONAL BIT4 +#define TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL BIT5 #define TEST_POINT_BYTE4_READY_TO_BOOT_MEMORY_TYPE_INFORMATION_FUNCTIONAL_ERROR_CODE L"0x04000000" #define TEST_POINT_BYTE4_READY_TO_BOOT_MEMORY_TYPE_INFORMATION_FUNCTIONAL_ERROR_STRING L"Invalid Memory Type Information\r\n" #define TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_MEMORY_ATTRIBUTE_TABLE_FUNCTIONAL_ERROR_CODE L"0x04010000" @@ -323,8 +330,10 @@ TestPointSmmExitBootServices ( #define TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_BOOT_VARIABLE_FUNCTIONAL_ERROR_STRING L"Invalid Boot Variable\r\n" #define TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_CONSOLE_VARIABLE_FUNCTIONAL_ERROR_CODE L"0x04030000" #define TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_CONSOLE_VARIABLE_FUNCTIONAL_ERROR_STRING L"Invalid Console Variable\r\n" -#define TEST_POINT_BYTE4_READY_TO_BOOT_ACPI_TABLE_FUNCTIONAL_ERROR_CODE L"0x03040000" +#define TEST_POINT_BYTE4_READY_TO_BOOT_ACPI_TABLE_FUNCTIONAL_ERROR_CODE L"0x04040000" #define TEST_POINT_BYTE4_READY_TO_BOOT_ACPI_TABLE_FUNCTIONAL_ERROR_STRING L"Invalid ACPI Table\r\n" +#define TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL_ERROR_CODE L"0x04050000" +#define TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL_ERROR_STRING L"Invalid GCD Resource\r\n" #define TEST_POINT_BYTE5_READY_TO_BOOT_UEFI_SECURE_BOOT_ENABLED BIT0 #define TEST_POINT_BYTE5_READY_TO_BOOT_PI_SIGNED_FV_BOOT_ENABLED BIT1 diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec index e928368f16..67eca3f394 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -178,10 +178,10 @@ gMinPlatformModuleTokenSpaceGuid.PcdHstiIbvPlatformFeature|{0x00, 0x00, 0x00}|VO # Stage debug: {0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} # Stage memory: {0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} # Stage UEFI boot: {0x03, 0x07, 0x03, 0x05, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -# Stage OS boot: {0x03, 0x07, 0x03, 0x05, 0x1F, 0x00, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -# Stage Secure boot: {0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -# Stage Advanced: {0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -gMinPlatformModuleTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00100302 +# Stage OS boot: {0x03, 0x07, 0x03, 0x05, 0x3F, 0x00, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +# Stage Secure boot: {0x03, 0x0F, 0x07, 0x1F, 0x3F, 0x0F, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +# Stage Advanced: {0x03, 0x0F, 0x07, 0x1F, 0x3F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +gMinPlatformModuleTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x3F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00100302 [PcdsDynamic] diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitDxe/PlatformInitDxe.c b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitDxe/PlatformInitDxe.c index fe2268ac6b..feb54e93b3 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitDxe/PlatformInitDxe.c +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitDxe/PlatformInitDxe.c @@ -303,6 +303,7 @@ PlatformInitStatusCodeListener ( if (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)) { if (!Tested) { TestPointReadyToBootAcpiTableFuntional (); + TestPointReadyToBootGcdResourceFuntional (); TestPointReadyToBootMemoryTypeInformationFunctional (); TestPointReadyToBootUefiMemoryAttributeTableFunctional (); TestPointReadyToBootUefiBootVariableFunctional (); diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c index fce46bd083..e704e8f59b 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c @@ -23,33 +23,145 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include +#include #include -EFI_STATUS +EFI_GCD_MEMORY_SPACE_DESCRIPTOR *mAcpiGcdMemoryMap; +EFI_GCD_IO_SPACE_DESCRIPTOR *mAcpiGcdIoMap; +UINTN mAcpiGcdMemoryMapNumberOfDescriptors; +UINTN mAcpiGcdIoMapNumberOfDescriptors; + +VOID DumpAcpiMadt ( IN EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt ); -EFI_STATUS +VOID DumpAcpiMcfg ( IN EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *Mcfg ); -EFI_STATUS +VOID DumpAcpiHpet ( IN EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *Hpet ); -EFI_STATUS +VOID DumpAcpiDmar ( IN EFI_ACPI_DMAR_HEADER *Dmar ); -EFI_STATUS +VOID DumpAcpiWsmt ( IN EFI_ACPI_WSMT_TABLE *Wsmt ); +VOID +DumpAcpiTpm2 ( + IN EFI_TPM2_ACPI_TABLE *Tpm2 + ); + +VOID +DumpAcpiTcpa ( + IN EFI_ACPI_DESCRIPTION_HEADER *Tcpa + ); + +EFI_STATUS +CheckAcpiMadt ( + IN EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt + ); + +EFI_STATUS +CheckAcpiMcfg ( + IN EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *Mcfg + ); + +EFI_STATUS +CheckAcpiHpet ( + IN EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *Hpet + ); + +EFI_STATUS +CheckAcpiDmar ( + IN EFI_ACPI_DMAR_HEADER *Dmar + ); + +EFI_STATUS +CheckAcpiTpm2 ( + IN EFI_TPM2_ACPI_TABLE *Tpm2 + ); + +EFI_STATUS +CheckAcpiTcpa ( + IN EFI_ACPI_DESCRIPTION_HEADER *Tcpa + ); + +VOID +TestPointDumpGcd ( + OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **GcdMemoryMap, OPTIONAL + OUT UINTN *GcdMemoryMapNumberOfDescriptors, OPTIONAL + OUT EFI_GCD_IO_SPACE_DESCRIPTOR **GcdIoMap, OPTIONAL + OUT UINTN *GcdIoMapNumberOfDescriptors, OPTIONAL + IN BOOLEAN DumpPrint + ); + +BOOLEAN +IsMmioExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ) +{ + UINTN Index; + for (Index = 0; Index < mAcpiGcdMemoryMapNumberOfDescriptors; Index++) { + if (mAcpiGcdMemoryMap[Index].GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) { + continue; + } + if ((BaseAddress >= mAcpiGcdMemoryMap[Index].BaseAddress) && + (BaseAddress + Length <= mAcpiGcdMemoryMap[Index].BaseAddress + mAcpiGcdMemoryMap[Index].Length)) { + if (CheckAllocated) { + if (mAcpiGcdMemoryMap[Index].ImageHandle != NULL) { + return TRUE; + } else { + return FALSE; + } + } else { + return TRUE; + } + } + } + return FALSE; +} + +BOOLEAN +IsIoExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ) +{ + UINTN Index; + for (Index = 0; Index < mAcpiGcdIoMapNumberOfDescriptors; Index++) { + if (mAcpiGcdIoMap[Index].GcdIoType != EfiGcdIoTypeIo) { + continue; + } + if ((BaseAddress >= mAcpiGcdIoMap[Index].BaseAddress) && + (BaseAddress + Length <= mAcpiGcdIoMap[Index].BaseAddress + mAcpiGcdIoMap[Index].Length)) { + if (CheckAllocated) { + if (mAcpiGcdIoMap[Index].ImageHandle != NULL) { + return TRUE; + } else { + return FALSE; + } + } else { + return TRUE; + } + } + } + return FALSE; +} + VOID DumpCharArray ( IN CHAR8 *Ch, @@ -79,7 +191,7 @@ DumpAcpiTableHeader ( DEBUG ((DEBUG_INFO, "\' 0x%08x |\n", Table->CreatorRevision)); } -EFI_STATUS +VOID DumpAcpiFadt ( IN EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt ) @@ -91,10 +203,269 @@ DumpAcpiFadt ( DEBUG ((DEBUG_INFO, " AcpiEnable=0x%02x", Fadt->AcpiEnable)); DEBUG ((DEBUG_INFO, " AcpiDisable=0x%02x", Fadt->AcpiDisable)); DEBUG ((DEBUG_INFO, "\n")); - return EFI_SUCCESS; } EFI_STATUS +CheckAcpiFadt ( + IN EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt + ) +{ + if (Fadt->SmiCmd != 0) { + if (!IsIoExit (Fadt->SmiCmd, 1, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.SmiCmd resource (0x%x) is not reported correctly.\n", Fadt->SmiCmd)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Pm1aEvtBlk != 0) { + if (!IsIoExit (Fadt->Pm1aEvtBlk, Fadt->Pm1EvtLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Pm1aEvtBlk resource (0x%x) is not reported correctly.\n", Fadt->Pm1aEvtBlk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Pm1bEvtBlk != 0) { + if (!IsIoExit (Fadt->Pm1bEvtBlk, Fadt->Pm1EvtLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Pm1bEvtBlk resource (0x%x) is not reported correctly.\n", Fadt->Pm1bEvtBlk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Pm1aCntBlk != 0) { + if (!IsIoExit (Fadt->Pm1aCntBlk, Fadt->Pm1CntLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Pm1aCntBlk resource (0x%x) is not reported correctly.\n", Fadt->Pm1aCntBlk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Pm1bCntBlk != 0) { + if (!IsIoExit (Fadt->Pm1bCntBlk, Fadt->Pm1CntLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Pm1bCntBlk resource (0x%x) is not reported correctly.\n", Fadt->Pm1bCntBlk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Pm2CntBlk != 0) { + if (!IsIoExit (Fadt->Pm2CntBlk, Fadt->Pm2CntLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Pm2CntBlk resource (0x%x) is not reported correctly.\n", Fadt->Pm2CntBlk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->PmTmrBlk != 0) { + if (!IsIoExit (Fadt->PmTmrBlk, Fadt->PmTmrLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.PmTmrBlk resource (0x%x) is not reported correctly.\n", Fadt->PmTmrBlk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Gpe0Blk != 0) { + if (!IsIoExit (Fadt->Gpe0Blk, Fadt->Gpe0BlkLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Gpe0Blk resource (0x%x) is not reported correctly.\n", Fadt->Gpe0Blk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Gpe1Blk != 0) { + if (!IsIoExit (Fadt->Gpe1Blk, Fadt->Gpe1BlkLen, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.Gpe1Blk resource (0x%x) is not reported correctly.\n", Fadt->Gpe1Blk)); + return EFI_NOT_STARTED; + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, ResetReg)) { + if (Fadt->ResetReg.Address != 0) { + switch (Fadt->ResetReg.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->ResetReg.Address, Fadt->ResetReg.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.ResetReg resource (0x%x) is not reported correctly.\n", Fadt->ResetReg.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->ResetReg.Address, Fadt->ResetReg.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.ResetReg resource (0x%x) is not reported correctly.\n", Fadt->ResetReg.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XPm1aEvtBlk)) { + if (Fadt->XPm1aEvtBlk.Address != 0) { + switch (Fadt->XPm1aEvtBlk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XPm1aEvtBlk.Address, Fadt->XPm1aEvtBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1aEvtBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1aEvtBlk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XPm1aEvtBlk.Address, Fadt->XPm1aEvtBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1aEvtBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1aEvtBlk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XPm1bEvtBlk)) { + if (Fadt->XPm1bEvtBlk.Address != 0) { + switch (Fadt->XPm1bEvtBlk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XPm1bEvtBlk.Address, Fadt->XPm1bEvtBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1bEvtBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1bEvtBlk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XPm1bEvtBlk.Address, Fadt->XPm1bEvtBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1bEvtBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1bEvtBlk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XPm1aCntBlk)) { + if (Fadt->XPm1aCntBlk.Address != 0) { + switch (Fadt->XPm1aCntBlk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XPm1aCntBlk.Address, Fadt->XPm1aCntBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1aCntBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1aCntBlk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XPm1aCntBlk.Address, Fadt->XPm1aCntBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1aCntBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1aCntBlk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XPm1bCntBlk)) { + if (Fadt->XPm1bCntBlk.Address != 0) { + switch (Fadt->XPm1bCntBlk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XPm1bCntBlk.Address, Fadt->XPm1bCntBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1bCntBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1bCntBlk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XPm1bCntBlk.Address, Fadt->XPm1bCntBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm1bCntBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm1bCntBlk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XPm2CntBlk)) { + if (Fadt->XPm2CntBlk.Address != 0) { + switch (Fadt->XPm2CntBlk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XPm2CntBlk.Address, Fadt->XPm2CntBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm2CntBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm2CntBlk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XPm2CntBlk.Address, Fadt->XPm2CntBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPm2CntBlk resource (0x%x) is not reported correctly.\n", Fadt->XPm2CntBlk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XPmTmrBlk)) { + if (Fadt->XPmTmrBlk.Address != 0) { + switch (Fadt->XPmTmrBlk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XPmTmrBlk.Address, Fadt->XPmTmrBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPmTmrBlk resource (0x%x) is not reported correctly.\n", Fadt->XPmTmrBlk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XPmTmrBlk.Address, Fadt->XPmTmrBlk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XPmTmrBlk resource (0x%x) is not reported correctly.\n", Fadt->XPmTmrBlk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XGpe0Blk)) { + if (Fadt->XGpe0Blk.Address != 0) { + switch (Fadt->XGpe0Blk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XGpe0Blk.Address, Fadt->XGpe0Blk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XGpe0Blk resource (0x%x) is not reported correctly.\n", Fadt->XGpe0Blk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XGpe0Blk.Address, Fadt->XGpe0Blk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XGpe0Blk resource (0x%x) is not reported correctly.\n", Fadt->XGpe0Blk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, XGpe1Blk)) { + if (Fadt->XGpe1Blk.Address != 0) { + switch (Fadt->XGpe1Blk.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->XGpe1Blk.Address, Fadt->XGpe1Blk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XGpe1Blk resource (0x%x) is not reported correctly.\n", Fadt->XGpe1Blk.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->XGpe1Blk.Address, Fadt->XGpe1Blk.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.XGpe1Blk resource (0x%x) is not reported correctly.\n", Fadt->XGpe1Blk.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, SleepControlReg)) { + if (Fadt->SleepControlReg.Address != 0) { + switch (Fadt->SleepControlReg.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->SleepControlReg.Address, Fadt->SleepControlReg.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.SleepControlReg resource (0x%x) is not reported correctly.\n", Fadt->SleepControlReg.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->SleepControlReg.Address, Fadt->SleepControlReg.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.SleepControlReg resource (0x%x) is not reported correctly.\n", Fadt->SleepControlReg.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + if (Fadt->Header.Length > OFFSET_OF(EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE, SleepStatusReg)) { + if (Fadt->SleepStatusReg.Address != 0) { + switch (Fadt->SleepStatusReg.AddressSpaceId) { + case EFI_ACPI_5_0_SYSTEM_MEMORY: + if (!IsMmioExit (Fadt->SleepStatusReg.Address, Fadt->SleepStatusReg.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.SleepStatusReg resource (0x%x) is not reported correctly.\n", Fadt->SleepStatusReg.Address)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_5_0_SYSTEM_IO: + if (!IsIoExit (Fadt->SleepStatusReg.Address, Fadt->SleepStatusReg.RegisterBitWidth/8, TRUE)) { + DEBUG ((DEBUG_ERROR, "FADT.SleepStatusReg resource (0x%x) is not reported correctly.\n", Fadt->SleepStatusReg.Address)); + return EFI_NOT_STARTED; + } + break; + } + } + } + return EFI_SUCCESS; +} + +VOID DumpAcpiFacs ( IN EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs ) @@ -104,25 +475,23 @@ DumpAcpiFacs ( DEBUG ((DEBUG_INFO, " : (0x%016lx) 0x%02x\n", Facs, Facs->Version)); DEBUG ((DEBUG_INFO, " ")); DEBUG ((DEBUG_INFO, " HardwareSignature=%08x\n", Facs->HardwareSignature)); - return EFI_SUCCESS; } -EFI_STATUS +VOID DumpAcpiTable ( IN EFI_ACPI_DESCRIPTION_HEADER *Table ) { EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt; - EFI_STATUS Status; if (Table == NULL) { - return EFI_INVALID_PARAMETER; + return ; } switch (Table->Signature) { case EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE: Fadt = (EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *)Table; - Status = DumpAcpiFadt (Fadt); + DumpAcpiFadt (Fadt); if (Fadt->Header.Revision >= EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) { if (Fadt->XFirmwareCtrl != 0) { DumpAcpiFacs ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->XFirmwareCtrl); @@ -138,26 +507,90 @@ DumpAcpiTable ( DumpAcpiFacs ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->FirmwareCtrl); DumpAcpiTable ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Fadt->Dsdt); } - return Status; + break; case EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE: - Status = DumpAcpiMadt ((EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)Table); - return Status; + DumpAcpiMadt ((EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)Table); + break; case EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE: - Status = DumpAcpiMcfg ((EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *)Table); - return Status; + DumpAcpiMcfg ((EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *)Table); + break; case EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE: - Status = DumpAcpiHpet ((EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *)Table); - return Status; + DumpAcpiHpet ((EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *)Table); + break; case EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE: - Status = DumpAcpiDmar ((EFI_ACPI_DMAR_HEADER *)Table); - return Status; + DumpAcpiDmar ((EFI_ACPI_DMAR_HEADER *)Table); + break; case EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE: - Status = DumpAcpiWsmt ((EFI_ACPI_WSMT_TABLE *)Table); - return Status; + DumpAcpiWsmt ((EFI_ACPI_WSMT_TABLE *)Table); + break; + case EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE: + DumpAcpiTpm2 ((EFI_TPM2_ACPI_TABLE *)Table); + break; + case EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE: + DumpAcpiTcpa ((VOID *)Table); + break; default: + DumpAcpiTableHeader (Table); break; } - DumpAcpiTableHeader (Table); +} + +EFI_STATUS +CheckAcpiTableResource ( + IN EFI_ACPI_DESCRIPTION_HEADER *Table + ) +{ + EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt; + + if (Table == NULL) { + return EFI_INVALID_PARAMETER; + } + + switch (Table->Signature) { + case EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE: + Fadt = (EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *)Table; + CheckAcpiFadt (Fadt); + if (Fadt->Header.Revision >= EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) { + if (Fadt->XFirmwareCtrl != 0) { + // CheckAcpiFacs ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->XFirmwareCtrl); + } else { + // CheckAcpiFacs ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->FirmwareCtrl); + } + if (Fadt->XDsdt != 0) { + // CheckAcpiDsdt ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Fadt->XDsdt); + } else { + // CheckAcpiDsdt ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Fadt->Dsdt); + } + } else { + // CheckAcpiFacs ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->FirmwareCtrl); + // CheckAcpiDsdt ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Fadt->Dsdt); + } + break; + case EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE: + return CheckAcpiMadt ((EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)Table); + break; + case EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE: + return CheckAcpiMcfg ((EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *)Table); + break; + case EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE: + return CheckAcpiHpet ((EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *)Table); + break; + case EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE: + return CheckAcpiDmar ((EFI_ACPI_DMAR_HEADER *)Table); + break; + case EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE: + // CheckAcpiWsmt ((EFI_ACPI_WSMT_TABLE *)Table); + break; + case EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE: + return CheckAcpiTpm2 ((EFI_TPM2_ACPI_TABLE *)Table); + break; + case EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE: + return CheckAcpiTcpa ((VOID *)Table); + break; + default: + break; + } + return EFI_SUCCESS; } @@ -165,114 +598,148 @@ EFI_STATUS DumpAcpiRsdt ( IN EFI_ACPI_DESCRIPTION_HEADER *Rsdt, IN UINT32 *Signature, OPTIONAL - OUT VOID **OutTable + OUT VOID **OutTable, + IN BOOLEAN DumpPrint, + IN BOOLEAN CheckResource ) { - EFI_STATUS Status; UINTN Index; UINT32 EntryCount; UINT32 *EntryPtr; EFI_ACPI_DESCRIPTION_HEADER *Table; - BOOLEAN Result; + EFI_STATUS Status; + EFI_STATUS ReturnStatus; if (Rsdt == NULL) { return EFI_INVALID_PARAMETER; } + if (OutTable != NULL) { + *OutTable = NULL; + } + + ReturnStatus = EFI_SUCCESS; EntryCount = (Rsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / sizeof(UINT32); EntryPtr = (UINT32 *)(Rsdt + 1); - Result = TRUE; for (Index = 0; Index < EntryCount; Index ++, EntryPtr ++) { Table = (EFI_ACPI_DESCRIPTION_HEADER *)((UINTN)(*EntryPtr)); - Status = DumpAcpiTable (Table); - if (EFI_ERROR(Status)) { - Result = FALSE; + if (DumpPrint) { + DumpAcpiTable (Table); + } + if (CheckResource) { + Status = CheckAcpiTableResource (Table); + if (EFI_ERROR(Status)) { + ReturnStatus = Status; + } } if (Signature != NULL && Table->Signature == *Signature) { *OutTable = Table; } } - if (!Result) { - return EFI_INVALID_PARAMETER; + + if (OutTable != NULL) { + if (*OutTable == NULL) { + return EFI_NOT_FOUND; + } } - return EFI_SUCCESS; + + return ReturnStatus; } EFI_STATUS DumpAcpiXsdt ( IN EFI_ACPI_DESCRIPTION_HEADER *Xsdt, IN UINT32 *Signature, OPTIONAL - OUT VOID **OutTable + OUT VOID **OutTable, + IN BOOLEAN DumpPrint, + IN BOOLEAN CheckResource ) { - EFI_STATUS Status; UINTN Index; UINT32 EntryCount; UINT64 EntryPtr; UINTN BasePtr; EFI_ACPI_DESCRIPTION_HEADER *Table; - BOOLEAN Result; + EFI_STATUS Status; + EFI_STATUS ReturnStatus; if (Xsdt == NULL) { return EFI_INVALID_PARAMETER; } + + if (OutTable != NULL) { + *OutTable = NULL; + } + ReturnStatus = EFI_SUCCESS; EntryCount = (Xsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / sizeof(UINT64); BasePtr = (UINTN)(Xsdt + 1); - Result = TRUE; for (Index = 0; Index < EntryCount; Index ++) { CopyMem (&EntryPtr, (VOID *)(BasePtr + Index * sizeof(UINT64)), sizeof(UINT64)); Table = (EFI_ACPI_DESCRIPTION_HEADER *)((UINTN)(EntryPtr)); - Status = DumpAcpiTable (Table); - if (EFI_ERROR(Status)) { - Result = FALSE; + if (DumpPrint) { + DumpAcpiTable (Table); + } + if (CheckResource) { + Status = CheckAcpiTableResource (Table); + if (EFI_ERROR(Status)) { + ReturnStatus = Status; + } } if (Signature != NULL && Table->Signature == *Signature) { *OutTable = Table; } } - if (!Result) { - return EFI_INVALID_PARAMETER; + + if (OutTable != NULL) { + if (*OutTable == NULL) { + return EFI_NOT_FOUND; + } } - return EFI_SUCCESS; + + return ReturnStatus; } EFI_STATUS DumpAcpiRsdp ( IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp, IN UINT32 *Signature, OPTIONAL - OUT VOID **Table + OUT VOID **Table, + IN BOOLEAN DumpPrint, + IN BOOLEAN CheckResource ) { EFI_STATUS Status; EFI_ACPI_DESCRIPTION_HEADER *Rsdt; EFI_ACPI_DESCRIPTION_HEADER *Xsdt; - DumpCharArray ((CHAR8 *)&Rsdp->Signature, sizeof(Rsdp->Signature)); - DEBUG ((DEBUG_INFO, ": (0x%016lx) 0x%02x \'", Rsdp, Rsdp->Revision)); - DumpCharArray (Rsdp->OemId, sizeof(Rsdp->OemId)); - DEBUG ((DEBUG_INFO, "\'\n")); - DEBUG ((DEBUG_INFO, " ")); - DEBUG ((DEBUG_INFO, " RSDT=0x%08x XSDT=0x%016lx\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress)); + if (DumpPrint) { + DumpCharArray ((CHAR8 *)&Rsdp->Signature, sizeof(Rsdp->Signature)); + DEBUG ((DEBUG_INFO, ": (0x%016lx) 0x%02x \'", Rsdp, Rsdp->Revision)); + DumpCharArray (Rsdp->OemId, sizeof(Rsdp->OemId)); + DEBUG ((DEBUG_INFO, "\'\n")); + DEBUG ((DEBUG_INFO, " ")); + DEBUG ((DEBUG_INFO, " RSDT=0x%08x XSDT=0x%016lx\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress)); - if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) { - DumpAcpiTable ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Rsdp->XsdtAddress); + if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) { + DumpAcpiTable ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Rsdp->XsdtAddress); + } + DumpAcpiTable ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Rsdp->RsdtAddress); } - DumpAcpiTable ((EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Rsdp->RsdtAddress); // // Search XSDT // if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) { Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) Rsdp->XsdtAddress; - Status = DumpAcpiXsdt (Xsdt, Signature, Table); + Status = DumpAcpiXsdt (Xsdt, Signature, Table, DumpPrint, CheckResource); } else { // // Search RSDT // Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) Rsdp->RsdtAddress; - Status = DumpAcpiRsdt (Rsdt, Signature, Table); + Status = DumpAcpiRsdt (Rsdt, Signature, Table, DumpPrint, CheckResource); } return Status; @@ -282,7 +749,9 @@ EFI_STATUS DumpAcpiWithGuid ( IN EFI_GUID *AcpiTableGuid, IN UINT32 *Signature, OPTIONAL - OUT VOID **Table + OUT VOID **Table, + IN BOOLEAN DumpPrint, + IN BOOLEAN CheckResource ) { VOID *Rsdp; @@ -293,32 +762,31 @@ DumpAcpiWithGuid ( return EFI_NOT_FOUND; } - Status = DumpAcpiRsdp (Rsdp, Signature, Table); + Status = DumpAcpiRsdp (Rsdp, Signature, Table, DumpPrint, CheckResource); return Status; } EFI_STATUS TestPointCheckAcpi ( - IN UINT32 *Signature OPTIONAL + VOID ) { EFI_STATUS Status; - VOID *Table; DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpi - Enter\n")); DEBUG ((DEBUG_INFO, "AcpiTable :\n")); DEBUG ((DEBUG_INFO, " Table Address Rev OemId OemTableId OemRev Creat CreatorRev\n")); - Table = NULL; - Status = DumpAcpiWithGuid (&gEfiAcpi20TableGuid, Signature, &Table); + // + // First dump + // + Status = DumpAcpiWithGuid (&gEfiAcpi20TableGuid, NULL, NULL, TRUE, FALSE); if (Status == EFI_NOT_FOUND) { - Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, Signature, &Table); + Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, TRUE, FALSE); } - - DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpi - Exit\n")); - if ((Signature == NULL) && (EFI_ERROR(Status))) { + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "No ACPI table\n")); TestPointLibAppendErrorString ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, @@ -329,31 +797,52 @@ TestPointCheckAcpi ( ); } - if ((Signature != NULL) && (*Signature == EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE) && - ((EFI_ERROR(Status)) || (Table == NULL))) { - DEBUG ((DEBUG_ERROR, "No WSMT table\n")); - TestPointLibAppendErrorString ( - PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - NULL, - TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL_ERROR_CODE \ - TEST_POINT_DXE_SMM_READY_TO_LOCK \ - TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL_ERROR_STRING - ); - Status = EFI_INVALID_PARAMETER; + DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpi - Exit\n")); + + return Status; +} + +EFI_STATUS +TestPointCheckAcpiGcdResource ( + VOID + ) +{ + EFI_STATUS Status; + + DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpiGcdResource - Enter\n")); + + // + // Check the ACPI existence + // + Status = DumpAcpiWithGuid (&gEfiAcpi20TableGuid, NULL, NULL, FALSE, FALSE); + if (Status == EFI_NOT_FOUND) { + Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE, FALSE); + } + + if (!EFI_ERROR(Status)) { + // + // Then check resource in ACPI and GCD + // + TestPointDumpGcd (&mAcpiGcdMemoryMap, &mAcpiGcdMemoryMapNumberOfDescriptors, &mAcpiGcdIoMap, &mAcpiGcdIoMapNumberOfDescriptors, FALSE); + + Status = DumpAcpiWithGuid (&gEfiAcpi20TableGuid, NULL, NULL, FALSE, TRUE); + if (Status == EFI_NOT_FOUND) { + Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE, TRUE); + } } - if ((Signature != NULL) && (*Signature == EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE) && - ((EFI_ERROR(Status)) || (Table == NULL))) { - DEBUG ((DEBUG_ERROR, "No DMAR table\n")); + + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_ERROR, "ACPI table resource not in GCD\n")); TestPointLibAppendErrorString ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL_ERROR_CODE \ - TEST_POINT_END_OF_DXE \ - TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL_ERROR_STRING + TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL_ERROR_CODE \ + TEST_POINT_READY_TO_BOOT \ + TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL_ERROR_STRING ); - Status = EFI_INVALID_PARAMETER; } - + DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpiGcdResource - Exit\n")); + return Status; } @@ -365,9 +854,9 @@ TestPointGetAcpi ( EFI_STATUS Status; VOID *Table; - Status = DumpAcpiWithGuid (&gEfiAcpi20TableGuid, &Signature, &Table); + Status = DumpAcpiWithGuid (&gEfiAcpi20TableGuid, &Signature, &Table, FALSE, FALSE); if (Status == EFI_NOT_FOUND) { - Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, &Signature, &Table); + Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, &Signature, &Table, FALSE, FALSE); } if (EFI_ERROR(Status)) { diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiDmar.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiDmar.c index 7277389a23..3f6b3afe99 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiDmar.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiDmar.c @@ -33,6 +33,13 @@ DumpAcpiTableHeader ( IN EFI_ACPI_DESCRIPTION_HEADER *Table ); +BOOLEAN +IsMmioExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ); + CHAR8 *mDmarTypeString[] = { "DRHD ", "RMRR ", @@ -110,7 +117,7 @@ DumpDmarDeviceScope ( } } -EFI_STATUS +VOID DumpAcpiDmar ( IN EFI_ACPI_DMAR_HEADER *Dmar ) @@ -206,5 +213,33 @@ DumpAcpiDmar ( DmarStructHeader = (EFI_ACPI_DMAR_STRUCTURE_HEADER *)((UINT8 *)DmarStructHeader + DmarStructHeader->Length); DmarLen -= DmarStructHeader->Length; } - return EFI_SUCCESS; } + +EFI_STATUS +CheckAcpiDmar ( + IN EFI_ACPI_DMAR_HEADER *Dmar + ) +{ + EFI_ACPI_DMAR_STRUCTURE_HEADER *DmarStructHeader; + INTN DmarLen; + EFI_ACPI_DMAR_DRHD_HEADER *Drhd; + + DmarLen = Dmar->Header.Length - sizeof(EFI_ACPI_DMAR_HEADER); + DmarStructHeader = (EFI_ACPI_DMAR_STRUCTURE_HEADER *)(Dmar + 1); + while (DmarLen > 0) { + switch (DmarStructHeader->Type) { + case EFI_ACPI_DMAR_TYPE_DRHD: + Drhd = (EFI_ACPI_DMAR_DRHD_HEADER *)DmarStructHeader; + if (!IsMmioExit (Drhd->RegisterBaseAddress, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "DMAR.DRHD resource (0x%x) is not reported correctly.\n", Drhd->RegisterBaseAddress)); + return EFI_NOT_STARTED; + } + break; + default: + break; + } + DmarStructHeader = (EFI_ACPI_DMAR_STRUCTURE_HEADER *)((UINT8 *)DmarStructHeader + DmarStructHeader->Length); + DmarLen -= DmarStructHeader->Length; + } + return EFI_SUCCESS; +} \ No newline at end of file diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiHpet.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiHpet.c index 4eba26ca8f..5747f51edb 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiHpet.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiHpet.c @@ -33,7 +33,14 @@ DumpAcpiTableHeader ( IN EFI_ACPI_DESCRIPTION_HEADER *Table ); -EFI_STATUS +BOOLEAN +IsMmioExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ); + +VOID DumpAcpiHpet ( IN EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *Hpet ) @@ -48,5 +55,16 @@ DumpAcpiHpet ( DEBUG ((DEBUG_INFO, " MinClockTick=0x%04x", Hpet->MainCounterMinimumClockTickInPeriodicMode)); DEBUG ((DEBUG_INFO, " PageProtection=0x%02x", Hpet->PageProtectionAndOemAttribute)); DEBUG ((DEBUG_INFO, "\n")); +} + +EFI_STATUS +CheckAcpiHpet ( + IN EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *Hpet + ) +{ + if (!IsMmioExit (Hpet->BaseAddressLower32Bit.Address, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "HPET resource (0x%x) is not reported correctly.\n", Hpet->BaseAddressLower32Bit.Address)); + return EFI_NOT_STARTED; + } return EFI_SUCCESS; } diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMadt.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMadt.c index 9da138daad..c1bf431ebd 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMadt.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMadt.c @@ -32,6 +32,13 @@ DumpAcpiTableHeader ( IN EFI_ACPI_DESCRIPTION_HEADER *Table ); +BOOLEAN +IsMmioExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ); + typedef struct { UINT8 Type; UINT8 Length; @@ -66,7 +73,7 @@ ShortNameOfMadtType( } } -EFI_STATUS +VOID DumpAcpiMadt ( IN EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt ) @@ -237,5 +244,90 @@ DumpAcpiMadt ( ApicStructHeader = (APIC_STRUCT_HEADER *)((UINT8 *)ApicStructHeader + ApicStructHeader->Length); MadtLen -= ApicStructHeader->Length; } - return EFI_SUCCESS; } + +EFI_STATUS +CheckAcpiMadt ( + IN EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt + ) +{ + + APIC_STRUCT_HEADER *ApicStructHeader; + INTN MadtLen; + EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_STRUCTURE *ProcessorLocalApic; + EFI_ACPI_4_0_IO_APIC_STRUCTURE *IOApic; + EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE *InterruptSourceOverride; + EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE *NonMaskableInterruptSource; + EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE *LocalApicNMI; + EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE *LocalApicAddressOverride; + EFI_ACPI_4_0_IO_SAPIC_STRUCTURE *IOSapic; + EFI_ACPI_4_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE *ProcessorLocalSapic; + EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE *PlatformInterruptSource; + EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE *ProcessorLocalX2Apic; + EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE *LocalX2ApicNmi; + + if (!IsMmioExit (Madt->LocalApicAddress, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "MADT resource (0x%x) is not reported correctly.\n", Madt->LocalApicAddress)); + return EFI_NOT_STARTED; + } + + // + // Sub table + // + MadtLen = Madt->Header.Length - sizeof(EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); + ApicStructHeader = (APIC_STRUCT_HEADER *)(Madt + 1); + while (MadtLen > 0) { + switch (ApicStructHeader->Type) { + case EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC: + ProcessorLocalApic = (EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_IO_APIC: + IOApic = (EFI_ACPI_4_0_IO_APIC_STRUCTURE *)ApicStructHeader; + if (!IsMmioExit (IOApic->IoApicAddress, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "MADT.IOAPIC resource (0x%x) is not reported correctly.\n", IOApic->IoApicAddress)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE: + InterruptSourceOverride = (EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE: + NonMaskableInterruptSource = (EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_LOCAL_APIC_NMI: + LocalApicNMI = (EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE: + LocalApicAddressOverride = (EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE *)ApicStructHeader; + if (!IsMmioExit (LocalApicAddressOverride->LocalApicAddress, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "MADT.LocalApicOverride resource (0x%x) is not reported correctly.\n", LocalApicAddressOverride->LocalApicAddress)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_4_0_IO_SAPIC: + IOSapic = (EFI_ACPI_4_0_IO_SAPIC_STRUCTURE *)ApicStructHeader; + if (!IsMmioExit (IOSapic->IoSapicAddress, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "MADT.IOSAPIC resource (0x%x) is not reported correctly.\n", IOSapic->IoSapicAddress)); + return EFI_NOT_STARTED; + } + break; + case EFI_ACPI_4_0_LOCAL_SAPIC: + ProcessorLocalSapic = (EFI_ACPI_4_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES: + PlatformInterruptSource = (EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC: + ProcessorLocalX2Apic = (EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE *)ApicStructHeader; + break; + case EFI_ACPI_4_0_LOCAL_X2APIC_NMI: + LocalX2ApicNmi = (EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE *)ApicStructHeader; + break; + default: + break; + } + ApicStructHeader = (APIC_STRUCT_HEADER *)((UINT8 *)ApicStructHeader + ApicStructHeader->Length); + MadtLen -= ApicStructHeader->Length; + } + return EFI_SUCCESS; +} \ No newline at end of file diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMcfg.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMcfg.c index 097a688004..c4d3472af9 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMcfg.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiMcfg.c @@ -33,6 +33,13 @@ DumpAcpiTableHeader ( IN EFI_ACPI_DESCRIPTION_HEADER *Table ); +BOOLEAN +IsMmioExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ); + EFI_STATUS DumpAcpiMcfg ( IN EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *Mcfg @@ -61,3 +68,25 @@ DumpAcpiMcfg ( } return EFI_SUCCESS; } + +EFI_STATUS +CheckAcpiMcfg ( + IN EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER *Mcfg + ) +{ + EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE *Struct; + UINTN Count; + UINTN Index; + + Count = Mcfg->Header.Length - sizeof(EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER); + Count = Count / sizeof(EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE); + Struct = (VOID *)(Mcfg + 1); + for (Index = 0; Index < Count; Index++) { + if (!IsMmioExit (Struct->BaseAddress, (Struct->EndBusNumber - Struct->StartBusNumber + 1) * SIZE_1MB, TRUE)) { + DEBUG ((DEBUG_ERROR, "MCFG resource (0x%x) is not reported correctly.\n", Struct->BaseAddress)); + return EFI_NOT_STARTED; + } + Struct++; + } + return EFI_SUCCESS; +} \ No newline at end of file diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiTpm.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiTpm.c new file mode 100644 index 0000000000..31aef8f4bf --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiTpm.c @@ -0,0 +1,158 @@ +/** @file + +Copyright (c) 2017, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +VOID +DumpCharArray ( + IN CHAR8 *Ch, + IN UINTN Size + ); + +VOID +DumpAcpiTableHeader ( + IN EFI_ACPI_DESCRIPTION_HEADER *Table + ); + +BOOLEAN +IsMmioExit ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN BOOLEAN CheckAllocated + ); + +VOID +DumpAcpiTpm2 ( + IN EFI_TPM2_ACPI_TABLE *Tpm2 + ) +{ + DumpAcpiTableHeader (&Tpm2->Header); + DEBUG ((DEBUG_INFO, " ")); + DEBUG ((DEBUG_INFO, " Flags=0x%08x ControlArea=0x%016lx StartMethod=0x%08x\n", Tpm2->Flags, Tpm2->AddressOfControlArea, Tpm2->StartMethod)); +} + +VOID +DumpAcpiTcpaClient ( + IN EFI_TCG_CLIENT_ACPI_TABLE *TcpaClient + ) +{ + DumpAcpiTableHeader (&TcpaClient->Header); + DEBUG ((DEBUG_INFO, " ")); + DEBUG ((DEBUG_INFO, " PlatformClass=0x%04x Laml=0x%08x Lasa=0x%016lx\n", + TcpaClient->PlatformClass, TcpaClient->Laml, TcpaClient->Lasa)); +} + +VOID +DumpAcpiTcpaServer ( + IN EFI_TCG_SERVER_ACPI_TABLE *TcpaServer + ) +{ + DumpAcpiTableHeader (&TcpaServer->Header); + DEBUG ((DEBUG_INFO, " ")); + DEBUG ((DEBUG_INFO, " PlatformClass=0x%04x Laml=0x%016lx Lasa=0x%016lx\n", + TcpaServer->PlatformClass, TcpaServer->Laml, TcpaServer->Lasa)); +} + +VOID +DumpAcpiTcpa ( + IN EFI_ACPI_DESCRIPTION_HEADER *Tcpa + ) +{ + EFI_TCG_CLIENT_ACPI_TABLE *TcpaClient; + TcpaClient = (VOID *)Tcpa; + switch (TcpaClient->PlatformClass) { + case TCG_PLATFORM_TYPE_CLIENT: + DumpAcpiTcpaClient((VOID *)Tcpa); + break; + case TCG_PLATFORM_TYPE_SERVER: + DumpAcpiTcpaServer((VOID *)Tcpa); + break; + default: + DumpAcpiTableHeader (Tcpa); + DEBUG ((DEBUG_INFO, " ")); + DEBUG ((DEBUG_INFO, " PlatformClass=0x%04x\n", TcpaClient->PlatformClass)); + break; + } +} + +EFI_STATUS +CheckAcpiTpm2 ( + IN EFI_TPM2_ACPI_TABLE *Tpm2 + ) +{ + switch (Tpm2->StartMethod) { + case EFI_TPM2_ACPI_TABLE_START_METHOD_TIS: + if (!IsMmioExit (0xFED40000, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "TPM2 resource (0x%x) is not reported correctly.\n", 0xFED40000)); + return EFI_NOT_STARTED; + } + break; + default: + break; + } + return EFI_SUCCESS; +} + +EFI_STATUS +CheckAcpiTcpaClient ( + IN EFI_TCG_CLIENT_ACPI_TABLE *TcpaClient + ) +{ + if (!IsMmioExit (0xFED40000, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "TCPA.client resource (0x%x) is not reported correctly.\n", 0xFED40000)); + return EFI_NOT_STARTED; + } + return EFI_SUCCESS; +} + +EFI_STATUS +CheckAcpiTcpaServer ( + IN EFI_TCG_SERVER_ACPI_TABLE *TcpaServer + ) +{ + if (!IsMmioExit (TcpaServer->BaseAddress.Address, SIZE_4KB, TRUE)) { + DEBUG ((DEBUG_ERROR, "TCPA.server resource (0x%x) is not reported correctly.\n", 0xFED40000)); + return EFI_NOT_STARTED; + } + return EFI_SUCCESS; +} + +EFI_STATUS +CheckAcpiTcpa ( + IN EFI_ACPI_DESCRIPTION_HEADER *Tcpa + ) +{ + EFI_TCG_CLIENT_ACPI_TABLE *TcpaClient; + TcpaClient = (VOID *)Tcpa; + switch (TcpaClient->PlatformClass) { + case TCG_PLATFORM_TYPE_CLIENT: + return CheckAcpiTcpaClient((VOID *)Tcpa); + break; + case TCG_PLATFORM_TYPE_SERVER: + return CheckAcpiTcpaServer((VOID *)Tcpa); + break; + default: + break; + } + return EFI_UNSUPPORTED; +} diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiWsmt.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiWsmt.c index 001b1d4357..525150dc01 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiWsmt.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpiWsmt.c @@ -33,7 +33,7 @@ DumpAcpiTableHeader ( IN EFI_ACPI_DESCRIPTION_HEADER *Table ); -EFI_STATUS +VOID DumpAcpiWsmt ( IN EFI_ACPI_WSMT_TABLE *Wsmt ) @@ -41,5 +41,4 @@ DumpAcpiWsmt ( DumpAcpiTableHeader (&Wsmt->Header); DEBUG ((DEBUG_INFO, " ")); DEBUG ((DEBUG_INFO, " ProtectionFlags=0x%08x\n", Wsmt->ProtectionFlags)); - return EFI_SUCCESS; } diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckDmaProtection.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckDmaProtection.c index e24ca90463..17d58bf3f5 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckDmaProtection.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckDmaProtection.c @@ -24,6 +24,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +VOID * +TestPointGetAcpi ( + IN UINT32 Signature + ); + EFI_STATUS CheckDrhd ( IN EFI_ACPI_DMAR_HEADER *Dmar @@ -64,11 +69,6 @@ CheckDrhd ( return EFI_SUCCESS; } -VOID * -TestPointGetAcpi ( - IN UINT32 Signature - ); - EFI_STATUS TestPointVtdEngine ( VOID diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c index 2f40573368..c6dceaed46 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c @@ -19,6 +19,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +EFI_STATUS +TestPointCheckAcpiGcdResource ( + VOID + ); + CHAR8 *mGcdMemoryTypeShortName[] = { " NE ", " RSVD", @@ -183,7 +188,8 @@ TestPointDumpGcd ( OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **GcdMemoryMap, OPTIONAL OUT UINTN *GcdMemoryMapNumberOfDescriptors, OPTIONAL OUT EFI_GCD_IO_SPACE_DESCRIPTOR **GcdIoMap, OPTIONAL - OUT UINTN *GcdIoMapNumberOfDescriptors OPTIONAL + OUT UINTN *GcdIoMapNumberOfDescriptors, OPTIONAL + IN BOOLEAN DumpPrint ) { EFI_STATUS Status; @@ -201,8 +207,10 @@ TestPointDumpGcd ( *GcdIoMapNumberOfDescriptors = 0; } - DEBUG ((DEBUG_INFO, "==== TestPointDumpGcd - Enter\n")); - DEBUG ((DEBUG_INFO, "GCD MEM:\n")); + if (DumpPrint) { + DEBUG ((DEBUG_INFO, "==== TestPointDumpGcd - Enter\n")); + DEBUG ((DEBUG_INFO, "GCD MEM:\n")); + } NumberOfDescriptors = 0; MemoryMap = NULL; Status = gDS->GetMemorySpaceMap ( @@ -210,9 +218,11 @@ TestPointDumpGcd ( &MemoryMap ); if (!EFI_ERROR (Status)) { - PrintMemoryDescriptorHeader (); - for (Index = 0; Index < NumberOfDescriptors; Index++) { - PrintMemoryDescriptor (&MemoryMap[Index]); + if (DumpPrint) { + PrintMemoryDescriptorHeader (); + for (Index = 0; Index < NumberOfDescriptors; Index++) { + PrintMemoryDescriptor (&MemoryMap[Index]); + } } if (GcdMemoryMap != NULL) { *GcdMemoryMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemoryMap); @@ -220,7 +230,9 @@ TestPointDumpGcd ( } } - DEBUG ((DEBUG_INFO, "GCD IO:\n")); + if (DumpPrint) { + DEBUG ((DEBUG_INFO, "GCD IO:\n")); + } NumberOfDescriptors = 0; IoMap = NULL; Status = gDS->GetIoSpaceMap ( @@ -228,16 +240,20 @@ TestPointDumpGcd ( &IoMap ); if (!EFI_ERROR (Status)) { - PrintIoDescriptorHeader (); - for (Index = 0; Index < NumberOfDescriptors; Index++) { - PrintIoDescriptor (&IoMap[Index]); + if (DumpPrint) { + PrintIoDescriptorHeader (); + for (Index = 0; Index < NumberOfDescriptors; Index++) { + PrintIoDescriptor (&IoMap[Index]); + } } if (GcdMemoryMap != NULL) { *GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); *GcdIoMapNumberOfDescriptors = NumberOfDescriptors; } } - - DEBUG ((DEBUG_INFO, "==== TestPointDumpGcd - Exit\n")); + + if (DumpPrint) { + DEBUG ((DEBUG_INFO, "==== TestPointDumpGcd - Exit\n")); + } return ; } diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryMap.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryMap.c index 67b8108139..4e7640183a 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryMap.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckMemoryMap.c @@ -163,7 +163,8 @@ VOID TestPointDumpUefiMemoryMap ( OUT EFI_MEMORY_DESCRIPTOR **UefiMemoryMap, OPTIONAL OUT UINTN *UefiMemoryMapSize, OPTIONAL - OUT UINTN *UefiDescriptorSize OPTIONAL + OUT UINTN *UefiDescriptorSize, OPTIONAL + IN BOOLEAN DumpPrint ) { EFI_STATUS Status; @@ -178,8 +179,10 @@ TestPointDumpUefiMemoryMap ( *UefiMemoryMapSize = 0; *UefiDescriptorSize = 0; } - - DEBUG ((DEBUG_INFO, "==== TestPointDumpUefiMemoryMap - Enter\n")); + + if (DumpPrint) { + DEBUG ((DEBUG_INFO, "==== TestPointDumpUefiMemoryMap - Enter\n")); + } MemoryMapSize = 0; MemoryMap = NULL; Status = gBS->GetMemoryMap ( @@ -215,7 +218,9 @@ TestPointDumpUefiMemoryMap ( goto Done ; } - TestPointDumpMemoryMap (MemoryMap, MemoryMapSize, DescriptorSize); + if (DumpPrint) { + TestPointDumpMemoryMap (MemoryMap, MemoryMapSize, DescriptorSize); + } if (UefiMemoryMap != NULL) { *UefiMemoryMap = AllocateCopyPool (MemoryMapSize, MemoryMap); @@ -225,7 +230,9 @@ TestPointDumpUefiMemoryMap ( gBS->FreePool (MemoryMap); Done: - DEBUG ((DEBUG_INFO, "==== TestPointDumpUefiMemoryMap - Exit\n")); + if (DumpPrint) { + DEBUG ((DEBUG_INFO, "==== TestPointDumpUefiMemoryMap - Exit\n")); + } return ; } diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgTrustedBoot.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgTrustedBoot.c index b0f99f47e7..3fbaa22686 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgTrustedBoot.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgTrustedBoot.c @@ -21,6 +21,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include + +VOID * +TestPointGetAcpi ( + IN UINT32 Signature + ); EFI_STATUS EFIAPI @@ -31,6 +37,7 @@ TestPointCheckTcgTrustedBoot ( EFI_STATUS Status; EFI_TCG2_PROTOCOL *Tcg2; EFI_TCG2_BOOT_SERVICE_CAPABILITY ProtocolCapability; + VOID *Acpi; DEBUG ((DEBUG_INFO, "==== TestPointCheckTcgTrustedBoot - Enter\n")); @@ -62,6 +69,13 @@ TestPointCheckTcgTrustedBoot ( } if (!ProtocolCapability.TPMPresentFlag) { + DEBUG ((DEBUG_ERROR, "Tcg2 TPMPresentFlag FALSE\n")); + Status = EFI_NOT_FOUND; + } + + Acpi = TestPointGetAcpi (EFI_ACPI_5_0_TRUSTED_COMPUTING_PLATFORM_2_TABLE_SIGNATURE); + if (Acpi == NULL) { + DEBUG ((DEBUG_ERROR, "Tcg2 TPM2 table not found\n")); Status = EFI_NOT_FOUND; } diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c index cc3a2a9377..aea9e03e57 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c @@ -34,14 +34,16 @@ TestPointDumpGcd ( OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **GcdMemoryMap, OPTIONAL OUT UINTN *GcdMemoryMapNumberOfDescriptors, OPTIONAL OUT EFI_GCD_IO_SPACE_DESCRIPTOR **GcdIoMap, OPTIONAL - OUT UINTN *GcdIoMapNumberOfDescriptors OPTIONAL + OUT UINTN *GcdIoMapNumberOfDescriptors, OPTIONAL + IN BOOLEAN DumpPrint ); VOID TestPointDumpUefiMemoryMap ( OUT EFI_MEMORY_DESCRIPTOR **UefiMemoryMap, OPTIONAL OUT UINTN *UefiMemoryMapSize, OPTIONAL - OUT UINTN *UefiDescriptorSize OPTIONAL + OUT UINTN *UefiDescriptorSize, OPTIONAL + IN BOOLEAN DumpPrint ); EFI_STATUS @@ -81,7 +83,12 @@ TestPointCheckMemoryTypeInformation ( EFI_STATUS TestPointCheckAcpi ( - IN UINT32 *Signature OPTIONAL + VOID + ); + +EFI_STATUS +TestPointCheckAcpiGcdResource ( + VOID ); EFI_STATUS @@ -145,6 +152,11 @@ TestPointVtdEngine ( VOID ); +VOID * +TestPointGetAcpi ( + IN UINT32 Signature + ); + GLOBAL_REMOVE_IF_UNREFERENCED ADAPTER_INFO_PLATFORM_TEST_POINT_STRUCT mTestPointStruct = { PLATFORM_TEST_POINT_VERSION, PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, @@ -232,8 +244,7 @@ TestPointEndOfDxeDmaAcpiTableFuntional ( ) { EFI_STATUS Status; - BOOLEAN Result; - UINT32 Signature; + VOID *Acpi; if ((mFeatureImplemented[3] & TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL) == 0) { return EFI_SUCCESS; @@ -241,24 +252,29 @@ TestPointEndOfDxeDmaAcpiTableFuntional ( DEBUG ((DEBUG_INFO, "======== TestPointEndOfDxeDmaAcpiTableFuntional - Enter\n")); - Signature = EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE; - Result = TRUE; - Status = TestPointCheckAcpi (&Signature); - if (EFI_ERROR(Status)) { - Result = FALSE; - } - - if (Result) { + Acpi = TestPointGetAcpi (EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE); + if (Acpi == NULL) { + DEBUG ((DEBUG_ERROR, "No DMAR table\n")); + TestPointLibAppendErrorString ( + PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, + NULL, + TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL_ERROR_CODE \ + TEST_POINT_END_OF_DXE \ + TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL_ERROR_STRING + ); + Status = EFI_INVALID_PARAMETER; + } else { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, 3, TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL ); + Status = EFI_SUCCESS; } DEBUG ((DEBUG_INFO, "======== TestPointEndOfDxeDmaAcpiTableFuntional - Exit\n")); - return EFI_SUCCESS; + return Status; } EFI_STATUS @@ -370,8 +386,7 @@ TestPointDxeSmmReadyToLockWsmtTableFuntional ( ) { EFI_STATUS Status; - BOOLEAN Result; - UINT32 Signature; + VOID *Acpi; if ((mFeatureImplemented[7] & TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL) == 0) { return EFI_SUCCESS; @@ -379,24 +394,29 @@ TestPointDxeSmmReadyToLockWsmtTableFuntional ( DEBUG ((DEBUG_INFO, "======== TestPointDxeSmmReadyToLockWsmtTableFuntional - Enter\n")); - Result = TRUE; - Signature = EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE; - Status = TestPointCheckAcpi (&Signature); - if (EFI_ERROR(Status)) { - Result = FALSE; - } - - if (Result) { + Acpi = TestPointGetAcpi (EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE); + if (Acpi == NULL) { + DEBUG ((DEBUG_ERROR, "No WSMT table\n")); + TestPointLibAppendErrorString ( + PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, + NULL, + TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL_ERROR_CODE \ + TEST_POINT_DXE_SMM_READY_TO_LOCK \ + TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL_ERROR_STRING + ); + Status = EFI_INVALID_PARAMETER; + } else { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, 7, TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL ); + Status = EFI_SUCCESS; } DEBUG ((DEBUG_INFO, "======== TestPointDxeSmmReadyToLockWsmtTableFuntional - Exit\n")); - return EFI_SUCCESS; + return Status; } EFI_STATUS @@ -430,8 +450,8 @@ TestPointDxeSmmReadyToBootSmmPageProtection ( DEBUG ((DEBUG_INFO, "======== TestPointDxeSmmReadyToBootSmmPageProtection - Enter\n")); - TestPointDumpUefiMemoryMap (&UefiMemoryMap, &UefiMemoryMapSize, &UefiDescriptorSize); - TestPointDumpGcd (&GcdMemoryMap, &GcdMemoryMapNumberOfDescriptors, &GcdIoMap, &GcdIoMapNumberOfDescriptors); + TestPointDumpUefiMemoryMap (&UefiMemoryMap, &UefiMemoryMapSize, &UefiDescriptorSize, FALSE); + TestPointDumpGcd (&GcdMemoryMap, &GcdMemoryMapNumberOfDescriptors, &GcdIoMap, &GcdIoMapNumberOfDescriptors, FALSE); Status = gBS->LocateProtocol(&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **)&SmmCommunication); if (EFI_ERROR(Status)) { @@ -559,7 +579,7 @@ TestPointReadyToBootAcpiTableFuntional ( DEBUG ((DEBUG_INFO, "======== TestPointReadyToBootAcpiTableFuntional - Enter\n")); Result = TRUE; - Status = TestPointCheckAcpi (NULL); + Status = TestPointCheckAcpi (); if (EFI_ERROR(Status)) { Result = FALSE; } @@ -577,6 +597,40 @@ TestPointReadyToBootAcpiTableFuntional ( return EFI_SUCCESS; } +EFI_STATUS +EFIAPI +TestPointReadyToBootGcdResourceFuntional ( + VOID + ) +{ + EFI_STATUS Status; + BOOLEAN Result; + + if ((mFeatureImplemented[4] & TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL) == 0) { + return EFI_SUCCESS; + } + + DEBUG ((DEBUG_INFO, "======== TestPointReadyToBootGcdResourceFuntional - Enter\n")); + + Result = TRUE; + Status = TestPointCheckAcpiGcdResource (); + if (EFI_ERROR(Status)) { + Result = FALSE; + } + + if (Result) { + TestPointLibSetFeaturesVerified ( + PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, + NULL, + 4, + TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL + ); + } + + DEBUG ((DEBUG_INFO, "======== TestPointReadyToBootGcdResourceFuntional - Exit\n")); + return EFI_SUCCESS; +} + EFI_STATUS EFIAPI TestPointReadyToBootMemoryTypeInformationFunctional ( @@ -597,7 +651,7 @@ TestPointReadyToBootMemoryTypeInformationFunctional ( if (EFI_ERROR(Status)) { Result = FALSE; } - TestPointDumpUefiMemoryMap (NULL, NULL, NULL); + TestPointDumpUefiMemoryMap (NULL, NULL, NULL, TRUE); Status = TestPointCheckUefiMemoryMap (); if (EFI_ERROR(Status)) { Result = FALSE; @@ -632,8 +686,8 @@ TestPointReadyToBootUefiMemoryAttributeTableFunctional ( DEBUG ((DEBUG_INFO, "======== TestPointReadyToBootUefiMemoryAttributeTableFunctional - Enter\n")); Result = TRUE; - TestPointDumpUefiMemoryMap (NULL, NULL, NULL); - TestPointDumpGcd (NULL, NULL, NULL, NULL); + TestPointDumpUefiMemoryMap (NULL, NULL, NULL, TRUE); + TestPointDumpGcd (NULL, NULL, NULL, NULL, TRUE); Status = TestPointCheckUefiMemAttribute (); if (EFI_ERROR(Status)) { Result = FALSE; diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf index 6930e48d42..35cd825259 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf @@ -62,6 +62,7 @@ DxeCheckAcpiHpet.c DxeCheckAcpiDmar.c DxeCheckAcpiWsmt.c + DxeCheckAcpiTpm.c DxeCheckHsti.c DxeCheckEsrt.c DxeCheckLoadedImage.c diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.c index e722538244..2b914231ce 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.c @@ -56,14 +56,16 @@ TestPointDumpGcd ( OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **GcdMemoryMap, OPTIONAL OUT UINTN *GcdMemoryMapNumberOfDescriptors, OPTIONAL OUT EFI_GCD_IO_SPACE_DESCRIPTOR **GcdIoMap, OPTIONAL - OUT UINTN *GcdIoMapNumberOfDescriptors OPTIONAL + OUT UINTN *GcdIoMapNumberOfDescriptors, OPTIONAL + IN BOOLEAN DumpPrint ); VOID TestPointDumpUefiMemoryMap ( OUT EFI_MEMORY_DESCRIPTOR **UefiMemoryMap, OPTIONAL OUT UINTN *UefiMemoryMapSize, OPTIONAL - OUT UINTN *UefiDescriptorSize OPTIONAL + OUT UINTN *UefiDescriptorSize, OPTIONAL + IN BOOLEAN DumpPrint ); GLOBAL_REMOVE_IF_UNREFERENCED EFI_MEMORY_DESCRIPTOR *mUefiMemoryMap; @@ -172,8 +174,8 @@ TestPointSmmReadyToLockSecureSmmCommunicationBuffer ( // // Collect information here, because it is last chance to access outside SMRAM. // - TestPointDumpUefiMemoryMap (&mUefiMemoryMap, &mUefiMemoryMapSize, &mUefiDescriptorSize); - TestPointDumpGcd (&mGcdMemoryMap, &mGcdMemoryMapNumberOfDescriptors, &mGcdIoMap, &mGcdIoMapNumberOfDescriptors); + TestPointDumpUefiMemoryMap (&mUefiMemoryMap, &mUefiMemoryMapSize, &mUefiDescriptorSize, TRUE); + TestPointDumpGcd (&mGcdMemoryMap, &mGcdMemoryMapNumberOfDescriptors, &mGcdIoMap, &mGcdIoMapNumberOfDescriptors, TRUE); // // Defer the validation to TestPointSmmReadyToBootSecureSmmCommunicationBuffer, because page table setup later. // diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.c index 0ddceac5ff..ea3b77ecb1 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.c @@ -186,6 +186,15 @@ TestPointReadyToBootAcpiTableFuntional ( return EFI_SUCCESS; } +EFI_STATUS +EFIAPI +TestPointReadyToBootGcdResourceFuntional ( + VOID + ) +{ + return EFI_SUCCESS; +} + EFI_STATUS EFIAPI TestPointReadyToBootMemoryTypeInformationFunctional ( -- cgit v1.2.3