public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/2] MdeModulePkg: Remove the hard code alignment adjustment.
@ 2018-01-10  5:33 Liming Gao
  2018-01-10  5:33 ` [Patch 1/2] MdeModulePkg DxeIpl: remove " Liming Gao
  2018-01-10  5:33 ` [Patch 2/2] MdeModulePkg SectionExtractionPei: " Liming Gao
  0 siblings, 2 replies; 7+ messages in thread
From: Liming Gao @ 2018-01-10  5:33 UTC (permalink / raw)
  To: edk2-devel

Liming Gao (2):
  MdeModulePkg DxeIpl: remove the hard code alignment adjustment.
  MdeModulePkg SectionExtractionPei: remove the hard code alignment
    adjustment

 MdeModulePkg/Core/DxeIplPeim/DxeLoad.c                           | 9 ++-------
 .../Universal/SectionExtractionPei/SectionExtractionPei.c        | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)

-- 
2.8.0.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment adjustment.
  2018-01-10  5:33 [Patch 0/2] MdeModulePkg: Remove the hard code alignment adjustment Liming Gao
@ 2018-01-10  5:33 ` Liming Gao
  2018-01-10  5:37   ` Zeng, Star
  2018-01-10  5:33 ` [Patch 2/2] MdeModulePkg SectionExtractionPei: " Liming Gao
  1 sibling, 1 reply; 7+ messages in thread
From: Liming Gao @ 2018-01-10  5:33 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

Section data alignment should be made in the build generation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index 1f626a9..f4d7528 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -3,7 +3,7 @@
   Responsibility of this module is to load the DXE Core from a Firmware Volume.
 
 Copyright (c) 2016 HP Development Company, L.P.
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -593,16 +593,11 @@ CustomGuidedSectionExtract (
     //
     // Allocate output buffer
     //
-    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) + 1);
+    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize));
     if (*OutputBuffer == NULL) {
       return EFI_OUT_OF_RESOURCES;
     }
     DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
-    //
-    // *OutputBuffer still is one section. Adjust *OutputBuffer offset, 
-    // skip EFI section header to make section data at page alignment.
-    //
-    *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER));
   }
   
   Status = ExtractGuidedSectionDecode (
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch 2/2] MdeModulePkg SectionExtractionPei: remove the hard code alignment adjustment
  2018-01-10  5:33 [Patch 0/2] MdeModulePkg: Remove the hard code alignment adjustment Liming Gao
  2018-01-10  5:33 ` [Patch 1/2] MdeModulePkg DxeIpl: remove " Liming Gao
@ 2018-01-10  5:33 ` Liming Gao
  2018-01-10  5:48   ` Zeng, Star
  1 sibling, 1 reply; 7+ messages in thread
From: Liming Gao @ 2018-01-10  5:33 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

Section data alignment should be made in the build generation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 .../Universal/SectionExtractionPei/SectionExtractionPei.c        | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c b/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c
index c4a3508..63fc94c 100644
--- a/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c
+++ b/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c
@@ -1,7 +1,7 @@
 /** @file
  Section Extraction PEIM
 
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          
 are licensed and made available under the terms and conditions of the BSD License         
 which accompanies this distribution.  The full text of the license may be found at        
@@ -194,16 +194,11 @@ CustomGuidedSectionExtract (
     //
     // Allocate output buffer
     //
-    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) + 1);
+    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize));
     if (*OutputBuffer == NULL) {
       return EFI_OUT_OF_RESOURCES;
     }
     DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
-    //
-    // *OutputBuffer still is one section. Adjust *OutputBuffer offset, 
-    // skip EFI section header to make section data at page alignment.
-    //
-    *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER));
   }
   
   Status = ExtractGuidedSectionDecode (
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment adjustment.
  2018-01-10  5:33 ` [Patch 1/2] MdeModulePkg DxeIpl: remove " Liming Gao
@ 2018-01-10  5:37   ` Zeng, Star
  2018-01-10  5:39     ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Zeng, Star @ 2018-01-10  5:37 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star

Liming,

Similar change should be also done in Decompress() of DxeLoad.c, right?


Thanks,
Star
-----Original Message-----
From: Gao, Liming 
Sent: Wednesday, January 10, 2018 1:33 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment adjustment.

Section data alignment should be made in the build generation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index 1f626a9..f4d7528 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -3,7 +3,7 @@
   Responsibility of this module is to load the DXE Core from a Firmware Volume.
 
 Copyright (c) 2016 HP Development Company, L.P.
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at @@ -593,16 +593,11 @@ CustomGuidedSectionExtract (
     //
     // Allocate output buffer
     //
-    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) + 1);
+    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES 
+ (OutputBufferSize));
     if (*OutputBuffer == NULL) {
       return EFI_OUT_OF_RESOURCES;
     }
     DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
-    //
-    // *OutputBuffer still is one section. Adjust *OutputBuffer offset, 
-    // skip EFI section header to make section data at page alignment.
-    //
-    *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER));
   }
   
   Status = ExtractGuidedSectionDecode (
--
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment adjustment.
  2018-01-10  5:37   ` Zeng, Star
@ 2018-01-10  5:39     ` Gao, Liming
  2018-01-10  5:46       ` Zeng, Star
  0 siblings, 1 reply; 7+ messages in thread
From: Gao, Liming @ 2018-01-10  5:39 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org

Star:
  Right. I will send the separate patch for it. 

>-----Original Message-----
>From: Zeng, Star
>Sent: Wednesday, January 10, 2018 1:38 PM
>To: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org
>Cc: Zeng, Star <star.zeng@intel.com>
>Subject: RE: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code
>alignment adjustment.
>
>Liming,
>
>Similar change should be also done in Decompress() of DxeLoad.c, right?
>
>
>Thanks,
>Star
>-----Original Message-----
>From: Gao, Liming
>Sent: Wednesday, January 10, 2018 1:33 PM
>To: edk2-devel@lists.01.org
>Cc: Zeng, Star <star.zeng@intel.com>
>Subject: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment
>adjustment.
>
>Section data alignment should be made in the build generation.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Liming Gao <liming.gao@intel.com>
>Cc: Star Zeng <star.zeng@intel.com>
>---
> MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
>diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>index 1f626a9..f4d7528 100644
>--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>@@ -3,7 +3,7 @@
>   Responsibility of this module is to load the DXE Core from a Firmware
>Volume.
>
> Copyright (c) 2016 HP Development Company, L.P.
>-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> This program and the accompanying materials  are licensed and made
>available under the terms and conditions of the BSD License  which
>accompanies this distribution.  The full text of the license may be found at
>@@ -593,16 +593,11 @@ CustomGuidedSectionExtract (
>     //
>     // Allocate output buffer
>     //
>-    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) +
>1);
>+    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES
>+ (OutputBufferSize));
>     if (*OutputBuffer == NULL) {
>       return EFI_OUT_OF_RESOURCES;
>     }
>     DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required
>is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
>-    //
>-    // *OutputBuffer still is one section. Adjust *OutputBuffer offset,
>-    // skip EFI section header to make section data at page alignment.
>-    //
>-    *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE -
>sizeof (EFI_COMMON_SECTION_HEADER));
>   }
>
>   Status = ExtractGuidedSectionDecode (
>--
>2.8.0.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment adjustment.
  2018-01-10  5:39     ` Gao, Liming
@ 2018-01-10  5:46       ` Zeng, Star
  0 siblings, 0 replies; 7+ messages in thread
From: Zeng, Star @ 2018-01-10  5:46 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star

Ok, Reviewed-by: Star Zeng <star.zeng@intel.com>

Thanks,
Star
-----Original Message-----
From: Gao, Liming 
Sent: Wednesday, January 10, 2018 1:40 PM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org
Subject: RE: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code alignment adjustment.

Star:
  Right. I will send the separate patch for it. 

>-----Original Message-----
>From: Zeng, Star
>Sent: Wednesday, January 10, 2018 1:38 PM
>To: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org
>Cc: Zeng, Star <star.zeng@intel.com>
>Subject: RE: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code 
>alignment adjustment.
>
>Liming,
>
>Similar change should be also done in Decompress() of DxeLoad.c, right?
>
>
>Thanks,
>Star
>-----Original Message-----
>From: Gao, Liming
>Sent: Wednesday, January 10, 2018 1:33 PM
>To: edk2-devel@lists.01.org
>Cc: Zeng, Star <star.zeng@intel.com>
>Subject: [Patch 1/2] MdeModulePkg DxeIpl: remove the hard code 
>alignment adjustment.
>
>Section data alignment should be made in the build generation.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Liming Gao <liming.gao@intel.com>
>Cc: Star Zeng <star.zeng@intel.com>
>---
> MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
>diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>index 1f626a9..f4d7528 100644
>--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
>@@ -3,7 +3,7 @@
>   Responsibility of this module is to load the DXE Core from a 
>Firmware Volume.
>
> Copyright (c) 2016 HP Development Company, L.P.
>-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> This program and the accompanying materials  are licensed and made 
>available under the terms and conditions of the BSD License  which 
>accompanies this distribution.  The full text of the license may be 
>found at @@ -593,16 +593,11 @@ CustomGuidedSectionExtract (
>     //
>     // Allocate output buffer
>     //
>-    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) +
>1);
>+    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES 
>+ (OutputBufferSize));
>     if (*OutputBuffer == NULL) {
>       return EFI_OUT_OF_RESOURCES;
>     }
>     DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size 
>required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
>-    //
>-    // *OutputBuffer still is one section. Adjust *OutputBuffer offset,
>-    // skip EFI section header to make section data at page alignment.
>-    //
>-    *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE -
>sizeof (EFI_COMMON_SECTION_HEADER));
>   }
>
>   Status = ExtractGuidedSectionDecode (
>--
>2.8.0.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch 2/2] MdeModulePkg SectionExtractionPei: remove the hard code alignment adjustment
  2018-01-10  5:33 ` [Patch 2/2] MdeModulePkg SectionExtractionPei: " Liming Gao
@ 2018-01-10  5:48   ` Zeng, Star
  0 siblings, 0 replies; 7+ messages in thread
From: Zeng, Star @ 2018-01-10  5:48 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
Sent: Wednesday, January 10, 2018 1:34 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: [edk2] [Patch 2/2] MdeModulePkg SectionExtractionPei: remove the hard code alignment adjustment

Section data alignment should be made in the build generation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 .../Universal/SectionExtractionPei/SectionExtractionPei.c        | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c b/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c
index c4a3508..63fc94c 100644
--- a/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c
+++ b/MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c
@@ -1,7 +1,7 @@
 /** @file
  Section Extraction PEIM
 
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials                          
 are licensed and made available under the terms and conditions of the BSD License         
 which accompanies this distribution.  The full text of the license may be found at        
@@ -194,16 +194,11 @@ CustomGuidedSectionExtract (
     //
     // Allocate output buffer
     //
-    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize) + 1);
+    *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (OutputBufferSize));
     if (*OutputBuffer == NULL) {
       return EFI_OUT_OF_RESOURCES;
     }
     DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
-    //
-    // *OutputBuffer still is one section. Adjust *OutputBuffer offset, 
-    // skip EFI section header to make section data at page alignment.
-    //
-    *OutputBuffer = (VOID *)((UINT8 *) *OutputBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER));
   }
   
   Status = ExtractGuidedSectionDecode (
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-10  5:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10  5:33 [Patch 0/2] MdeModulePkg: Remove the hard code alignment adjustment Liming Gao
2018-01-10  5:33 ` [Patch 1/2] MdeModulePkg DxeIpl: remove " Liming Gao
2018-01-10  5:37   ` Zeng, Star
2018-01-10  5:39     ` Gao, Liming
2018-01-10  5:46       ` Zeng, Star
2018-01-10  5:33 ` [Patch 2/2] MdeModulePkg SectionExtractionPei: " Liming Gao
2018-01-10  5:48   ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox