summaryrefslogtreecommitdiffstats
path: root/SourceLevelDebugPkg
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-11-29 14:51:18 +0800
committerJeff Fan <jeff.fan@intel.com>2016-11-30 14:34:45 +0800
commit6fee83fbcab75ee676699df3b3cf7f25fcbb3d26 (patch)
treebdb36bb5d78cfb595e0033fe10af9800f681549b /SourceLevelDebugPkg
parente27ccaba9050b11a10d82fd9a0dfdd87015bd710 (diff)
downloadedk2-6fee83fbcab75ee676699df3b3cf7f25fcbb3d26.tar.gz
edk2-6fee83fbcab75ee676699df3b3cf7f25fcbb3d26.tar.bz2
edk2-6fee83fbcab75ee676699df3b3cf7f25fcbb3d26.zip
SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entry
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> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'SourceLevelDebugPkg')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
index 701c4be0d0..6216142dba 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.
//