public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entry
@ 2016-11-29  7:17 Jeff Fan
  2016-11-30  2:48 ` Ni, Ruiyu
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Fan @ 2016-11-29  7:17 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ruiyu Ni, Jiewen Yao, Michael D Kinney

Current SmmDebugAgentLib will initialize IDT table to support source debugging
at each time SMI entry on SMM BSP. Actually, we only need to initialize IDT
table at first time SMI entry.

Add one flag to avoid re-initializing IDT table.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
---
 .../Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c        | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
index 701c4be..6216142 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
@@ -19,6 +19,7 @@ DEBUG_AGENT_MAILBOX         mLocalMailbox;
 UINTN                       mSavedDebugRegisters[6];
 IA32_IDT_GATE_DESCRIPTOR    mIdtEntryTable[33];
 BOOLEAN                     mSkipBreakpoint = FALSE;
+BOOLEAN                     mSmmDebugIdtInitFlag = FALSE;
 
 CHAR8 mWarningMsgIgnoreSmmEntryBreak[] = "Ignore smmentrybreak setting for SMI issued during DXE debugging!\r\n";
 
@@ -276,7 +277,14 @@ InitializeDebugAgent (
 
   case DEBUG_AGENT_INIT_ENTER_SMI:
     SaveDebugRegister ();
-    InitializeDebugIdt ();
+    if (!mSmmDebugIdtInitFlag) {
+      //
+      // We only need to initialize Debug IDT table at first SMI entry
+      // after SMM relocation.
+      //
+      InitializeDebugIdt ();
+      mSmmDebugIdtInitFlag = TRUE;
+    }
     //
     // Check if CPU APIC Timer is working, otherwise initialize it.
     //
-- 
2.9.3.windows.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-30  2:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29  7:17 [PATCH] SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entry Jeff Fan
2016-11-30  2:48 ` Ni, Ruiyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox