Brian J. Johnson
2015-07-01 18:27:36 UTC
SourceLevelDebugPkg maintainers,
I noticed what looks like a regression in the SecPeiDebugAgentLib.
InitializeDebugAgent() calls SaveAndSetDebugTimerInterrupt() before a
normal return, but it is not called when execution continues via
InitializeDebugAgentPhase2(), as in the DEBUG_AGENT_INIT_PREMEM_SEC
case. The result is that debug timer interrupts are not enabled in PEI,
so it's impossible to stop execution via the debugger.
A fix is to add a call to SaveAndSetDebugTimerInterrupt() in
InitializeDebugAgentPhase2(), like the one near the end of
InitializeDebugAgent():
diff --git
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
index fcc7a4b..ea75742 100644
---
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
+++
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
@@ -684,6 +684,10 @@ InitializeDebugAgentPhase2 (
TriggerSoftInterrupt (MEMORY_READY_SIGNATURE);
}
//
+ // Enable Debug Timer interrupt
+ //
+ SaveAndSetDebugTimerInterrupt (TRUE);
+ //
// Enable CPU interrupts so debug timer interrupts can be delivered
//
EnableInterrupts ();
I haven't tried this fix with the stock SourceLevelDebugPkg, but it
works well in a customized version we use internally.
Thanks,
I noticed what looks like a regression in the SecPeiDebugAgentLib.
InitializeDebugAgent() calls SaveAndSetDebugTimerInterrupt() before a
normal return, but it is not called when execution continues via
InitializeDebugAgentPhase2(), as in the DEBUG_AGENT_INIT_PREMEM_SEC
case. The result is that debug timer interrupts are not enabled in PEI,
so it's impossible to stop execution via the debugger.
A fix is to add a call to SaveAndSetDebugTimerInterrupt() in
InitializeDebugAgentPhase2(), like the one near the end of
InitializeDebugAgent():
diff --git
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
index fcc7a4b..ea75742 100644
---
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
+++
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
@@ -684,6 +684,10 @@ InitializeDebugAgentPhase2 (
TriggerSoftInterrupt (MEMORY_READY_SIGNATURE);
}
//
+ // Enable Debug Timer interrupt
+ //
+ SaveAndSetDebugTimerInterrupt (TRUE);
+ //
// Enable CPU interrupts so debug timer interrupts can be delivered
//
EnableInterrupts ();
I haven't tried this fix with the stock SourceLevelDebugPkg, but it
works well in a customized version we use internally.
Thanks,
--
Brian J. Johnson
--------------------------------------------------------------------
My statements are my own, are not authorized by SGI, and do not
necessarily represent SGI’s positions.
Brian J. Johnson
--------------------------------------------------------------------
My statements are my own, are not authorized by SGI, and do not
necessarily represent SGI’s positions.