From 411447d908693e4e3875cac794059ad4ef855dc0 Mon Sep 17 00:00:00 2001 From: Ken Lautner Date: Wed, 20 Sep 2023 16:49:09 -0700 Subject: [PATCH] Added MU_CHANGE comments to all changes in EDK2 files --- MinPlatformPkg/Include/Library/TestPointLib.h | 2 + .../TestPointCheckLib/DxeCheckSmmInfo.c | 6 +-- .../TestPointCheckLib/DxeTestPointCheckLib.c | 42 +++++++++---------- .../DxeTestPointCheckLib.inf | 2 +- .../TestPointCheckLib/MmTestPointCheckLib.c | 2 +- .../TestPointCheckLib/PeiTestPointCheckLib.c | 18 ++++---- .../StandaloneMmTestPointCheckLib.c | 8 ++-- .../TraditionalMmTestPointCheckLib.c | 10 ++--- .../Test/Library/TestPointLib/MmTestPoint.h | 4 +- .../TestPointLib/MmTestPointCommunication.c | 10 ++++- .../TestPointStubDxe/TestPointStubDxeMm.c | 7 +++- 11 files changed, 63 insertions(+), 48 deletions(-) diff --git a/MinPlatformPkg/Include/Library/TestPointLib.h b/MinPlatformPkg/Include/Library/TestPointLib.h index f0680a0675..5c0df00aaf 100644 --- a/MinPlatformPkg/Include/Library/TestPointLib.h +++ b/MinPlatformPkg/Include/Library/TestPointLib.h @@ -204,10 +204,12 @@ typedef struct { // On output, actual data buffer size copied. // UINT64 DataSize; + // MU_CHANGE - START // Empty array that represents the start of the // data being stored in the comm buffer we're getting // from the MM environment. UINT8 Data[]; + // MU_CHANGE - END } MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET; extern EFI_GUID gAdapterInfoPlatformTestPointGuid; diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmmInfo.c b/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmmInfo.c index f8dca26aac..5799cae646 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmmInfo.c +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmmInfo.c @@ -12,7 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include +#include // MU_CHANGE CHAR8 *mSmramStateName[] = { "Open", @@ -110,13 +110,13 @@ TestPointCheckSmmInfo ( ) { EFI_STATUS Status; - EFI_MM_ACCESS_PROTOCOL *SmmAccess; + EFI_MM_ACCESS_PROTOCOL *SmmAccess; // MU_CHANGE UINTN Size; EFI_SMRAM_DESCRIPTOR *SmramRanges; DEBUG ((DEBUG_INFO, "==== TestPointCheckSmmInfo - Enter\n")); - Status = gBS->LocateProtocol (&gEfiMmAccessProtocolGuid, NULL, (VOID **)&SmmAccess); + Status = gBS->LocateProtocol (&gEfiMmAccessProtocolGuid, NULL, (VOID **)&SmmAccess); // MU_CHANGE if (EFI_ERROR (Status)) { goto Done ; } diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c b/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c index bc1cb6f326..10731d497a 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.c @@ -210,7 +210,7 @@ TestPointPciEnumerationDonePciBusMasterDisabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 3, TEST_POINT_BYTE3_PCI_ENUMERATION_DONE_BUS_MASTER_DISABLED ); @@ -255,7 +255,7 @@ TestPointPciEnumerationDonePciResourceAllocated ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 3, TEST_POINT_BYTE3_PCI_ENUMERATION_DONE_RESOURCE_ALLOCATED ); @@ -305,7 +305,7 @@ TestPointEndOfDxeDmaAcpiTableFunctional ( } else { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 3, TEST_POINT_BYTE3_END_OF_DXE_DMA_ACPI_TABLE_FUNCTIONAL ); @@ -351,7 +351,7 @@ TestPointEndOfDxeDmaProtectionEnabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 3, TEST_POINT_BYTE3_END_OF_DXE_DMA_PROTECTION_ENABLED ); @@ -396,7 +396,7 @@ TestPointEndOfDxeNoThirdPartyPciOptionRom ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 3, TEST_POINT_BYTE3_END_OF_DXE_NO_THIRD_PARTY_PCI_OPTION_ROM ); @@ -441,7 +441,7 @@ TestPointDxeSmmReadyToLockSmramAligned ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 7, TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED ); @@ -492,7 +492,7 @@ TestPointDxeSmmReadyToLockWsmtTableFunctional ( } else { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 7, TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_WSMT_TABLE_FUNCTIONAL ); @@ -689,7 +689,7 @@ TestPointDxeSmmReadyToBootSmiHandlerInstrument ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 7, TEST_POINT_BYTE7_DXE_SMM_READY_TO_BOOT_SMI_HANDLER_INSTRUMENT ); @@ -734,7 +734,7 @@ TestPointReadyToBootAcpiTableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 4, TEST_POINT_BYTE4_READY_TO_BOOT_ACPI_TABLE_FUNCTIONAL ); @@ -779,7 +779,7 @@ TestPointReadyToBootGcdResourceFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 4, TEST_POINT_BYTE4_READY_TO_BOOT_GCD_RESOURCE_FUNCTIONAL ); @@ -830,7 +830,7 @@ TestPointReadyToBootMemoryTypeInformationFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 4, TEST_POINT_BYTE4_READY_TO_BOOT_MEMORY_TYPE_INFORMATION_FUNCTIONAL ); @@ -878,7 +878,7 @@ TestPointReadyToBootUefiMemoryAttributeTableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 4, TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_MEMORY_ATTRIBUTE_TABLE_FUNCTIONAL ); @@ -925,7 +925,7 @@ TestPointReadyToBootUefiBootVariableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 4, TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_BOOT_VARIABLE_FUNCTIONAL ); @@ -972,7 +972,7 @@ TestPointReadyToBootUefiConsoleVariableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 4, TEST_POINT_BYTE4_READY_TO_BOOT_UEFI_CONSOLE_VARIABLE_FUNCTIONAL ); @@ -1017,7 +1017,7 @@ TestPointReadyToBootHstiTableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 8, TEST_POINT_BYTE8_READY_TO_BOOT_HSTI_TABLE_FUNCTIONAL ); @@ -1062,7 +1062,7 @@ TestPointReadyToBootEsrtTableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 8, TEST_POINT_BYTE8_READY_TO_BOOT_ESRT_TABLE_FUNCTIONAL ); @@ -1107,7 +1107,7 @@ TestPointReadyToBootUefiSecureBootEnabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 5, TEST_POINT_BYTE5_READY_TO_BOOT_UEFI_SECURE_BOOT_ENABLED ); @@ -1151,7 +1151,7 @@ TestPointReadyToBootPiSignedFvBootEnabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 5, TEST_POINT_BYTE5_READY_TO_BOOT_PI_SIGNED_FV_BOOT_ENABLED ); @@ -1196,7 +1196,7 @@ TestPointReadyToBootTcgTrustedBootEnabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 5, TEST_POINT_BYTE5_READY_TO_BOOT_TCG_TRUSTED_BOOT_ENABLED ); @@ -1241,7 +1241,7 @@ TestPointReadyToBootTcgMorEnabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 5, TEST_POINT_BYTE5_READY_TO_BOOT_TCG_MOR_ENABLED ); @@ -1301,7 +1301,7 @@ TestPointPciEnumerationDonePcieGenSpeed ( if (Result) { Status = TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_DXE, // MU_CHANGE - StandaloneMm Support 3, TEST_POINT_BYTE3_PCI_ENUMERATION_DONE_PCIE_GEN_SPEED ); diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf b/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf index 3938ca1fcf..22b277335f 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf @@ -94,7 +94,7 @@ [Protocols] gEfiPciIoProtocolGuid gEfiPciRootBridgeIoProtocolGuid - gEfiMmAccessProtocolGuid + gEfiMmAccessProtocolGuid #MU_CHANGE - Standalone MM support gEdkiiVarCheckProtocolGuid gEfiLoadedImageProtocolGuid gEfiLoadedImageDevicePathProtocolGuid diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/MmTestPointCheckLib.c b/MinPlatformPkg/Test/Library/TestPointCheckLib/MmTestPointCheckLib.c index 126f86d49e..2f4f5ce8b8 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/MmTestPointCheckLib.c +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/MmTestPointCheckLib.c @@ -109,7 +109,7 @@ TestPointMmEndOfDxeSmrrFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - Standalone Mm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL ); diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.c b/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.c index ee5b10b5bf..dac3cb4ba7 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.c +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.c @@ -107,7 +107,7 @@ TestPointDebugInitDone ( // TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 0, TEST_POINT_BYTE0_TEMP_INIT_DONE ); @@ -121,7 +121,7 @@ TestPointDebugInitDone ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 0, TEST_POINT_BYTE0_DEBUG_INIT_DONE ); @@ -171,7 +171,7 @@ TestPointMemoryDiscoveredMtrrFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 1, TEST_POINT_BYTE1_MEMORY_DISCOVERED_MTRR_FUNCTIONAL ); @@ -219,7 +219,7 @@ TestPointMemoryDiscoveredMemoryResourceFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 1, TEST_POINT_BYTE1_MEMORY_DISCOVERED_MEMORY_RESOURCE_FUNCTIONAL ); @@ -266,7 +266,7 @@ TestPointMemoryDiscoveredFvInfoFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 1, TEST_POINT_BYTE1_MEMORY_DISCOVERED_FV_INFO_FUNCTIONAL ); @@ -313,7 +313,7 @@ TestPointMemoryDiscoveredDmaProtectionEnabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 1, TEST_POINT_BYTE1_MEMORY_DISCOVERED_DMA_PROTECTION_ENABLED ); @@ -363,7 +363,7 @@ TestPointEndOfPeiSystemResourceFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 2, TEST_POINT_BYTE2_END_OF_PEI_SYSTEM_RESOURCE_FUNCTIONAL ); @@ -412,7 +412,7 @@ TestPointEndOfPeiMtrrFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 2, TEST_POINT_BYTE2_END_OF_PEI_MTRR_FUNCTIONAL ); @@ -459,7 +459,7 @@ TestPointEndOfPeiPciBusMasterDisabled ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_PEI, // MU_CHANGE - StandaloneMm Support 2, TEST_POINT_BYTE2_END_OF_PEI_PCI_BUS_MASTER_DISABLED ); diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/StandaloneMmTestPointCheckLib.c b/MinPlatformPkg/Test/Library/TestPointCheckLib/StandaloneMmTestPointCheckLib.c index ceefc5ab70..a75607f48e 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/StandaloneMmTestPointCheckLib.c +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/StandaloneMmTestPointCheckLib.c @@ -94,7 +94,7 @@ TestPointReadyToBootMmPageProtection ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_PAGE_LEVEL_PROTECTION ); @@ -111,7 +111,7 @@ TestPointReadyToBootMmPageProtection ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER ); @@ -248,14 +248,14 @@ TestPointReadyToBootMmPageProtectionHandler ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER ); } else { TestPointLibClearFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER ); diff --git a/MinPlatformPkg/Test/Library/TestPointCheckLib/TraditionalMmTestPointCheckLib.c b/MinPlatformPkg/Test/Library/TestPointCheckLib/TraditionalMmTestPointCheckLib.c index 863ab2f77c..aa8b004c60 100644 --- a/MinPlatformPkg/Test/Library/TestPointCheckLib/TraditionalMmTestPointCheckLib.c +++ b/MinPlatformPkg/Test/Library/TestPointCheckLib/TraditionalMmTestPointCheckLib.c @@ -101,7 +101,7 @@ TestPointReadyToLockMmMemoryAttributeTableFunctional ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SMM_MEMORY_ATTRIBUTE_TABLE_FUNCTIONAL ); @@ -184,7 +184,7 @@ TestPointReadyToBootMmPageProtection ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_PAGE_LEVEL_PROTECTION ); @@ -200,7 +200,7 @@ TestPointReadyToBootMmPageProtection ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER ); @@ -305,14 +305,14 @@ TestPointReadyToBootMmPageProtectionHandler ( if (Result) { TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER ); } else { TestPointLibClearFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, + TEST_POINT_IMPLEMENTATION_ID_PLATFORM_SMM, // MU_CHANGE - StandaloneMm Support TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER ); diff --git a/MinPlatformPkg/Test/Library/TestPointLib/MmTestPoint.h b/MinPlatformPkg/Test/Library/TestPointLib/MmTestPoint.h index facd25ac53..d29f9a2bad 100644 --- a/MinPlatformPkg/Test/Library/TestPointLib/MmTestPoint.h +++ b/MinPlatformPkg/Test/Library/TestPointLib/MmTestPoint.h @@ -22,7 +22,7 @@ #include #include -#include +#include // MU_CHANGE - StandaloneMm Support #define TEST_POINT_AIP_PRIVATE_SIGNATURE SIGNATURE_32('T', 'S', 'P', 'T') @@ -82,6 +82,7 @@ IsBufferOutsideMmValid ( IN UINT64 Length ); +// MU_CHANGE [START] - StandaloneMm Support /** This function check if the buffer is valid per processor architecture and not overlap with SMRAM. A separate function exists because Standalone MM compares the comm buffer using a different function @@ -99,5 +100,6 @@ IsCommBufferOutsideMmValid ( IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length ); +// MU_CHANGE [END] - StandaloneMm Support #endif diff --git a/MinPlatformPkg/Test/Library/TestPointLib/MmTestPointCommunication.c b/MinPlatformPkg/Test/Library/TestPointLib/MmTestPointCommunication.c index 87a3309c96..e77dfca987 100644 --- a/MinPlatformPkg/Test/Library/TestPointLib/MmTestPointCommunication.c +++ b/MinPlatformPkg/Test/Library/TestPointLib/MmTestPointCommunication.c @@ -218,10 +218,12 @@ MmTestPointMmiHandlerGetDataByOffset ( Data = NULL; + // MU_CHANGE [START] - StandaloneMm Support if (MmiHandlerTestPointParameterGetDataByOffset == NULL) { DEBUG((DEBUG_ERROR, "[%a] - The Buffer passed in is NULL. Aborting.\n", __func__)); return; } + // MU_CHANGE [END] - StandaloneMm Support // // Sanity check @@ -250,10 +252,12 @@ MmTestPointMmiHandlerGetDataByOffset ( goto Done; } + // MU_CHANGE [START] - StandaloneMm Support if (DataSize > MmiHandlerTestPointParameterGetDataByOffset->DataSize) { DEBUG((DEBUG_ERROR, "[%a] - The Datasize we are going to copy over is larger than expected. Aborting.\n", __func__)); goto Done; } + // MU_CHANGE [END] - StandaloneMm Support // // The SpeculationBarrier() call here is to ensure the previous range/content @@ -301,7 +305,7 @@ MmTestPointMmiHandler ( ) { MMI_HANDLER_TEST_POINT_PARAMETER_HEADER *MmiHandlerTestPointParameterHeader; - MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET *MmiHandlerTestPointParameterOffset; + MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET *MmiHandlerTestPointParameterOffset; // MU_CHANGE - StandaloneMm Support UINTN TempCommBufferSize; DEBUG((DEBUG_INFO, "MmTestPointMmiHandler Enter\n")); @@ -320,7 +324,7 @@ MmTestPointMmiHandler ( return EFI_SUCCESS; } - if (!IsCommBufferOutsideMmValid((UINTN)CommBuffer, TempCommBufferSize)) { + if (!IsCommBufferOutsideMmValid((UINTN)CommBuffer, TempCommBufferSize)) { // MU_CHANGE - StandaloneMm Support DEBUG((DEBUG_INFO, "MmTestPointMmiHandler: MM communication buffer in MMRAM or overflow!\n")); return EFI_SUCCESS; } @@ -339,11 +343,13 @@ MmTestPointMmiHandler ( break; case MMI_HANDLER_TEST_POINT_COMMAND_GET_DATA_BY_OFFSET: DEBUG((DEBUG_INFO, "MmiHandlerTestPointHandlerGetDataByOffset\n")); + // MU_CHANGE [START] - StandaloneMm Support MmiHandlerTestPointParameterOffset = (MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET *)CommBuffer; if (TempCommBufferSize != (sizeof(MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET) + MmiHandlerTestPointParameterOffset->DataSize)) { DEBUG((DEBUG_INFO, "MmTestPointMmiHandler: MM communication buffer size invalid!\n")); return EFI_SUCCESS; } + // MU_CHANGE [END] - StandaloneMm Support MmTestPointMmiHandlerGetDataByOffset((MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET *)(UINTN)CommBuffer); break; default: diff --git a/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxeMm.c b/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxeMm.c index 704ec175cd..ed983151ba 100644 --- a/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxeMm.c +++ b/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxeMm.c @@ -94,11 +94,13 @@ GetTestPointDataMm ( return ; } + // MU_CHANGE [START] - StandaloneMm Support if (PiSmmCommunicationRegionTable == NULL) { ASSERT (PiSmmCommunicationRegionTable != NULL); DEBUG ((DEBUG_ERROR, "The PiSmmCommunicationRegionTable is NULL!\n")); return; } + // MU_CHANGE [END] - StandaloneMm Support Entry = (EFI_MEMORY_DESCRIPTOR *)(PiSmmCommunicationRegionTable + 1); Size = 0; @@ -121,7 +123,7 @@ GetTestPointDataMm ( CopyMem(&CommHeader->HeaderGuid, &gAdapterInfoPlatformTestPointGuid, sizeof(gAdapterInfoPlatformTestPointGuid)); CommHeader->MessageLength = sizeof(MMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO); - CommGetInfo = (MMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO *)&CommBuffer[OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data)]; + CommGetInfo = (MMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO *)&CommBuffer[OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data)]; CommGetInfo->Header.Command = MMI_HANDLER_TEST_POINT_COMMAND_GET_INFO; CommGetInfo->Header.DataLength = sizeof(*CommGetInfo); CommGetInfo->Header.ReturnStatus = (UINT64)-1; @@ -165,6 +167,7 @@ GetTestPointDataMm ( CommSize = OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data) + (UINTN)CommHeader->MessageLength; Size -= CommSize; + // MU_CHANGE [START] - StandaloneMm Support CommGetData->DataSize = (UINT64)(mMmTestPointDatabaseSize); Status = MmCommunication->Communicate (MmCommunication, CommBuffer, &CommSize); ASSERT_EFI_ERROR (Status); @@ -177,6 +180,8 @@ GetTestPointDataMm ( } CopyMem ((UINT8 *)mMmTestPointDatabase, (VOID *)(UINTN)CommGetData->Data, (UINTN)mMmTestPointDatabaseSize); + // MU_CHANGE [END] - StandaloneMm Support + DEBUG ((DEBUG_INFO, "MmTestPointDatabaseSize - 0x%x\n", mMmTestPointDatabaseSize)); return ; }