From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 EACB020945BB8 for ; Thu, 28 Sep 2017 23:50:20 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2017 23:53:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,451,1500966000"; d="scan'208";a="1019735606" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 28 Sep 2017 23:53:35 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Sep 2017 23:53:35 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Sep 2017 23:53:35 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Fri, 29 Sep 2017 14:53:33 +0800 From: "Gao, Liming" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg PeiCore: More debug messages for pre-memory allocations Thread-Index: AQHTOO5OWwARFbKx60Wwf/IOIxUUiqLLbWLw Date: Fri, 29 Sep 2017 06:53:32 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E166833@SHSMSX104.ccr.corp.intel.com> References: <1506667415-19896-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1506667415-19896-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg PeiCore: More debug messages for pre-memory allocations X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2017 06:50:21 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Sta= r >Zeng >Sent: Friday, September 29, 2017 2:44 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming ; Zeng, Star >Subject: [edk2] [PATCH] MdeModulePkg PeiCore: More debug messages for >pre-memory allocations > >The debug messages can help developer to know the pre-memory >allocation usage. > >Cc: Liming Gao >Cc: Qing Huang >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Star Zeng >--- > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >index 04ece9a627d5..38299c5d98c6 100644 >--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c >@@ -675,7 +675,8 @@ PeiCheckAndSwitchStack ( > // usage in temporary memory for debugging. > // > DEBUG_CODE_BEGIN (); >- UINT32 *StackPointer; >+ UINT32 *StackPointer; >+ EFI_PEI_HOB_POINTERS Hob; > > for (StackPointer =3D (UINT32*)SecCoreData->StackBase; > (StackPointer < (UINT32*)((UINTN)SecCoreData->StackBase + >SecCoreData->StackSize)) \ >@@ -691,6 +692,17 @@ PeiCheckAndSwitchStack ( > DEBUG ((DEBUG_INFO, " temporary memory heap used for HobList: %d >bytes.\n", > (UINT32)((UINTN)Private->HobList.HandoffInformationTable- >>EfiFreeMemoryBottom - (UINTN)Private->HobList.Raw) > )); >+ DEBUG ((DEBUG_INFO, " temporary memory heap occupied by memory >pages: %d bytes.\n", >+ (UINT32)(UINTN)(Private->HobList.HandoffInformationTable- >>EfiMemoryTop - Private->HobList.HandoffInformationTable- >>EfiFreeMemoryTop) >+ )); >+ for (Hob.Raw =3D Private->HobList.Raw; !END_OF_HOB_LIST(Hob); >Hob.Raw =3D GET_NEXT_HOB(Hob)) { >+ if (GET_HOB_TYPE (Hob) =3D=3D EFI_HOB_TYPE_MEMORY_ALLOCATION) { >+ DEBUG ((DEBUG_INFO, "Memory Allocation 0x%08x 0x%0lx - 0x%0lx\n= ", >\ >+ Hob.MemoryAllocation->AllocDescriptor.MemoryType, = \ >+ Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, = \ >+ Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + >Hob.MemoryAllocation->AllocDescriptor.MemoryLength - 1)); >+ } >+ } > DEBUG_CODE_END (); > > if (PcdGet64(PcdLoadModuleAtFixAddressEnable) !=3D 0 && (Private- >>HobList.HandoffInformationTable->BootMode !=3D BOOT_ON_S3_RESUME)) { >-- >2.7.0.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel