\r
mPhysicalAddressBits = 32;\r
\r
- if (FeaturePcdGet (PcdCpuSmmProfileEnable)) {\r
+ if (FeaturePcdGet (PcdCpuSmmProfileEnable) ||\r
+ HEAP_GUARD_NONSTOP_MODE ||\r
+ NULL_DETECTION_NONSTOP_MODE) {\r
//\r
// Set own Page Fault entry instead of the default one, because SMM Profile\r
// feature depends on IRET instruction to do Single Step\r
DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextIa32->Eip);\r
);\r
}\r
+\r
+ if (HEAP_GUARD_NONSTOP_MODE) {\r
+ GuardPagePFHandler (SystemContext.SystemContextIa32->ExceptionData);\r
+ goto Exit;\r
+ }\r
}\r
CpuDeadLoop ();\r
}\r
);\r
CpuDeadLoop ();\r
}\r
+\r
+ //\r
+ // If NULL pointer was just accessed\r
+ //\r
+ if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & BIT1) != 0 &&\r
+ (PFAddress < EFI_PAGE_SIZE)) {\r
+ DumpCpuContext (InterruptType, SystemContext);\r
+ DEBUG ((DEBUG_ERROR, "!!! NULL pointer access !!!\n"));\r
+ DEBUG_CODE (\r
+ DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextIa32->Eip);\r
+ );\r
+\r
+ if (NULL_DETECTION_NONSTOP_MODE) {\r
+ GuardPagePFHandler (SystemContext.SystemContextIa32->ExceptionData);\r
+ goto Exit;\r
+ }\r
+\r
+ CpuDeadLoop ();\r
+ }\r
+\r
if (IsSmmCommBufferForbiddenAddress (PFAddress)) {\r
DumpCpuContext (InterruptType, SystemContext);\r
DEBUG ((DEBUG_ERROR, "Access SMM communication forbidden address (0x%x)!\n", PFAddress));\r
}\r
}\r
\r
- //\r
- // If NULL pointer was just accessed\r
- //\r
- if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & BIT1) != 0 &&\r
- (PFAddress < EFI_PAGE_SIZE)) {\r
- DumpCpuContext (InterruptType, SystemContext);\r
- DEBUG ((DEBUG_ERROR, "!!! NULL pointer access !!!\n"));\r
- DEBUG_CODE (\r
- DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextIa32->Eip);\r
- );\r
- CpuDeadLoop ();\r
- }\r
-\r
if (FeaturePcdGet (PcdCpuSmmProfileEnable)) {\r
SmmProfilePFHandler (\r
SystemContext.SystemContextIa32->Eip,\r
SmiDefaultPFHandler ();\r
}\r
\r
+Exit:\r
ReleaseSpinLock (mPFLock);\r
}\r
\r