From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8ECAF81D69 for ; Thu, 3 Nov 2016 19:19:27 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 03 Nov 2016 19:19:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,589,1473145200"; d="scan'208";a="187445728" Received: from jfan12-desk.ccr.corp.intel.com ([10.239.9.5]) by fmsmga004.fm.intel.com with ESMTP; 03 Nov 2016 19:19:29 -0700 From: Jeff Fan To: edk2-devel@lists.01.org Cc: Feng Tian , Liming Gao , Michael Kinney Date: Fri, 4 Nov 2016 10:19:00 +0800 Message-Id: <20161104021902.17364-2-jeff.fan@intel.com> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20161104021902.17364-1-jeff.fan@intel.com> References: <20161104021902.17364-1-jeff.fan@intel.com> Subject: [PATCH 1/3] MdeModulePkg: Display new stack base and size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2016 02:19:27 -0000 Dump new stack base and size information could help developer to narrow down stack crash issue. Cc: Feng Tian Cc: Liming Gao Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan --- 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