diff --git a/MdeModulePkg/Include/Library/DeviceStateLib.h b/MdeModulePkg/Include/Library/DeviceStateLib.h index f533348e557..db933f1dfe4 100644 --- a/MdeModulePkg/Include/Library/DeviceStateLib.h +++ b/MdeModulePkg/Include/Library/DeviceStateLib.h @@ -17,7 +17,6 @@ #define DEVICE_STATE_DEVELOPMENT_BUILD_ENABLED BIT2 #define DEVICE_STATE_SOURCE_DEBUG_ENABLED BIT3 #define DEVICE_STATE_UNDEFINED BIT4 -#define DEVICE_STATE_UNIT_TEST_MODE BIT5 #define DEVICE_STATE_PLATFORM_MODE_0 BIT20 #define DEVICE_STATE_PLATFORM_MODE_1 BIT21 diff --git a/MdeModulePkg/Library/DeviceStateLib/Readme.md b/MdeModulePkg/Library/DeviceStateLib/Readme.md index 9b7e9e12ef5..1e589c277d8 100644 --- a/MdeModulePkg/Library/DeviceStateLib/Readme.md +++ b/MdeModulePkg/Library/DeviceStateLib/Readme.md @@ -19,8 +19,6 @@ states or to define any of the unused bits: * BIT 3: DEVICE_STATE_SOURCE_DEBUG_ENABLED - Source debug mode is enabled allowing a user to connect and control the device * BIT 4: DEVICE_STATE_UNDEFINED - Set by the platform -* BIT 5: DEVICE_STATE_UNIT_TEST_MODE - Device has a unit test build. Some - features are disabled to allow for unit tests in UEFI Shell * BIT 24: DEVICE_STATE_PLATFORM_MODE_0 * BIT 25: DEVICE_STATE_PLATFORM_MODE_1 * BIT 26: DEVICE_STATE_PLATFORM_MODE_2 diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 0f179a33407..3063e369177 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2264,6 +2264,9 @@ ## MU_CHANGE START: Add Stack Cookie Exception Vector ## This PCD specifies the interrupt vector for stack cookie check failures gEfiMdePkgTokenSpaceGuid.PcdStackCookieExceptionVector|0x42|UINT8|0x30001019 + + ## This PCD indicates if the platform is in unit test mode + gEfiMdePkgTokenSpaceGuid.PcdUnitTestModeActive|FALSE|BOOLEAN|0x3000101a ## MU_CHANGE END [PcdsFixedAtBuild,PcdsPatchableInModule] diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index cc1e07129fc..12b14e92461 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -9,7 +9,7 @@ #include "CpuDxe.h" #include "CpuMp.h" #include "CpuPageTable.h" -#include // MU_CHANGE +#include // MU_CHANGE #define CPU_INTERRUPT_NUM 256 // @@ -1285,7 +1285,7 @@ InitializeCpu ( InitializeMpSupport (); // MU_CHANGE START - if ((GetDeviceState () & DEVICE_STATE_UNIT_TEST_MODE) != 0) { + if (FixedPcdGetBool(PcdUnitTestModeActive)) { InstallMemoryProtectionNonstopModeProtocol (); } diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 5ba97facd70..0eb60e60972 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.inf +++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf @@ -42,7 +42,6 @@ TimerLib PeCoffGetEntryPointLib DxeMemoryProtectionHobLib ## MU_CHANGE - DeviceStateLib ## MU_CHANGE [Sources] CpuDxe.c @@ -87,6 +86,7 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList ## CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdUnitTestModeActive ## CONSUMES MU_CHANGE [Depex] TRUE