From: Jeff Fan <jeff.fan@intel.com>
To: edk2-devel@lists.01.org
Cc: Feng Tian <feng.tian@intel.com>,
Liming Gao <liming.gao@intel.com>,
Michael Kinney <michael.d.kinney@intel.com>
Subject: [PATCH 1/3] MdeModulePkg: Display new stack base and size
Date: Fri, 4 Nov 2016 10:19:00 +0800 [thread overview]
Message-ID: <20161104021902.17364-2-jeff.fan@intel.com> (raw)
In-Reply-To: <20161104021902.17364-1-jeff.fan@intel.com>
Dump new stack base and size information could help developer to narrow down
stack crash issue.
Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
---
MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 16 ++++++++++++++++
MdeModulePkg/Universal/CapsulePei/UefiCapsule.c | 8 ++++++++
MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c | 8 ++++++++
3 files changed, 32 insertions(+)
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
index 8ce72cb..6ec51ff 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
@@ -317,6 +317,14 @@ HandOffToDxeCore (
AsmWriteIdtr (&gLidtDescriptor);
+ DEBUG ((
+ DEBUG_INFO,
+ "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
+ __FUNCTION__,
+ BaseOfStack,
+ STACK_SIZE
+ ));
+
//
// Go to Long Mode and transfer control to DxeCore.
// Interrupts will not get turned on until the CPU AP is loaded.
@@ -387,6 +395,14 @@ HandOffToDxeCore (
//
UpdateStackHob (BaseOfStack, STACK_SIZE);
+ DEBUG ((
+ DEBUG_INFO,
+ "%a() Stack Base: 0x%lx, Stack Size: 0x%x\n",
+ __FUNCTION__,
+ BaseOfStack,
+ STACK_SIZE
+ ));
+
//
// Transfer the control to the entry point of DxeCore.
//
diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
index e60105b..9ac9d22 100644
--- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
+++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
@@ -321,6 +321,14 @@ Thunk32To64 (
//
AsmWriteCr3 ((UINTN) PageTableAddress);
+ DEBUG ((
+ DEBUG_INFO,
+ "%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n",
+ __FUNCTION__,
+ Context->StackBufferBase,
+ Context->StackBufferLength
+ ));
+
//
// Disable interrupt of Debug timer, since the IDT table cannot work in long mode
//
diff --git a/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c b/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c
index d1042e3..5ad95d2 100644
--- a/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c
+++ b/MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c
@@ -265,6 +265,14 @@ _ModuleEntryPoint (
ReturnContext->ReturnStatus = Status;
+ DEBUG ((
+ DEBUG_INFO,
+ "%a() Stack Base: 0x%lx, Stack Size: 0x%lx\n",
+ __FUNCTION__,
+ EntrypointContext->StackBufferBase,
+ EntrypointContext->StackBufferLength
+ ));
+
//
// Disable interrupt of Debug timer, since the new IDT table cannot work in long mode
//
--
2.9.3.windows.2
next prev parent reply other threads:[~2016-11-04 2:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 2:18 [PATCH 0/3] Display new stack base and size Jeff Fan
2016-11-04 2:19 ` Jeff Fan [this message]
2016-11-04 2:19 ` [PATCH 2/3] UefiCpuPkg: " Jeff Fan
2016-11-04 2:19 ` [PATCH 3/3] MdeModulePkg/DxeIplPeim: UINTN used wrongly for EFI_PHYSICAL_ADDRESS Jeff Fan
2016-11-04 3:28 ` Gao, Liming
2016-11-04 4:49 ` Gao, Liming
2016-11-09 7:21 ` [PATCH 0/3] Display new stack base and size Tian, Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161104021902.17364-2-jeff.fan@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox