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.43; helo=mga05.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 1CB1B2236BAB0 for ; Tue, 9 Jan 2018 21:42:21 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2018 21:47:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,338,1511856000"; d="scan'208";a="18882264" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 09 Jan 2018 21:47:32 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 9 Jan 2018 21:47:31 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Wed, 10 Jan 2018 13:47:30 +0800 From: "Zeng, Star" To: "Gao, Liming" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [Patch] MdeModulePkg DxeIpl: remove the hard code alignment adjustment in Decompress() Thread-Index: AQHTidZSbHDTLocsykOlUQS8/7PC96NsmT8g Date: Wed, 10 Jan 2018 05:47:28 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9F9A64@shsmsx102.ccr.corp.intel.com> References: <1515563158-6480-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1515563158-6480-1-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, 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 DxeIpl: remove the hard code alignment adjustment in Decompress() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2018 05:42:21 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Limi= ng Gao Sent: Wednesday, January 10, 2018 1:46 PM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [edk2] [Patch] MdeModulePkg DxeIpl: remove the hard code alignment= adjustment in Decompress() Section data alignment should be made in the build generation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Star Zeng --- MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/Dxe= IplPeim/DxeLoad.c index f4d7528..178bac4 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -708,18 +708,13 @@ Decompress ( return EFI_OUT_OF_RESOURCES; } // - // Allocate destination buffer, extra one page for adjustment=20 + // Allocate destination buffer // - DstBuffer =3D AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1); + DstBuffer =3D AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize)); if (DstBuffer =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } // - // DstBuffer still is one section. Adjust DstBuffer offset, skip EFI= section header - // to make section data at page alignment. - // - DstBuffer =3D DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION= _HEADER); - // // Call decompress function // Status =3D UefiDecompress ( @@ -749,16 +744,11 @@ Decompress ( // Allocate destination buffer // DstBufferSize =3D UncompressedLength; - DstBuffer =3D AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1= ); + DstBuffer =3D AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize)); if (DstBuffer =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } // - // Adjust DstBuffer offset, skip EFI section header - // to make section data at page alignment. - // - DstBuffer =3D DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_H= EADER); - // // stream is not actually compressed, just encapsulated. So just copy= it. // CopyMem (DstBuffer, CompressionSource, DstBufferSize); --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel