public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch edk2-stable202208 0/2] Fix GenSec EFI_SECTION_FREEFORM_SUBTYPE_GUID
@ 2022-08-16  1:49 Michael D Kinney
  2022-08-16  1:49 ` [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Michael D Kinney
  2022-08-16  1:49 ` [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header Michael D Kinney
  0 siblings, 2 replies; 5+ messages in thread
From: Michael D Kinney @ 2022-08-16  1:49 UTC (permalink / raw)
  To: devel; +Cc: Konstantin Aladyshev, Bob Feng, Liming Gao, Yuwei Chen

If no GUID value is provided with EFI_SECTION_FREEFORM_SUBTYPE_GUID
then preserve the prior behavior until all downstream platforms
are updated to pass in a GUID value.

When the size of a EFI_SECTION_FREEFORM_SUBTYPE_GUID section required
the use of EFI_FREEFORM_SUBTYPE_GUID_SECTION2 header, set the section
type to EFI_SECTION_FREEFORM_SUBTYPE_GUID.

Cc: Konstantin Aladyshev <aladyshev22@gmail.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (2):
  BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID
    provided
  BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID
    header

 BaseTools/Source/C/GenSec/GenSec.c | 31 ++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

-- 
2.37.1.windows.1


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

* [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided
  2022-08-16  1:49 [Patch edk2-stable202208 0/2] Fix GenSec EFI_SECTION_FREEFORM_SUBTYPE_GUID Michael D Kinney
@ 2022-08-16  1:49 ` Michael D Kinney
  2022-08-16  3:27   ` [edk2-devel] " Bob Feng
  2022-08-16  1:49 ` [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header Michael D Kinney
  1 sibling, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2022-08-16  1:49 UTC (permalink / raw)
  To: devel; +Cc: Konstantin Aladyshev, Bob Feng, Liming Gao, Yuwei Chen

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4022

If no GUID value is provided with EFI_SECTION_FREEFORM_SUBTYPE_GUID
then preserve the prior behavior until all downstream platforms
are updated to pass in a GUID value.

Cc: Konstantin Aladyshev <aladyshev22@gmail.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 BaseTools/Source/C/GenSec/GenSec.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index d86cc197cc26..191a49d99228 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1752,8 +1752,7 @@ Routine Description:
   // Check whether there is GUID for the SubtypeGuid section
   //
   if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid (&VendorGuid, &mZeroGuid) == 0)) {
-    Error (NULL, 0, 1001, "Missing options", "GUID");
-    goto Finish;
+    fprintf (stdout, "Warning: input guid value is required for section type %s\n", SectionName);
   }
 
   //
@@ -1825,13 +1824,25 @@ Routine Description:
     break;
 
   case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
-    Status = GenSectionSubtypeGuidSection (
-              InputFileName,
-              InputFileAlign,
-              InputFileNum,
-              &VendorGuid,
-              &OutFileBuffer
-              );
+    if (CompareGuid (&VendorGuid, &mZeroGuid) == 0) {
+      //
+      // Preserve existing behavior when no GUID value is provided
+      //
+      Status = GenSectionCommonLeafSection (
+                InputFileName,
+                InputFileNum,
+                SectType,
+                &OutFileBuffer
+                );
+    } else {
+      Status = GenSectionSubtypeGuidSection (
+                InputFileName,
+                InputFileAlign,
+                InputFileNum,
+                &VendorGuid,
+                &OutFileBuffer
+                );
+    }
     break;
 
   case EFI_SECTION_VERSION:
-- 
2.37.1.windows.1


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

* [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header
  2022-08-16  1:49 [Patch edk2-stable202208 0/2] Fix GenSec EFI_SECTION_FREEFORM_SUBTYPE_GUID Michael D Kinney
  2022-08-16  1:49 ` [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Michael D Kinney
@ 2022-08-16  1:49 ` Michael D Kinney
  2022-08-16  3:16   ` Bob Feng
  1 sibling, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2022-08-16  1:49 UTC (permalink / raw)
  To: devel; +Cc: Konstantin Aladyshev, Bob Feng, Liming Gao, Yuwei Chen

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4021

When the size of a EFI_SECTION_FREEFORM_SUBTYPE_GUID section required
the use of EFI_FREEFORM_SUBTYPE_GUID_SECTION2 header, set the section
type to EFI_SECTION_FREEFORM_SUBTYPE_GUID.

Cc: Konstantin Aladyshev <aladyshev22@gmail.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 BaseTools/Source/C/GenSec/GenSec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index 191a49d99228..e318d45f77d3 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1112,7 +1112,7 @@ Routine Description:
   //
   if (TotalLength >= MAX_SECTION_SIZE) {
     SubtypeGuidSect2 = (EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *) FileBuffer;
-    SubtypeGuidSect2->CommonHeader.Type     = EFI_SECTION_GUID_DEFINED;
+    SubtypeGuidSect2->CommonHeader.Type     = EFI_SECTION_FREEFORM_SUBTYPE_GUID;
     SubtypeGuidSect2->CommonHeader.Size[0]  = (UINT8) 0xff;
     SubtypeGuidSect2->CommonHeader.Size[1]  = (UINT8) 0xff;
     SubtypeGuidSect2->CommonHeader.Size[2]  = (UINT8) 0xff;
-- 
2.37.1.windows.1


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

* Re: [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header
  2022-08-16  1:49 ` [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header Michael D Kinney
@ 2022-08-16  3:16   ` Bob Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Feng @ 2022-08-16  3:16 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Konstantin Aladyshev, Gao, Liming, Chen, Christine

This patch is good to me.

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Tuesday, August 16, 2022 9:49 AM
To: devel@edk2.groups.io
Cc: Konstantin Aladyshev <aladyshev22@gmail.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4021

When the size of a EFI_SECTION_FREEFORM_SUBTYPE_GUID section required the use of EFI_FREEFORM_SUBTYPE_GUID_SECTION2 header, set the section type to EFI_SECTION_FREEFORM_SUBTYPE_GUID.

Cc: Konstantin Aladyshev <aladyshev22@gmail.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 BaseTools/Source/C/GenSec/GenSec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index 191a49d99228..e318d45f77d3 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1112,7 +1112,7 @@ Routine Description:
   //
   if (TotalLength >= MAX_SECTION_SIZE) {
     SubtypeGuidSect2 = (EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *) FileBuffer;
-    SubtypeGuidSect2->CommonHeader.Type     = EFI_SECTION_GUID_DEFINED;
+    SubtypeGuidSect2->CommonHeader.Type     = EFI_SECTION_FREEFORM_SUBTYPE_GUID;
     SubtypeGuidSect2->CommonHeader.Size[0]  = (UINT8) 0xff;
     SubtypeGuidSect2->CommonHeader.Size[1]  = (UINT8) 0xff;
     SubtypeGuidSect2->CommonHeader.Size[2]  = (UINT8) 0xff;
--
2.37.1.windows.1


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

* Re: [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided
  2022-08-16  1:49 ` [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Michael D Kinney
@ 2022-08-16  3:27   ` Bob Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Feng @ 2022-08-16  3:27 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kinney, Michael D
  Cc: Konstantin Aladyshev, Gao, Liming, Chen, Christine

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney
Sent: Tuesday, August 16, 2022 9:49 AM
To: devel@edk2.groups.io
Cc: Konstantin Aladyshev <aladyshev22@gmail.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [edk2-devel] [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4022

If no GUID value is provided with EFI_SECTION_FREEFORM_SUBTYPE_GUID then preserve the prior behavior until all downstream platforms are updated to pass in a GUID value.

Cc: Konstantin Aladyshev <aladyshev22@gmail.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 BaseTools/Source/C/GenSec/GenSec.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index d86cc197cc26..191a49d99228 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1752,8 +1752,7 @@ Routine Description:
   // Check whether there is GUID for the SubtypeGuid section
   //
   if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid (&VendorGuid, &mZeroGuid) == 0)) {
-    Error (NULL, 0, 1001, "Missing options", "GUID");
-    goto Finish;
+    fprintf (stdout, "Warning: input guid value is required for section 
+ type %s\n", SectionName);
   }
 
   //
@@ -1825,13 +1824,25 @@ Routine Description:
     break;
 
   case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
-    Status = GenSectionSubtypeGuidSection (
-              InputFileName,
-              InputFileAlign,
-              InputFileNum,
-              &VendorGuid,
-              &OutFileBuffer
-              );
+    if (CompareGuid (&VendorGuid, &mZeroGuid) == 0) {
+      //
+      // Preserve existing behavior when no GUID value is provided
+      //
+      Status = GenSectionCommonLeafSection (
+                InputFileName,
+                InputFileNum,
+                SectType,
+                &OutFileBuffer
+                );
+    } else {
+      Status = GenSectionSubtypeGuidSection (
+                InputFileName,
+                InputFileAlign,
+                InputFileNum,
+                &VendorGuid,
+                &OutFileBuffer
+                );
+    }
     break;
 
   case EFI_SECTION_VERSION:
--
2.37.1.windows.1







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

end of thread, other threads:[~2022-08-16  3:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-16  1:49 [Patch edk2-stable202208 0/2] Fix GenSec EFI_SECTION_FREEFORM_SUBTYPE_GUID Michael D Kinney
2022-08-16  1:49 ` [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Michael D Kinney
2022-08-16  3:27   ` [edk2-devel] " Bob Feng
2022-08-16  1:49 ` [Patch edk2-stable202208 2/2] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header Michael D Kinney
2022-08-16  3:16   ` Bob Feng

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