]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg PiSmmCpuDxeSmm: Only DumpCpuContext in error case
authorStar Zeng <star.zeng@intel.com>
Wed, 6 Dec 2017 11:02:04 +0000 (19:02 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 8 Dec 2017 01:12:32 +0000 (09:12 +0800)
Only DumpCpuContext in error case, otherwise there will be too many
debug messages from DumpCpuContext() when SmmProfile feature is enabled
by setting PcdCpuSmmProfileEnable to TRUE. Those debug messages are not
needed for SmmProfile feature as it will record those information to
buffer for further dump.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c

index 0396f2daaaed1aaa570acdb72970a697baae498c..6e1ffe7c62879677a96f905e6dcd309932802417 100644 (file)
@@ -134,12 +134,12 @@ SmiPFHandler (
   }\r
 \r
   //\r
-  // If a page fault occurs in SMM range\r
+  // If a page fault occurs in non-SMRAM range.\r
   //\r
   if ((PFAddress < mCpuHotPlugData.SmrrBase) ||\r
       (PFAddress >= mCpuHotPlugData.SmrrBase + mCpuHotPlugData.SmrrSize)) {\r
-    DumpCpuContext (InterruptType, SystemContext);\r
     if ((SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_ID) != 0) {\r
+      DumpCpuContext (InterruptType, SystemContext);\r
       DEBUG ((DEBUG_ERROR, "Code executed on IP(0x%x) out of SMM range after SMM is locked!\n", PFAddress));\r
       DEBUG_CODE (\r
         DumpModuleInfoByIp (*(UINTN *)(UINTN)SystemContext.SystemContextIa32->Esp);\r
@@ -147,6 +147,7 @@ SmiPFHandler (
       CpuDeadLoop ();\r
     }\r
     if (IsSmmCommBufferForbiddenAddress (PFAddress)) {\r
+      DumpCpuContext (InterruptType, SystemContext);\r
       DEBUG ((DEBUG_ERROR, "Access SMM communication forbidden address (0x%x)!\n", PFAddress));\r
       DEBUG_CODE (\r
         DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextIa32->Eip);\r
@@ -160,6 +161,7 @@ SmiPFHandler (
   //\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
index 79a26d7ec6a3eef8015a14431110b1a8dbc9bf8f..6478c6c3e355e28afa0c46af94538ef61b11ec8a 100644 (file)
@@ -851,12 +851,12 @@ SmiPFHandler (
   }\r
 \r
   //\r
-  // If a page fault occurs in SMM range\r
+  // If a page fault occurs in non-SMRAM range.\r
   //\r
   if ((PFAddress < mCpuHotPlugData.SmrrBase) ||\r
       (PFAddress >= mCpuHotPlugData.SmrrBase + mCpuHotPlugData.SmrrSize)) {\r
-    DumpCpuContext (InterruptType, SystemContext);\r
     if ((SystemContext.SystemContextX64->ExceptionData & IA32_PF_EC_ID) != 0) {\r
+      DumpCpuContext (InterruptType, SystemContext);\r
       DEBUG ((DEBUG_ERROR, "Code executed on IP(0x%lx) out of SMM range after SMM is locked!\n", PFAddress));\r
       DEBUG_CODE (\r
         DumpModuleInfoByIp (*(UINTN *)(UINTN)SystemContext.SystemContextX64->Rsp);\r
@@ -864,6 +864,7 @@ SmiPFHandler (
       CpuDeadLoop ();\r
     }\r
     if (IsSmmCommBufferForbiddenAddress (PFAddress)) {\r
+      DumpCpuContext (InterruptType, SystemContext);\r
       DEBUG ((DEBUG_ERROR, "Access SMM communication forbidden address (0x%lx)!\n", PFAddress));\r
       DEBUG_CODE (\r
         DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextX64->Rip);\r
@@ -877,6 +878,7 @@ SmiPFHandler (
   //\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.SystemContextX64->Rip);\r