diff options
author | Brian J. Johnson <bjohnson@sgi.com> | 2015-07-09 02:29:58 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-07-09 02:29:58 +0000 |
commit | 3b87e3881e6ea25885bf445c3d4278f7ef2668c3 (patch) | |
tree | c5486e12e83903467d064aecf1f79e61ab45e72f /SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent | |
parent | d2857812ff1f28cf3a350840416ec1a8ba072937 (diff) | |
download | edk2-3b87e3881e6ea25885bf445c3d4278f7ef2668c3.zip edk2-3b87e3881e6ea25885bf445c3d4278f7ef2668c3.tar.gz edk2-3b87e3881e6ea25885bf445c3d4278f7ef2668c3.tar.bz2 |
SourceLevelDebugPkg: Fix PEI timer interrupt regression
Recent changes to debug timer initialization (commit 2befbc82, svn 17572)
modified the Sec/Pei InitializeDebugAgent() routine to enable debug timer
interrupts. This causes problems in the DEBUG_AGENT_INIT_POSTMEM_SEC case:
the callers appear to assume that if they block timer interrupts before the
call, interrupts will remain blocked afterwards.
It is not always safe to have interrupts enabled on return from
InitializeDebugAgent(). For instance, after calling InitializeDebugAgent(),
OvmfPkg's TemporaryRamMigration() moves the stack, heap, and IDT to RAM, then
switches to the new stack. Only then does it reenable timer interrupts.
Taking an interrupt during this process can corrupt state, causing crashes.
Do not unmask the debug timer interrupt in the DEBUG_AGENT_INIT_POSTMEM_SEC
case.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brian J. Johnson <bjohnson@sgi.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17893 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent')
-rw-r--r-- | SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c index ea75742..09216c2 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c @@ -612,9 +612,11 @@ InitializeDebugAgent ( }
//
- // Enable Debug Timer interrupt
+ // Enable Debug Timer interrupt. In post-memory SEC, the caller enables it.
//
- SaveAndSetDebugTimerInterrupt (TRUE);
+ if (InitFlag != DEBUG_AGENT_INIT_POSTMEM_SEC) {
+ SaveAndSetDebugTimerInterrupt (TRUE);
+ }
//
// Enable CPU interrupts so debug timer interrupts can be delivered
//
|