Re: [edk2] [Patch] MdeModulePkg PeiCore: Update debug message to print the correct FV length

2017-12-27 Thread Zeng, Star
The code without this patch will have incorrect value shown for handle, please 
update the commit title.

With title updated,
Reviewed-by: Star Zeng 


Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Thursday, December 28, 2017 2:36 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [Patch] MdeModulePkg PeiCore: Update debug message to print the 
correct FV length

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c 
b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 7cb295c..8009546 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -514,7 +514,7 @@ PeiInitializeFv (
 "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n", 
 (UINT32) PrivateData->FvCount, 
 (VOID *) BfvHeader, 
-BfvHeader->FvLength,
+(UINT32) BfvHeader->FvLength,
 FvHandle
 ));
   PrivateData->FvCount ++;
-- 
2.8.0.windows.1

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


[edk2] [Patch] MdeModulePkg PeiCore: Update debug message to print the correct FV length

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Core/Pei/FwVol/FwVol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c 
b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 7cb295c..8009546 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -514,7 +514,7 @@ PeiInitializeFv (
 "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n", 
 (UINT32) PrivateData->FvCount, 
 (VOID *) BfvHeader, 
-BfvHeader->FvLength,
+(UINT32) BfvHeader->FvLength,
 FvHandle
 ));
   PrivateData->FvCount ++;
-- 
2.8.0.windows.1

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


Re: [edk2] [Patch] MdeModulePkg HiiDataBase: Fix the potential NULL pointer access

2017-12-27 Thread Zeng, Star
Reviewed-by: Star Zeng 

Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Thursday, December 28, 2017 12:54 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [Patch] MdeModulePkg HiiDataBase: Fix the potential NULL pointer access

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 4a2dc8d030..e8f4564e64 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -721,9 +721,14 @@ FindQuestionDefaultSetting (
   VariableStorage = NULL;
 }
 Entry = AllocatePool (sizeof (VARSTORAGE_DEFAULT_DATA));
-Entry->DefaultId = DefaultId;
-Entry->VariableStorage = VariableStorage;
-InsertTailList (, >Entry);
+if (Entry != NULL) {
+  Entry->DefaultId = DefaultId;
+  Entry->VariableStorage = VariableStorage;
+  InsertTailList (, >Entry);
+} else if (VariableStorage != NULL) {
+  FreePool (VariableStorage);
+  VariableStorage = NULL;
+}
   }
   //
   // The matched variable storage is not found.
-- 
2.11.0.windows.1

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


[edk2] [Patch] MdeModulePkg HiiDataBase: Fix the potential NULL pointer access

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 4a2dc8d030..e8f4564e64 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -721,9 +721,14 @@ FindQuestionDefaultSetting (
   VariableStorage = NULL;
 }
 Entry = AllocatePool (sizeof (VARSTORAGE_DEFAULT_DATA));
-Entry->DefaultId = DefaultId;
-Entry->VariableStorage = VariableStorage;
-InsertTailList (, >Entry);
+if (Entry != NULL) {
+  Entry->DefaultId = DefaultId;
+  Entry->VariableStorage = VariableStorage;
+  InsertTailList (, >Entry);
+} else if (VariableStorage != NULL) {
+  FreePool (VariableStorage);
+  VariableStorage = NULL;
+}
   }
   //
   // The matched variable storage is not found.
-- 
2.11.0.windows.1

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


Re: [edk2] [Patch 1/4] IntelFspWrapperPkg: Convert INF file to dos format

2017-12-27 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming
> Gao
> Sent: Wednesday, December 27, 2017 11:23 PM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen 
> Subject: [edk2] [Patch 1/4] IntelFspWrapperPkg: Convert INF file to dos format
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao 
> Cc: Jiewen Yao 
> ---
>  .../Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf | 2
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTes
> tLib.inf
> b/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTes
> tLib.inf
> index 4d2cbd850f..865a0205d6 100644
> ---
> a/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTes
> tLib.inf
> +++
> b/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTes
> tLib.inf
> @@ -53,4 +53,4 @@
>HobLib
> 
>  [Guids]
> -  gFspBootLoaderTolumHobGuid## SOMETIMES_CONSUMES ##
> GUID
> \ No newline at end of file
> +  gFspBootLoaderTolumHobGuid## SOMETIMES_CONSUMES ##
> GUID
> --
> 2.11.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/2] Fix error in PrintLib

2017-12-27 Thread Zeng, Star
Reviewed-by: Star Zeng 

Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jian J 
Wang
Sent: Thursday, December 28, 2017 10:38 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH v2 0/2] Fix error in PrintLib

> v2:
>a. Correct incorrect description in commit log
>b. Fix another similar issue in the same function
>c. Fix similar issues in MdeModulePkg/DxePrintLibPrint2Protocol

Due to a potential hole in the stop condition of the loop, the two continuous 
access to ArgumentString (index, index+1) inside the loop might cause the 
string ending character ('\0') and the byte after it to be read.

Jian J Wang (2):
  MdePkg/BasePrintLib: Fix error in Precision position calculation
  MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential string over read

 MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 7 +--
 MdePkg/Library/BasePrintLib/PrintLibInternal.c| 7 +--
 2 files changed, 10 insertions(+), 4 deletions(-)

--
2.15.1.windows.2

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


Re: [edk2] [PATCH v2 0/2] Fix error in PrintLib

2017-12-27 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jian J 
> Wang
> Sent: Thursday, December 28, 2017 10:38 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH v2 0/2] Fix error in PrintLib
> 
> > v2:
> >a. Correct incorrect description in commit log
> >b. Fix another similar issue in the same function
> >c. Fix similar issues in MdeModulePkg/DxePrintLibPrint2Protocol
> 
> Due to a potential hole in the stop condition of the loop, the two continuous
> access to ArgumentString (index, index+1) inside the loop might cause the
> string ending character ('\0') and the byte after it to be read.
> 
> Jian J Wang (2):
>   MdePkg/BasePrintLib: Fix error in Precision position calculation
>   MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential string over read
> 
>  MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 7 +--
>  MdePkg/Library/BasePrintLib/PrintLibInternal.c| 7 +--
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> --
> 2.15.1.windows.2
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 2/2] MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential string over read

2017-12-27 Thread Jian J Wang
> v2:
>Add in v2

Due to a potential hole in the stop condition of loop, the two continuous
access to ArgumentString (index, index+1) inside the loop might cause the
string ending character ('\0') and the byte after it to be read.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Jiewen Yao 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c 
b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
index 56534e56c3..570d06d82e 100644
--- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
+++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
@@ -2050,7 +2050,10 @@ InternalPrintLibSPrintMarker (
   // Compute the number of characters in ArgumentString and store it in 
Count
   // ArgumentString is either null-terminated, or it contains Precision 
characters
   //
-  for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); 
Count++) {
+  for (Count = 0;
+ArgumentString[Count * BytesPerArgumentCharacter] != '\0' &&
+Count < Precision || ((Flags & PRECISION) == 0);
+Count++) {
 ArgumentCharacter = ((ArgumentString[Count * 
BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * 
BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
 if (ArgumentCharacter == 0) {
   break;
@@ -2107,7 +2110,7 @@ InternalPrintLibSPrintMarker (
 //
 // Copy the string into the output buffer performing the required type 
conversions
 //
-while (Index < Count) {
+while (Index < Count && (*ArgumentString) != '\0') {
   ArgumentCharacter = ((*ArgumentString & 0xff) | 
(((UINT8)*(ArgumentString + 1)) << 8)) & ArgumentMask;
 
   LengthToReturn += (1 * BytesPerOutputCharacter);
-- 
2.15.1.windows.2

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


[edk2] [PATCH v2 0/2] Fix error in PrintLib

2017-12-27 Thread Jian J Wang
> v2:
>a. Correct incorrect description in commit log
>b. Fix another similar issue in the same function
>c. Fix similar issues in MdeModulePkg/DxePrintLibPrint2Protocol

Due to a potential hole in the stop condition of the loop, the two continuous
access to ArgumentString (index, index+1) inside the loop might cause the
string ending character ('\0') and the byte after it to be read.

Jian J Wang (2):
  MdePkg/BasePrintLib: Fix error in Precision position calculation
  MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential string over read

 MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 7 +--
 MdePkg/Library/BasePrintLib/PrintLibInternal.c| 7 +--
 2 files changed, 10 insertions(+), 4 deletions(-)

-- 
2.15.1.windows.2

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


[edk2] [PATCH v2 1/2] MdePkg/BasePrintLib: Fix error in Precision position calculation

2017-12-27 Thread Jian J Wang
> v2:
>a. Correct incorrect description in commit log
>b. Fix another similar issue in the same function

Due to a potential hole in the stop condition of loop, the two continuous
access to ArgumentString (index, index+1) inside the loop might cause the
string ending character ('\0') and the byte after it to be read.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Jiewen Yao 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 MdePkg/Library/BasePrintLib/PrintLibInternal.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c 
b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
index 28d946472f..fc57255068 100644
--- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
+++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
@@ -1107,7 +1107,10 @@ BasePrintLibSPrintMarker (
   // Compute the number of characters in ArgumentString and store it in 
Count
   // ArgumentString is either null-terminated, or it contains Precision 
characters
   //
-  for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); 
Count++) {
+  for (Count = 0;
+ArgumentString[Count * BytesPerArgumentCharacter] != '\0' &&
+(Count < Precision || ((Flags & PRECISION) == 0));
+  Count++) {
 ArgumentCharacter = ((ArgumentString[Count * 
BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * 
BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
 if (ArgumentCharacter == 0) {
   break;
@@ -1164,7 +1167,7 @@ BasePrintLibSPrintMarker (
 //
 // Copy the string into the output buffer performing the required type 
conversions
 //
-while (Index < Count) {
+while (Index < Count && (*ArgumentString) != '\0') {
   ArgumentCharacter = ((*ArgumentString & 0xff) | 
(((UINT8)*(ArgumentString + 1)) << 8)) & ArgumentMask;
 
   LengthToReturn += (1 * BytesPerOutputCharacter);
-- 
2.15.1.windows.2

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


Re: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision position calculation

2017-12-27 Thread Wang, Jian J
Sure.

Regards,
Jian


> -Original Message-
> From: Gao, Liming
> Sent: Thursday, December 28, 2017 9:57 AM
> To: Wang, Jian J ; Kinney, Michael D
> ; edk2-devel@lists.01.org
> Cc: Yao, Jiewen ; Zeng, Star 
> Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision
> position calculation
> 
> Jian:
>   MdePkg/Library/BasePrintLib/PrintLibInternal.c line 1171 has the similar 
> issue.
> Could you fix it also?
> 
>   And, MdeModulePkg\Library\DxePrintLibPrint2Protocol\PrintLib.c have the
> same issue. Could you sync this fix to it?
> 
> Thanks
> Liming
> > -Original Message-
> > From: Wang, Jian J
> > Sent: Thursday, December 28, 2017 8:29 AM
> > To: Kinney, Michael D ; edk2-devel@lists.01.org
> > Cc: Yao, Jiewen ; Zeng, Star ;
> Gao, Liming 
> > Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision
> position calculation
> >
> > I revisit the code again. You're right that the commit log is not correct.
> > The '\0' would be read and even the one pass it.
> >
> > Regards,
> > Jian
> >
> >
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Thursday, December 28, 2017 12:38 AM
> > > To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
> > > Michael D 
> > > Cc: Yao, Jiewen ; Zeng, Star ;
> > > Gao, Liming 
> > > Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision
> > > position calculation
> > >
> > > Is the commit log correct?
> > >
> > > Is the issue that the character past the '\0' could be read?
> > >
> > > Mike
> > >
> > > > -Original Message-
> > > > From: Wang, Jian J
> > > > Sent: Tuesday, December 26, 2017 6:14 PM
> > > > To: Wang, Jian J ; edk2-
> > > > de...@lists.01.org
> > > > Cc: Kinney, Michael D ; Yao,
> > > > Jiewen ; Zeng, Star
> > > > ; Gao, Liming 
> > > > Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> > > > incorrect Precision position calculation
> > > >
> > > > Mike and Liming,
> > > >
> > > > Could you take a look at this patch?
> > > >
> > > > Regards,
> > > > Jian
> > > >
> > > >
> > > > > -Original Message-
> > > > > From: edk2-devel [mailto:edk2-devel-
> > > > boun...@lists.01.org] On Behalf Of Jian J
> > > > > Wang
> > > > > Sent: Monday, December 25, 2017 10:09 AM
> > > > > To: edk2-devel@lists.01.org
> > > > > Cc: Kinney, Michael D ;
> > > > Yao, Jiewen
> > > > > ; Zeng, Star
> > > > ; Gao, Liming
> > > > > 
> > > > > Subject: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> > > > incorrect Precision position
> > > > > calculation
> > > > >
> > > > > Due to the a potential hole in the stop condition of
> > > > for-loop, the two
> > > > > continuous access to ArgumentString (index, index+1)
> > > > inside the loop
> > > > > might cause the string ending character ('\0') to be
> > > > read.
> > > > >
> > > > > Cc: Michael D Kinney 
> > > > > Cc: Liming Gao 
> > > > > Cc: Jiewen Yao 
> > > > > Cc: Star Zeng 
> > > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > > Signed-off-by: Jian J Wang 
> > > > > ---
> > > > >  MdePkg/Library/BasePrintLib/PrintLibInternal.c | 5
> > > > -
> > > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git
> > > > a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > > b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > > index 28d946472f..297d5a05b5 100644
> > > > > --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > > +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > > @@ -1107,7 +1107,10 @@ BasePrintLibSPrintMarker (
> > > > >// Compute the number of characters in
> > > > ArgumentString and store it in
> > > > > Count
> > > > >// ArgumentString is either null-terminated, or
> > > > it contains Precision
> > > > > characters
> > > > >//
> > > > > -  for (Count = 0; Count < Precision || ((Flags &
> > > > PRECISION) == 0); Count++) {
> > > > > +  for (Count = 0;
> > > > > +ArgumentString[Count *
> > > > BytesPerArgumentCharacter] != '\0' &&
> > > > > +(Count < Precision || ((Flags & PRECISION)
> > > > == 0));
> > > > > +  Count++) {
> > > > >  ArgumentCharacter = ((ArgumentString[Count *
> > > > > BytesPerArgumentCharacter] & 0xff) |
> > > > ((ArgumentString[Count *
> > > > > BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
> > > > >  if (ArgumentCharacter == 

Re: [edk2] [Patch 4/4] SecurityPkg: Convert source file to DOS format

2017-12-27 Thread Zhang, Chao B
Reviewed-by : Chao Zhang 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
Gao
Sent: Wednesday, December 27, 2017 11:23 PM
To: edk2-devel@lists.01.org
Cc: Long, Qin 
Subject: [edk2] [Patch 4/4] SecurityPkg: Convert source file to DOS format

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Qin Long 
---
 .../SecureBootConfigDxe/SecureBootConfigImpl.c | 26 +++---
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 4ec0f8d13a..e3066f77be 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCo
+++ nfigImpl.c
@@ -3145,9 +3145,9 @@ DeleteSignatureEx (
   if (DelType == Delete_Signature_List_All) {
 VariableDataSize = 0;
   } else {
-//
-//  Traverse to target EFI_SIGNATURE_LIST but others will be skipped.
-//
+//
+//  Traverse to target EFI_SIGNATURE_LIST but others will be skipped.
+//
 while ((RemainingSize > 0) && (RemainingSize >= 
ListWalker->SignatureListSize) && ListIndex < PrivateData->ListIndex) {
   CopyMem ((UINT8 *)NewVariableData + Offset, ListWalker, 
ListWalker->SignatureListSize);
   Offset += ListWalker->SignatureListSize; @@ -3157,17 +3157,17 @@ 
DeleteSignatureEx (
   ListIndex++;
 }
 
-//
-//  Handle the target EFI_SIGNATURE_LIST.
-//  If CheckedCount == SIGNATURE_DATA_COUNTS (ListWalker) or DelType == 
Delete_Signature_List_One
-//  it means delete the whole EFI_SIGNATURE_LIST, So we just skip this 
EFI_SIGNATURE_LIST.
-//
-if (CheckedCount < SIGNATURE_DATA_COUNTS (ListWalker) && DelType == 
Delete_Signature_Data) {
+//
+//  Handle the target EFI_SIGNATURE_LIST.
+//  If CheckedCount == SIGNATURE_DATA_COUNTS (ListWalker) or DelType == 
Delete_Signature_List_One
+//  it means delete the whole EFI_SIGNATURE_LIST, So we just skip this 
EFI_SIGNATURE_LIST.
+//
+if (CheckedCount < SIGNATURE_DATA_COUNTS (ListWalker) && DelType == 
+ Delete_Signature_Data) {
   NewCertList = (EFI_SIGNATURE_LIST *)(NewVariableData + Offset);
   //
   // Copy header.
   //
-  CopyMem ((UINT8 *)NewVariableData + Offset, ListWalker, sizeof 
(EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize);
+  CopyMem ((UINT8 *)NewVariableData + Offset, ListWalker, sizeof 
+ (EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize);
   Offset += sizeof (EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize;
 
   DataWalker = (EFI_SIGNATURE_DATA *)((UINT8 *)ListWalker + 
sizeof(EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize); @@ -3188,9 
+3188,9 @@ DeleteSignatureEx (
   }
 }
 
-RemainingSize -= ListWalker->SignatureListSize;
-ListWalker = (EFI_SIGNATURE_LIST *)((UINT8 *)ListWalker + 
ListWalker->SignatureListSize);
-
+RemainingSize -= ListWalker->SignatureListSize;
+ListWalker = (EFI_SIGNATURE_LIST *)((UINT8 *)ListWalker + 
+ ListWalker->SignatureListSize);
+
 //
 // Copy remaining data, maybe 0.
 //
--
2.11.0.windows.1

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


Re: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision position calculation

2017-12-27 Thread Gao, Liming
Jian:
  MdePkg/Library/BasePrintLib/PrintLibInternal.c line 1171 has the similar 
issue. Could you fix it also?

  And, MdeModulePkg\Library\DxePrintLibPrint2Protocol\PrintLib.c have the same 
issue. Could you sync this fix to it?

Thanks
Liming
> -Original Message-
> From: Wang, Jian J
> Sent: Thursday, December 28, 2017 8:29 AM
> To: Kinney, Michael D ; edk2-devel@lists.01.org
> Cc: Yao, Jiewen ; Zeng, Star ; 
> Gao, Liming 
> Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision 
> position calculation
> 
> I revisit the code again. You're right that the commit log is not correct.
> The '\0' would be read and even the one pass it.
> 
> Regards,
> Jian
> 
> 
> > -Original Message-
> > From: Kinney, Michael D
> > Sent: Thursday, December 28, 2017 12:38 AM
> > To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
> > Michael D 
> > Cc: Yao, Jiewen ; Zeng, Star ;
> > Gao, Liming 
> > Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision
> > position calculation
> >
> > Is the commit log correct?
> >
> > Is the issue that the character past the '\0' could be read?
> >
> > Mike
> >
> > > -Original Message-
> > > From: Wang, Jian J
> > > Sent: Tuesday, December 26, 2017 6:14 PM
> > > To: Wang, Jian J ; edk2-
> > > de...@lists.01.org
> > > Cc: Kinney, Michael D ; Yao,
> > > Jiewen ; Zeng, Star
> > > ; Gao, Liming 
> > > Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> > > incorrect Precision position calculation
> > >
> > > Mike and Liming,
> > >
> > > Could you take a look at this patch?
> > >
> > > Regards,
> > > Jian
> > >
> > >
> > > > -Original Message-
> > > > From: edk2-devel [mailto:edk2-devel-
> > > boun...@lists.01.org] On Behalf Of Jian J
> > > > Wang
> > > > Sent: Monday, December 25, 2017 10:09 AM
> > > > To: edk2-devel@lists.01.org
> > > > Cc: Kinney, Michael D ;
> > > Yao, Jiewen
> > > > ; Zeng, Star
> > > ; Gao, Liming
> > > > 
> > > > Subject: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> > > incorrect Precision position
> > > > calculation
> > > >
> > > > Due to the a potential hole in the stop condition of
> > > for-loop, the two
> > > > continuous access to ArgumentString (index, index+1)
> > > inside the loop
> > > > might cause the string ending character ('\0') to be
> > > read.
> > > >
> > > > Cc: Michael D Kinney 
> > > > Cc: Liming Gao 
> > > > Cc: Jiewen Yao 
> > > > Cc: Star Zeng 
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Jian J Wang 
> > > > ---
> > > >  MdePkg/Library/BasePrintLib/PrintLibInternal.c | 5
> > > -
> > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git
> > > a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > index 28d946472f..297d5a05b5 100644
> > > > --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > > @@ -1107,7 +1107,10 @@ BasePrintLibSPrintMarker (
> > > >// Compute the number of characters in
> > > ArgumentString and store it in
> > > > Count
> > > >// ArgumentString is either null-terminated, or
> > > it contains Precision
> > > > characters
> > > >//
> > > > -  for (Count = 0; Count < Precision || ((Flags &
> > > PRECISION) == 0); Count++) {
> > > > +  for (Count = 0;
> > > > +ArgumentString[Count *
> > > BytesPerArgumentCharacter] != '\0' &&
> > > > +(Count < Precision || ((Flags & PRECISION)
> > > == 0));
> > > > +  Count++) {
> > > >  ArgumentCharacter = ((ArgumentString[Count *
> > > > BytesPerArgumentCharacter] & 0xff) |
> > > ((ArgumentString[Count *
> > > > BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
> > > >  if (ArgumentCharacter == 0) {
> > > >break;
> > > > --
> > > > 2.15.1.windows.2
> > > >
> > > > ___
> > > > edk2-devel mailing list
> > > > edk2-devel@lists.01.org
> > > > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] SecurityPkg: Convert source file to DOS format

2017-12-27 Thread Zhang, Chao B
Reviewed-by: Chao Zhang 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
Gao
Sent: Thursday, December 28, 2017 9:10 AM
To: edk2-devel@lists.01.org
Cc: Long, Qin 
Subject: [edk2] [Patch] SecurityPkg: Convert source file to DOS format

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Qin Long 
---
 .../Include/Ppi/FirmwareVolumeInfoPrehashedFV.h| 148 ++---
 1 file changed, 74 insertions(+), 74 deletions(-)

diff --git a/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h 
b/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h
index 80fb783..23a5671 100644
--- a/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h
+++ b/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h
@@ -1,74 +1,74 @@
-/** @file
-PPI to describe all hash digests for a given FV
-
-Copyright (c) 2017, Intel Corporation. All rights reserved. -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 
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT 
WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-/**
-PPI to describe all hash digests for a given FV
-
-Copyright (c) 2017, Microsoft Corporation
-
-All rights reserved.
-Redistribution and use in source and binary forms, with or without 
-modification, are permitted provided that the following conditions are met:
-1. Redistributions of source code must retain the above copyright notice, 
-this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice, 
-this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 
DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
(INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-**/
-
-#ifndef __PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_H__
-#define __PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_H__
-
-#define EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI_GUID \
- { 0x3ce1e631, 0x7008, 0x477c, { 0xad, 0xa7, 0x5d, 0xcf, 0xc7, 0xc1, 0x49, 
0x4b } }
-
-//
-// HashAlgoId is TPM_ALG_ID in Tpm20.h
-//
-typedef struct _HASH_INFO {
-  UINT16 HashAlgoId;
-  UINT16 HashSize;
-  //UINT8Hash[];
-} HASH_INFO;
-
-//
-// This PPI carries prehashsed data for one FV.  Platform should ensure 1:1 
mapping between pre-hashed PPI and corresponding FV.
-// The Count field in PPI is followed by Count number of FV hash info entries, 
which can be extended to PCR and logged to TCG event log directly by TCG 
modules.
-// TCG module checks TPM required hash algorithms(PcdTpm2HashMask) with each 
pre-hased PPIs
-//   For each pre-hashed PPI
-// If PPI carries hash generated by equivalent or larger algorithm set 
than TPM required, directly use PPI
-// else, drops PPI data and cacluate all hash again
-//
-typedef struct {
-  UINT32 FvBase;
-  UINT32 FvLength;
-  UINT32 Count;
-  //HASH_INFOHashInfo[];
-} EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI;
-
-extern EFI_GUID gEdkiiPeiFirmwareVolumeInfoPrehashedFvPpiGuid;
-
-#endif
-
+/** @file
+PPI to describe all hash digests for a given FV
+
+Copyright (c) 2017, Intel Corporation. All rights reserved. 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 
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+/**
+PPI to describe all hash digests for a given FV
+
+Copyright (c) 2017, Microsoft Corporation
+
+All 

[edk2] [Patch] SecurityPkg: Convert source file to DOS format

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Qin Long 
---
 .../Include/Ppi/FirmwareVolumeInfoPrehashedFV.h| 148 ++---
 1 file changed, 74 insertions(+), 74 deletions(-)

diff --git a/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h 
b/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h
index 80fb783..23a5671 100644
--- a/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h
+++ b/SecurityPkg/Include/Ppi/FirmwareVolumeInfoPrehashedFV.h
@@ -1,74 +1,74 @@
-/** @file
-PPI to describe all hash digests for a given FV
-
-Copyright (c) 2017, Intel Corporation. All rights reserved.
-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
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-/**
-PPI to describe all hash digests for a given FV
-
-Copyright (c) 2017, Microsoft Corporation
-
-All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-1. Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 
DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-**/
-
-#ifndef __PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_H__
-#define __PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_H__
-
-#define EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI_GUID \
- { 0x3ce1e631, 0x7008, 0x477c, { 0xad, 0xa7, 0x5d, 0xcf, 0xc7, 0xc1, 0x49, 
0x4b } }
-
-//
-// HashAlgoId is TPM_ALG_ID in Tpm20.h
-//
-typedef struct _HASH_INFO {
-  UINT16 HashAlgoId;
-  UINT16 HashSize;
-  //UINT8Hash[];
-} HASH_INFO;
-
-//
-// This PPI carries prehashsed data for one FV.  Platform should ensure 1:1 
mapping between pre-hashed PPI and corresponding FV.
-// The Count field in PPI is followed by Count number of FV hash info entries, 
which can be extended to PCR and logged to TCG event log directly by TCG 
modules.
-// TCG module checks TPM required hash algorithms(PcdTpm2HashMask) with each 
pre-hased PPIs
-//   For each pre-hashed PPI
-// If PPI carries hash generated by equivalent or larger algorithm set 
than TPM required, directly use PPI
-// else, drops PPI data and cacluate all hash again
-//
-typedef struct {
-  UINT32 FvBase;
-  UINT32 FvLength;
-  UINT32 Count;
-  //HASH_INFOHashInfo[];
-} EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI;
-
-extern EFI_GUID gEdkiiPeiFirmwareVolumeInfoPrehashedFvPpiGuid;
-
-#endif
-
+/** @file
+PPI to describe all hash digests for a given FV
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.
+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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+/**
+PPI to describe all hash digests for a given FV
+
+Copyright (c) 2017, Microsoft Corporation
+
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above 

Re: [edk2] [PATCH 0/4] Coding style clean-up

2017-12-27 Thread Wang, Jian J
Theoretically, yes. But I think it's a rare case in which someone
will use ESP in a structure but not to represent ESP register.

Regards,
Jian


> -Original Message-
> From: Kinney, Michael D
> Sent: Thursday, December 28, 2017 8:37 AM
> To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
> Michael D 
> Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> 
> Jian,
> 
> I think . is the correct way to list
> this type of exception.  Otherwise we can miss incorrect
> use of that field name.
> 
> Mike
> 
> > -Original Message-
> > From: Wang, Jian J
> > Sent: Wednesday, December 27, 2017 4:28 PM
> > To: Kinney, Michael D ;
> > edk2-devel@lists.01.org
> > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> >
> > Current ECC use . in exception
> > list to exclude those special
> > field name spec defined. Whenever there's a new
> > structure introduced with those field
> > names, which have been added to exception list, the ECC
> > will still report coding style
> > violation. Maybe we can just use  to do
> > field name match for any structure
> > type to exclude those special names. This can avoid the
> > false reports as many as possible.
> >
> > Regards,
> > Jian
> >
> >
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Thursday, December 28, 2017 12:35 AM
> > > To: Wang, Jian J ; edk2-
> > de...@lists.01.org; Kinney,
> > > Michael D 
> > > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> > >
> > > Yes.  Please revert.
> > >
> > > I am not sure I understand the ECC tool update you
> > are suggesting.
> > > Can you provide more details?
> > >
> > > Mike
> > >
> > > > -Original Message-
> > > > From: Wang, Jian J
> > > > Sent: Tuesday, December 26, 2017 4:40 PM
> > > > To: Kinney, Michael D ;
> > edk2-
> > > > de...@lists.01.org
> > > > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-
> > up
> > > >
> > > > Hi Mike,
> > > >
> > > > Since this patch has been checked in trunk, do you
> > think
> > > > it should be reverted?
> > > > In addition, instead of using exception list for
> > the ECC
> > > > tool, I think it'd be better
> > > > to update ECC tool to use keyword match to check if
> > a
> > > > field name is public spec
> > > > defined one. Otherwise, if there's new structure
> > type
> > > > using those field names,
> > > > the tool will still report errors.
> > > >
> > > > Regards,
> > > > Jian
> > > >
> > > > > -Original Message-
> > > > > From: Kinney, Michael D
> > > > > Sent: Wednesday, December 27, 2017 12:48 AM
> > > > > To: Wang, Jian J ; edk2-
> > > > de...@lists.01.org; Kinney,
> > > > > Michael D 
> > > > > Subject: RE: [edk2] [PATCH 0/4] Coding style
> > clean-up
> > > > >
> > > > > Jian,
> > > > >
> > > > > I do not think this change should be made.
> > > > >
> > > > > One of the exceptions for not following the
> > > > > EDK II code style is if the field names are
> > > > > defined in a public specification.  In this case
> > > > > these fields are all listed in a structure in
> > > > > the Intel 64 and IA-32 Architectures Software
> > > > > Development Manual, Section 7.2.1, Figure 7-2
> > > > > using upper case register names.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Mike
> > > > >
> > > > >
> > > > >
> > > > > > -Original Message-
> > > > > > From: edk2-devel [mailto:edk2-devel-
> > > > boun...@lists.01.org]
> > > > > > On Behalf Of Jian J Wang
> > > > > > Sent: Sunday, December 24, 2017 5:07 PM
> > > > > > To: edk2-devel@lists.01.org
> > > > > > Subject: [edk2] [PATCH 0/4] Coding style clean-
> > up
> > > > > >
> > > > > > This patch series are meant for cleaning up
> > code
> > > > > > according to coding style
> > > > > > requirements.
> > > > > >
> > > > > > Jian J Wang (4):
> > > > > >   MdePkg/BaseLib.h: Coding style clean-up
> > > > > >   MdeModulePkg/Core: Coding style clean-up
> > > > > >   UefiCpuPkg/UefiCpuPkg.uni: Add missing string
> > > > > > definition for new PCDs
> > > > > >   UefiCpuPkg: Update code to use new structure
> > field
> > > > > > names
> > > > > >
> > > > > >
> > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c   |
> > > > 5
> > > > > > ++
> > > > > >  MdePkg/Include/Library/BaseLib.h
> > |
> > > > 72
> > > > > > +++---
> > > > > >  .../Ia32/ArchExceptionHandler.c
> > |
> > > > 24
> > > > > > 
> > > > > >  .../X64/ArchExceptionHandler.c
> > |
> > > > 6
> > > > > > +-
> > > > > >  UefiCpuPkg/Library/MpInitLib/MpLib.c
> > |
> > > > 2
> > > > > > +-
> > > > > >  UefiCpuPkg/UefiCpuPkg.uni
> > |
> > > > 16
> > > > > > -
> > > > > >  6 files changed, 71 insertions(+), 54
> > deletions(-)
> > > > > >
> > > > > > --
> > > > > > 2.15.1.windows.2
> > > > > >
> > > > > > ___
> > > > > > edk2-devel mailing 

Re: [edk2] [Patch 2/4] NetworkPkg: Convert source file to DOS format

2017-12-27 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu 



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Liming Gao
> Sent: Wednesday, December 27, 2017 11:23 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin 
> Subject: [edk2] [Patch 2/4] NetworkPkg: Convert source file to DOS format
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao 
> Cc: Wu Jiaxin 
> ---
>  NetworkPkg/HttpDxe/HttpProto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpProto.c
> b/NetworkPkg/HttpDxe/HttpProto.c
> index 925281a9c0..d7fe271168 100644
> --- a/NetworkPkg/HttpDxe/HttpProto.c
> +++ b/NetworkPkg/HttpDxe/HttpProto.c
> @@ -867,7 +867,7 @@ HttpCleanProtocol (
>if (HttpInstance->TlsSb != NULL && HttpInstance->TlsChildHandle != NULL) {
>  //
>  // Destroy the TLS instance.
> -//
> +//
>  HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance-
> >TlsChildHandle);
>}
> 
> --
> 2.11.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/4] Coding style clean-up

2017-12-27 Thread Kinney, Michael D
Jian,

I think . is the correct way to list
this type of exception.  Otherwise we can miss incorrect
use of that field name.

Mike

> -Original Message-
> From: Wang, Jian J
> Sent: Wednesday, December 27, 2017 4:28 PM
> To: Kinney, Michael D ;
> edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> 
> Current ECC use . in exception
> list to exclude those special
> field name spec defined. Whenever there's a new
> structure introduced with those field
> names, which have been added to exception list, the ECC
> will still report coding style
> violation. Maybe we can just use  to do
> field name match for any structure
> type to exclude those special names. This can avoid the
> false reports as many as possible.
> 
> Regards,
> Jian
> 
> 
> > -Original Message-
> > From: Kinney, Michael D
> > Sent: Thursday, December 28, 2017 12:35 AM
> > To: Wang, Jian J ; edk2-
> de...@lists.01.org; Kinney,
> > Michael D 
> > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> >
> > Yes.  Please revert.
> >
> > I am not sure I understand the ECC tool update you
> are suggesting.
> > Can you provide more details?
> >
> > Mike
> >
> > > -Original Message-
> > > From: Wang, Jian J
> > > Sent: Tuesday, December 26, 2017 4:40 PM
> > > To: Kinney, Michael D ;
> edk2-
> > > de...@lists.01.org
> > > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-
> up
> > >
> > > Hi Mike,
> > >
> > > Since this patch has been checked in trunk, do you
> think
> > > it should be reverted?
> > > In addition, instead of using exception list for
> the ECC
> > > tool, I think it'd be better
> > > to update ECC tool to use keyword match to check if
> a
> > > field name is public spec
> > > defined one. Otherwise, if there's new structure
> type
> > > using those field names,
> > > the tool will still report errors.
> > >
> > > Regards,
> > > Jian
> > >
> > > > -Original Message-
> > > > From: Kinney, Michael D
> > > > Sent: Wednesday, December 27, 2017 12:48 AM
> > > > To: Wang, Jian J ; edk2-
> > > de...@lists.01.org; Kinney,
> > > > Michael D 
> > > > Subject: RE: [edk2] [PATCH 0/4] Coding style
> clean-up
> > > >
> > > > Jian,
> > > >
> > > > I do not think this change should be made.
> > > >
> > > > One of the exceptions for not following the
> > > > EDK II code style is if the field names are
> > > > defined in a public specification.  In this case
> > > > these fields are all listed in a structure in
> > > > the Intel 64 and IA-32 Architectures Software
> > > > Development Manual, Section 7.2.1, Figure 7-2
> > > > using upper case register names.
> > > >
> > > > Thanks,
> > > >
> > > > Mike
> > > >
> > > >
> > > >
> > > > > -Original Message-
> > > > > From: edk2-devel [mailto:edk2-devel-
> > > boun...@lists.01.org]
> > > > > On Behalf Of Jian J Wang
> > > > > Sent: Sunday, December 24, 2017 5:07 PM
> > > > > To: edk2-devel@lists.01.org
> > > > > Subject: [edk2] [PATCH 0/4] Coding style clean-
> up
> > > > >
> > > > > This patch series are meant for cleaning up
> code
> > > > > according to coding style
> > > > > requirements.
> > > > >
> > > > > Jian J Wang (4):
> > > > >   MdePkg/BaseLib.h: Coding style clean-up
> > > > >   MdeModulePkg/Core: Coding style clean-up
> > > > >   UefiCpuPkg/UefiCpuPkg.uni: Add missing string
> > > > > definition for new PCDs
> > > > >   UefiCpuPkg: Update code to use new structure
> field
> > > > > names
> > > > >
> > > > >
> MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c   |
> > > 5
> > > > > ++
> > > > >  MdePkg/Include/Library/BaseLib.h
> |
> > > 72
> > > > > +++---
> > > > >  .../Ia32/ArchExceptionHandler.c
> |
> > > 24
> > > > > 
> > > > >  .../X64/ArchExceptionHandler.c
> |
> > > 6
> > > > > +-
> > > > >  UefiCpuPkg/Library/MpInitLib/MpLib.c
> |
> > > 2
> > > > > +-
> > > > >  UefiCpuPkg/UefiCpuPkg.uni
> |
> > > 16
> > > > > -
> > > > >  6 files changed, 71 insertions(+), 54
> deletions(-)
> > > > >
> > > > > --
> > > > > 2.15.1.windows.2
> > > > >
> > > > > ___
> > > > > edk2-devel mailing list
> > > > > edk2-devel@lists.01.org
> > > > > https://lists.01.org/mailman/listinfo/edk2-
> devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision position calculation

2017-12-27 Thread Wang, Jian J
I revisit the code again. You're right that the commit log is not correct.
The '\0' would be read and even the one pass it.

Regards,
Jian


> -Original Message-
> From: Kinney, Michael D
> Sent: Thursday, December 28, 2017 12:38 AM
> To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
> Michael D 
> Cc: Yao, Jiewen ; Zeng, Star ;
> Gao, Liming 
> Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision
> position calculation
> 
> Is the commit log correct?
> 
> Is the issue that the character past the '\0' could be read?
> 
> Mike
> 
> > -Original Message-
> > From: Wang, Jian J
> > Sent: Tuesday, December 26, 2017 6:14 PM
> > To: Wang, Jian J ; edk2-
> > de...@lists.01.org
> > Cc: Kinney, Michael D ; Yao,
> > Jiewen ; Zeng, Star
> > ; Gao, Liming 
> > Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> > incorrect Precision position calculation
> >
> > Mike and Liming,
> >
> > Could you take a look at this patch?
> >
> > Regards,
> > Jian
> >
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-
> > boun...@lists.01.org] On Behalf Of Jian J
> > > Wang
> > > Sent: Monday, December 25, 2017 10:09 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Kinney, Michael D ;
> > Yao, Jiewen
> > > ; Zeng, Star
> > ; Gao, Liming
> > > 
> > > Subject: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> > incorrect Precision position
> > > calculation
> > >
> > > Due to the a potential hole in the stop condition of
> > for-loop, the two
> > > continuous access to ArgumentString (index, index+1)
> > inside the loop
> > > might cause the string ending character ('\0') to be
> > read.
> > >
> > > Cc: Michael D Kinney 
> > > Cc: Liming Gao 
> > > Cc: Jiewen Yao 
> > > Cc: Star Zeng 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Jian J Wang 
> > > ---
> > >  MdePkg/Library/BasePrintLib/PrintLibInternal.c | 5
> > -
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git
> > a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > index 28d946472f..297d5a05b5 100644
> > > --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > > @@ -1107,7 +1107,10 @@ BasePrintLibSPrintMarker (
> > >// Compute the number of characters in
> > ArgumentString and store it in
> > > Count
> > >// ArgumentString is either null-terminated, or
> > it contains Precision
> > > characters
> > >//
> > > -  for (Count = 0; Count < Precision || ((Flags &
> > PRECISION) == 0); Count++) {
> > > +  for (Count = 0;
> > > +ArgumentString[Count *
> > BytesPerArgumentCharacter] != '\0' &&
> > > +(Count < Precision || ((Flags & PRECISION)
> > == 0));
> > > +  Count++) {
> > >  ArgumentCharacter = ((ArgumentString[Count *
> > > BytesPerArgumentCharacter] & 0xff) |
> > ((ArgumentString[Count *
> > > BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
> > >  if (ArgumentCharacter == 0) {
> > >break;
> > > --
> > > 2.15.1.windows.2
> > >
> > > ___
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/4] Coding style clean-up

2017-12-27 Thread Wang, Jian J
Current ECC use . in exception list to exclude those 
special
field name spec defined. Whenever there's a new structure introduced with those 
field
names, which have been added to exception list, the ECC will still report 
coding style
violation. Maybe we can just use  to do field name match for any 
structure
type to exclude those special names. This can avoid the false reports as many 
as possible.

Regards,
Jian


> -Original Message-
> From: Kinney, Michael D
> Sent: Thursday, December 28, 2017 12:35 AM
> To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
> Michael D 
> Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> 
> Yes.  Please revert.
> 
> I am not sure I understand the ECC tool update you are suggesting.
> Can you provide more details?
> 
> Mike
> 
> > -Original Message-
> > From: Wang, Jian J
> > Sent: Tuesday, December 26, 2017 4:40 PM
> > To: Kinney, Michael D ; edk2-
> > de...@lists.01.org
> > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> >
> > Hi Mike,
> >
> > Since this patch has been checked in trunk, do you think
> > it should be reverted?
> > In addition, instead of using exception list for the ECC
> > tool, I think it'd be better
> > to update ECC tool to use keyword match to check if a
> > field name is public spec
> > defined one. Otherwise, if there's new structure type
> > using those field names,
> > the tool will still report errors.
> >
> > Regards,
> > Jian
> >
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Wednesday, December 27, 2017 12:48 AM
> > > To: Wang, Jian J ; edk2-
> > de...@lists.01.org; Kinney,
> > > Michael D 
> > > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> > >
> > > Jian,
> > >
> > > I do not think this change should be made.
> > >
> > > One of the exceptions for not following the
> > > EDK II code style is if the field names are
> > > defined in a public specification.  In this case
> > > these fields are all listed in a structure in
> > > the Intel 64 and IA-32 Architectures Software
> > > Development Manual, Section 7.2.1, Figure 7-2
> > > using upper case register names.
> > >
> > > Thanks,
> > >
> > > Mike
> > >
> > >
> > >
> > > > -Original Message-
> > > > From: edk2-devel [mailto:edk2-devel-
> > boun...@lists.01.org]
> > > > On Behalf Of Jian J Wang
> > > > Sent: Sunday, December 24, 2017 5:07 PM
> > > > To: edk2-devel@lists.01.org
> > > > Subject: [edk2] [PATCH 0/4] Coding style clean-up
> > > >
> > > > This patch series are meant for cleaning up code
> > > > according to coding style
> > > > requirements.
> > > >
> > > > Jian J Wang (4):
> > > >   MdePkg/BaseLib.h: Coding style clean-up
> > > >   MdeModulePkg/Core: Coding style clean-up
> > > >   UefiCpuPkg/UefiCpuPkg.uni: Add missing string
> > > > definition for new PCDs
> > > >   UefiCpuPkg: Update code to use new structure field
> > > > names
> > > >
> > > >  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c   |
> > 5
> > > > ++
> > > >  MdePkg/Include/Library/BaseLib.h   |
> > 72
> > > > +++---
> > > >  .../Ia32/ArchExceptionHandler.c|
> > 24
> > > > 
> > > >  .../X64/ArchExceptionHandler.c |
> > 6
> > > > +-
> > > >  UefiCpuPkg/Library/MpInitLib/MpLib.c   |
> > 2
> > > > +-
> > > >  UefiCpuPkg/UefiCpuPkg.uni  |
> > 16
> > > > -
> > > >  6 files changed, 71 insertions(+), 54 deletions(-)
> > > >
> > > > --
> > > > 2.15.1.windows.2
> > > >
> > > > ___
> > > > edk2-devel mailing list
> > > > edk2-devel@lists.01.org
> > > > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v3 1/3] MdePkg: add RETURNS_TWICE attribute

2017-12-27 Thread M1cha
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Zimmermann 
---
V3: add code comments

 MdePkg/Include/Base.h | 20 
 1 file changed, 20 insertions(+)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 22ab5d3715fb..8c7345609ed5 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -218,6 +218,26 @@ VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE, 4);
   #endif
 #endif
 
+///
+/// Tell the code optimizer that the function will return twice.
+/// This prevents wrong optimizations which can cause bugs.
+///
+#ifndef RETURNS_TWICE
+  #if defined (__GNUC__) || defined (__clang__)
+///
+/// Tell the code optimizer that the function will return twice.
+/// This prevents wrong optimizations which can cause bugs.
+///
+#define RETURNS_TWICE  __attribute__((returns_twice))
+  #else
+///
+/// Tell the code optimizer that the function will return twice.
+/// This prevents wrong optimizations which can cause bugs.
+///
+#define RETURNS_TWICE
+  #endif
+#endif
+
 //
 // For symbol name in assembly code, an extra "_" is sometimes necessary
 //
-- 
2.15.1

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


[edk2] [PATCH v3 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump

2017-12-27 Thread M1cha
This fixes compiler warnings when using them in functions which
should return a value but rely on LongJump to never return instead.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Zimmermann 
---
V3: fix VS compilation errors

 MdePkg/Include/Library/BaseLib.h | 1 +
 MdePkg/Library/BaseLib/BaseLibInternals.h| 1 +
 MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c | 1 +
 MdePkg/Library/BaseLib/Ia32/LongJump.c   | 1 +
 MdePkg/Library/BaseLib/LongJump.c| 1 +
 5 files changed, 5 insertions(+)

diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 10976032adaa..c6783f4624e2 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -4927,6 +4927,7 @@ SetJump (
   restored and must be non-zero.
 
 **/
+NORETURN
 VOID
 EFIAPI
 LongJump (
diff --git a/MdePkg/Library/BaseLib/BaseLibInternals.h 
b/MdePkg/Library/BaseLib/BaseLibInternals.h
index 9dca97a0dcc9..5cc83d2956e5 100644
--- a/MdePkg/Library/BaseLib/BaseLibInternals.h
+++ b/MdePkg/Library/BaseLib/BaseLibInternals.h
@@ -441,6 +441,7 @@ InternalAssertJumpBuffer (
   @param  Value The value to return when the SetJump() context is 
restored.
 
 **/
+NORETURN
 VOID
 EFIAPI
 InternalLongJump (
diff --git a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c 
b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
index e309e8b57d7a..f48d7d17c4e4 100644
--- a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
+++ b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
@@ -54,6 +54,7 @@ SetJump (
   @param  Value The value to return when the SetJump() context is 
restored.
 
 **/
+NORETURN
 VOID
 EFIAPI
 InternalLongJump (
diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.c 
b/MdePkg/Library/BaseLib/Ia32/LongJump.c
index 73973a9cceae..8fc86f9efb69 100644
--- a/MdePkg/Library/BaseLib/Ia32/LongJump.c
+++ b/MdePkg/Library/BaseLib/Ia32/LongJump.c
@@ -28,6 +28,7 @@
 
 **/
 __declspec (naked)
+NORETURN
 VOID
 EFIAPI
 InternalLongJump (
diff --git a/MdePkg/Library/BaseLib/LongJump.c 
b/MdePkg/Library/BaseLib/LongJump.c
index 062be8f2daa1..fef764d6787e 100644
--- a/MdePkg/Library/BaseLib/LongJump.c
+++ b/MdePkg/Library/BaseLib/LongJump.c
@@ -33,6 +33,7 @@
   restored and must be non-zero.
 
 **/
+NORETURN
 VOID
 EFIAPI
 LongJump (
-- 
2.15.1

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


Re: [edk2] [PATCH] MdePkg/BasePrintLib: Fix incorrect Precision position calculation

2017-12-27 Thread Kinney, Michael D
Is the commit log correct?

Is the issue that the character past the '\0' could be read?

Mike

> -Original Message-
> From: Wang, Jian J
> Sent: Tuesday, December 26, 2017 6:14 PM
> To: Wang, Jian J ; edk2-
> de...@lists.01.org
> Cc: Kinney, Michael D ; Yao,
> Jiewen ; Zeng, Star
> ; Gao, Liming 
> Subject: RE: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> incorrect Precision position calculation
> 
> Mike and Liming,
> 
> Could you take a look at this patch?
> 
> Regards,
> Jian
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of Jian J
> > Wang
> > Sent: Monday, December 25, 2017 10:09 AM
> > To: edk2-devel@lists.01.org
> > Cc: Kinney, Michael D ;
> Yao, Jiewen
> > ; Zeng, Star
> ; Gao, Liming
> > 
> > Subject: [edk2] [PATCH] MdePkg/BasePrintLib: Fix
> incorrect Precision position
> > calculation
> >
> > Due to the a potential hole in the stop condition of
> for-loop, the two
> > continuous access to ArgumentString (index, index+1)
> inside the loop
> > might cause the string ending character ('\0') to be
> read.
> >
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Jiewen Yao 
> > Cc: Star Zeng 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Jian J Wang 
> > ---
> >  MdePkg/Library/BasePrintLib/PrintLibInternal.c | 5
> -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git
> a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > index 28d946472f..297d5a05b5 100644
> > --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> > @@ -1107,7 +1107,10 @@ BasePrintLibSPrintMarker (
> >// Compute the number of characters in
> ArgumentString and store it in
> > Count
> >// ArgumentString is either null-terminated, or
> it contains Precision
> > characters
> >//
> > -  for (Count = 0; Count < Precision || ((Flags &
> PRECISION) == 0); Count++) {
> > +  for (Count = 0;
> > +ArgumentString[Count *
> BytesPerArgumentCharacter] != '\0' &&
> > +(Count < Precision || ((Flags & PRECISION)
> == 0));
> > +  Count++) {
> >  ArgumentCharacter = ((ArgumentString[Count *
> > BytesPerArgumentCharacter] & 0xff) |
> ((ArgumentString[Count *
> > BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
> >  if (ArgumentCharacter == 0) {
> >break;
> > --
> > 2.15.1.windows.2
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/4] Coding style clean-up

2017-12-27 Thread Kinney, Michael D
Yes.  Please revert.

I am not sure I understand the ECC tool update you are suggesting.
Can you provide more details?

Mike

> -Original Message-
> From: Wang, Jian J
> Sent: Tuesday, December 26, 2017 4:40 PM
> To: Kinney, Michael D ; edk2-
> de...@lists.01.org
> Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> 
> Hi Mike,
> 
> Since this patch has been checked in trunk, do you think
> it should be reverted?
> In addition, instead of using exception list for the ECC
> tool, I think it'd be better
> to update ECC tool to use keyword match to check if a
> field name is public spec
> defined one. Otherwise, if there's new structure type
> using those field names,
> the tool will still report errors.
> 
> Regards,
> Jian
> 
> > -Original Message-
> > From: Kinney, Michael D
> > Sent: Wednesday, December 27, 2017 12:48 AM
> > To: Wang, Jian J ; edk2-
> de...@lists.01.org; Kinney,
> > Michael D 
> > Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
> >
> > Jian,
> >
> > I do not think this change should be made.
> >
> > One of the exceptions for not following the
> > EDK II code style is if the field names are
> > defined in a public specification.  In this case
> > these fields are all listed in a structure in
> > the Intel 64 and IA-32 Architectures Software
> > Development Manual, Section 7.2.1, Figure 7-2
> > using upper case register names.
> >
> > Thanks,
> >
> > Mike
> >
> >
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org]
> > > On Behalf Of Jian J Wang
> > > Sent: Sunday, December 24, 2017 5:07 PM
> > > To: edk2-devel@lists.01.org
> > > Subject: [edk2] [PATCH 0/4] Coding style clean-up
> > >
> > > This patch series are meant for cleaning up code
> > > according to coding style
> > > requirements.
> > >
> > > Jian J Wang (4):
> > >   MdePkg/BaseLib.h: Coding style clean-up
> > >   MdeModulePkg/Core: Coding style clean-up
> > >   UefiCpuPkg/UefiCpuPkg.uni: Add missing string
> > > definition for new PCDs
> > >   UefiCpuPkg: Update code to use new structure field
> > > names
> > >
> > >  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c   |
> 5
> > > ++
> > >  MdePkg/Include/Library/BaseLib.h   |
> 72
> > > +++---
> > >  .../Ia32/ArchExceptionHandler.c|
> 24
> > > 
> > >  .../X64/ArchExceptionHandler.c |
> 6
> > > +-
> > >  UefiCpuPkg/Library/MpInitLib/MpLib.c   |
> 2
> > > +-
> > >  UefiCpuPkg/UefiCpuPkg.uni  |
> 16
> > > -
> > >  6 files changed, 71 insertions(+), 54 deletions(-)
> > >
> > > --
> > > 2.15.1.windows.2
> > >
> > > ___
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms 6/6] Silicon/SynQuacer/DeviceTree: update NETSEC DT node to latest binding

2017-12-27 Thread Ard Biesheuvel
The upstream version of the Linux NETSEC driver expects the PHY DT
node to appear under a MDIO subnode, so fix this in the device tree.
Fix the node name as well, this should be 'ethernet' not 'netsec'

Also, move the PHY subnode into the per-platform .dts file so we can
set the unit address in the node name. This is necessary because recent
versions of the DT compiler are more finicky about this.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts   |  7 +
 Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi | 29 
+---
 Silicon/Socionext/SynQuacer/DeviceTree/SynQuacerEvalBoard.dts |  7 +
 3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts 
b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
index d2cd7ef90e6f..77b7b1b118a6 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
@@ -44,3 +44,10 @@
   "GPIO-K", "GPIO-L", "PEC-PD26", "PEC-PD27",
   "PEC-PD28",   "PEC-PD29",   "PEC-PD30", "PEC-PD31";
 };
+
+_netsec {
+phy_netsec: ethernet-phy@7 {
+compatible = "ethernet-phy-ieee802.3-c22";
+reg = <7>;
+};
+};
diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi 
b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
index 7c3518facb98..8817ec0f150e 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
@@ -457,25 +457,22 @@
 #clock-cells = <0>;
 };
 
-eth0: netsec@522D {
-compatible = "socionext,synquacer-netsec";
-reg = <0 0x522d 0x0 0x1>,
-  <0 FixedPcdGet32 (PcdNetsecEepromBase) 0x0 0x1>;
-interrupts = ;
-clocks = <_netsec>;
-phy-mode = "rgmii";
-max-speed = <1000>;
-max-frame-size = <9000>;
-phy-handle = <>;
-dma-coherent;
+ethernet@522D {
+compatible = "socionext,synquacer-netsec";
+reg = <0 0x522d 0x0 0x1>,
+  <0 FixedPcdGet32 (PcdNetsecEepromBase) 0x0 0x1>;
+interrupts = ;
+clocks = <_netsec>;
+phy-mode = "rgmii";
+max-speed = <1000>;
+max-frame-size = <9000>;
+phy-handle = <_netsec>;
+dma-coherent;
 
+mdio_netsec: mdio {
 #address-cells = <1>;
 #size-cells = <0>;
-
-ethphy0: ethernet-phy {
-compatible = "ethernet-phy-ieee802.3-c22";
-reg = ;
-};
+};
 };
 
 smmu: iommu@582c {
diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacerEvalBoard.dts 
b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacerEvalBoard.dts
index 132fd370a71b..5873e415c246 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacerEvalBoard.dts
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacerEvalBoard.dts
@@ -34,3 +34,10 @@
  {
 status = "okay";
 };
+
+_netsec {
+phy_netsec: ethernet-phy@1 {
+compatible = "ethernet-phy-ieee802.3-c22";
+reg = <1>;
+};
+};
-- 
2.11.0

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


[edk2] [PATCH edk2-platforms 3/6] Silicon/SynQuacerI2cDxe: remove spurious format specifier

2017-12-27 Thread Ard Biesheuvel
Remove a %r without an associated parameter.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c 
b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c
index c3703dfb6c33..46c512a20151 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c
@@ -335,7 +335,7 @@ SynQuacerI2cStartRequest (
 }
 
 if (MmioRead8 (I2c->MmioBase + F_I2C_REG_BSR) & F_I2C_BSR_LRB) {
-  BOOTTIME_DEBUG ((DEBUG_WARN, "%a: No ack received - %r\n", 
__FUNCTION__));
+  BOOTTIME_DEBUG ((DEBUG_WARN, "%a: No ack received\n", __FUNCTION__));
   Status = EFI_DEVICE_ERROR;
   break;
 }
-- 
2.11.0

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


[edk2] [PATCH edk2-platforms 1/6] Silicon: fix typo in gPcf8563RealTimeClockLibI2cMasterProtocolGuid

2017-12-27 Thread Ard Biesheuvel
Do a global replace of gPcf8563RealTimeClockLibI2cMasterProtolGuid with
gPcf8563RealTimeClockLibI2cMasterProtocolGuid.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c   | 2 +-
 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec | 2 +-
 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.inf | 4 
++--
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c   | 2 +-
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c 
b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
index 67f8e7de4025..6bc4aef28849 100644
--- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
+++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
@@ -373,7 +373,7 @@ LibRtcInitialize (
   //
   BufferSize = sizeof (EFI_HANDLE);
   Status = gBS->LocateHandle (ByProtocol,
-  , NULL,
+  , NULL,
   , );
   ASSERT_EFI_ERROR (Status);
 
diff --git 
a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec 
b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec
index 3849056f164a..94c4a3f1ef4c 100644
--- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec
+++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec
@@ -22,7 +22,7 @@ [Guids]
   gPcf8563RealTimeClockLibTokenSpaceGuid = { 0xaaf5b169, 0x93a0, 0x4d60, { 
0xba, 0xe4, 0x06, 0x07, 0x92, 0x8e, 0x63, 0xdd }}
 
 [Protocols]
-  gPcf8563RealTimeClockLibI2cMasterProtolGuid = { 0xa6af18ae, 0x3bd5, 0x4af9, 
{ 0xbb, 0x6a, 0xdb, 0x85, 0x07, 0x62, 0x81, 0x38 }}
+  gPcf8563RealTimeClockLibI2cMasterProtocolGuid = { 0xa6af18ae, 0x3bd5, 
0x4af9, { 0xbb, 0x6a, 0xdb, 0x85, 0x07, 0x62, 0x81, 0x38 }}
 
 [PcdsFixedAtBuild]
   
gPcf8563RealTimeClockLibTokenSpaceGuid.PcdI2cSlaveAddress|0x51|UINT8|0x0001
diff --git 
a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.inf 
b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.inf
index 9907e343ba78..1a9a6f6c9cf3 100644
--- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.inf
+++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.inf
@@ -42,11 +42,11 @@ [Guids]
 [Protocols]
   gEfiDriverBindingProtocolGuid   ## CONSUMES
   gEfiI2cMasterProtocolGuid   ## CONSUMES
-  gPcf8563RealTimeClockLibI2cMasterProtolGuid ## CONSUMES
+  gPcf8563RealTimeClockLibI2cMasterProtocolGuid   ## CONSUMES
 
 [FixedPcd]
   gPcf8563RealTimeClockLibTokenSpaceGuid.PcdI2cSlaveAddress
   gPcf8563RealTimeClockLibTokenSpaceGuid.PcdI2cBusFrequency
 
 [Depex]
-  gPcf8563RealTimeClockLibI2cMasterProtolGuid
+  gPcf8563RealTimeClockLibI2cMasterProtocolGuid
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c 
b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
index 098a4dbd324e..91c1b66ea1f8 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
@@ -183,7 +183,7 @@ PlatformDxeEntryPoint (
   // through the I2C driver stack (which cannot be used at runtime)
   //
   Status = gBS->InstallProtocolInterface (,
-  ,
+  ,
   EFI_NATIVE_INTERFACE, NULL);
   ASSERT_EFI_ERROR (Status);
 
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf 
b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
index 7d3b88a5b52e..9778574be1bf 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
@@ -53,7 +53,7 @@ [Guids]
 [Protocols]
   gEdkiiNonDiscoverableDeviceProtocolGuid ## PRODUCES
   gEfiPciIoProtocolGuid   ## CONSUMES
-  gPcf8563RealTimeClockLibI2cMasterProtolGuid ## PRODUCES
+  gPcf8563RealTimeClockLibI2cMasterProtocolGuid   ## PRODUCES
 
 [FixedPcd]
   gSynQuacerTokenSpaceGuid.PcdNetsecEepromBase
-- 
2.11.0

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


[edk2] [PATCH edk2-platforms 5/6] Silicon/SynQuacer/DeviceTree: align uart DT nodes

2017-12-27 Thread Ard Biesheuvel
Align the UART DT nodes:
- use 'uart' not 'fuart' as node name for the second serial port
- create an alias 'serial1' for the second serial port
- use UART clock reference instead of hardcoded frequency
- split 'clocks' property into 1 cell per phandle

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi 
b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
index 37a3981f0360..7c3518facb98 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
@@ -32,6 +32,7 @@
 
 aliases {
 serial0 = _uart0;
+serial1 = 
 };
 
 chosen {
@@ -436,15 +437,16 @@
 compatible = "arm,pl011", "arm,primecell";
 reg = <0x0 0x2a40 0x0 0x1000>;
 interrupts = ;
-clocks = <_uart _apb>;
+clocks = <_uart>, <_apb>;
 clock-names = "uartclk", "apb_pclk";
 };
 
-fuart: fuart@5104 {
+fuart: uart@5104 {
 compatible = "snps,dw-apb-uart";
 reg = <0x0 0x5104 0x0 0x1000>;
 interrupts = ;
-clock-frequency = <6250>;
+clocks = <_uart>, <_apb>;
+clock-names = "baudclk", "apb_pclk";
 reg-io-width = <4>;
 reg-shift = <2>;
 };
-- 
2.11.0

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


[edk2] [PATCH edk2-platforms 0/6] I2C/DT fixes for SynQuacer

2017-12-27 Thread Ard Biesheuvel
Some stuff I have accumulated over the past couple of weeks, consisting
of
- Fixes for the I2C RTC handling; for some reason (probably due to having
  added HII screens to PlatformDxe), the dispatch order had changed, and
  the RTC no longer worked. (#1 - #4)
- The DT binding for NETSEC has changed, and so our device tree has to be
  updated accordingly. While at it, perform some other cleanups as well.

Ard Biesheuvel (6):
  Silicon: fix typo in gPcf8563RealTimeClockLibI2cMasterProtocolGuid
  Silicon/NXP/Pcf8563RealTimeClockLib: avoid driver binding protocol
  Silicon/SynQuacerI2cDxe: remove spurious format specifier
  Silicon/SynQuacer: load I2C driver before platform DXE driver
  Silicon/SynQuacer/DeviceTree: align uart DT nodes
  Silicon/SynQuacer/DeviceTree: update NETSEC DT node to latest binding

 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c   | 33 
-
 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec |  2 +-
 Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.inf |  5 
++-
 Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts |  7 

 Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi   | 37 
++--
 Silicon/Socionext/SynQuacer/DeviceTree/SynQuacerEvalBoard.dts   |  7 

 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c   |  2 +-
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf |  4 
+--
 Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c   |  2 +-
 Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf |  2 +-
 Silicon/Socionext/SynQuacer/SynQuacer.dec   |  2 ++
 11 files changed, 56 insertions(+), 47 deletions(-)

-- 
2.11.0

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


[edk2] [PATCH edk2-platforms 4/6] Silicon/SynQuacer: load I2C driver before platform DXE driver

2017-12-27 Thread Ard Biesheuvel
To ensure that the I2C master protocol is installed immediately onto
the handles created by PlatformDxe in its entry point, force the
SynQuacerI2cDxe driver to be loaded before PlatformDxe. These handles
are recursively connected by the DXE core as soon as they appear, and
so ensuring that the I2C master protocol driver is available at this
time will ensure that these handles will be connected to it right away.

This is useful when implementations of architectural protocols such as
RTC or the EFI variable store, which should become available long before
the ordinary dispatch of UEFI driver model drivers is started at the end
of DXE, are based on I2C.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf | 2 +-
 Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf | 2 +-
 Silicon/Socionext/SynQuacer/SynQuacer.dec   | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf 
b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
index 9778574be1bf..587dc111e75b 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
@@ -17,7 +17,7 @@
 [Defines]
   INF_VERSION= 0x0001001A
   BASE_NAME  = PlatformDxe
-  FILE_GUID  = ac422cc1-d916-489a-b165-536fdfc633c2
+  FILE_GUID  = ac422cc1-d916-489a-b165-536fdfc633c2 # 
gSynQuacerPlatformDxeFileGuid
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
   ENTRY_POINT= PlatformDxeEntryPoint
diff --git 
a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf 
b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf
index fa715366878c..325816ba0b88 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf
+++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf
@@ -56,4 +56,4 @@ [FixedPcd]
   gSynQuacerTokenSpaceGuid.PcdI2cReferenceClock
 
 [Depex]
-  TRUE
+  BEFORE gSynQuacerPlatformDxeFileGuid
diff --git a/Silicon/Socionext/SynQuacer/SynQuacer.dec 
b/Silicon/Socionext/SynQuacer/SynQuacer.dec
index a21f12b5bc32..76529e3c2164 100644
--- a/Silicon/Socionext/SynQuacer/SynQuacer.dec
+++ b/Silicon/Socionext/SynQuacer/SynQuacer.dec
@@ -25,6 +25,8 @@ [Guids]
   gSynQuacerNonDiscoverableI2cMasterGuid = { 0x364ee675, 0x9e44, 0x42b7, { 
0xa5, 0xe4, 0x92, 0x84, 0xdb, 0x85, 0xda, 0x09 } }
   gSynQuacerNonDiscoverableRuntimeI2cMasterGuid = { 0x5f35aa9b, 0x8c6f, 
0x4828, { 0xbd, 0x44, 0x7c, 0xc0, 0xeb, 0x2d, 0xfe, 0xb9 } }
 
+  gSynQuacerPlatformDxeFileGuid = { 0xac422cc1, 0xd916, 0x489a, { 0xb1, 0x65, 
0x53, 0x6f, 0xdf, 0xc6, 0x33, 0xc2 } }
+
 [Ppis]
   gSynQuacerDramInfoPpiGuid = { 0x3e1d7356, 0xdda4, 0x4b1a, { 0x93, 0x46, 
0xbf, 0x89, 0x1c, 0x86, 0x46, 0xcc } }
 
-- 
2.11.0

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


[edk2] [Patch 4/4] SecurityPkg: Convert source file to DOS format

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Qin Long 
---
 .../SecureBootConfigDxe/SecureBootConfigImpl.c | 26 +++---
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 4ec0f8d13a..e3066f77be 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -3145,9 +3145,9 @@ DeleteSignatureEx (
   if (DelType == Delete_Signature_List_All) {
 VariableDataSize = 0;
   } else {
-//
-//  Traverse to target EFI_SIGNATURE_LIST but others will be skipped.
-//
+//
+//  Traverse to target EFI_SIGNATURE_LIST but others will be skipped.
+//
 while ((RemainingSize > 0) && (RemainingSize >= 
ListWalker->SignatureListSize) && ListIndex < PrivateData->ListIndex) {
   CopyMem ((UINT8 *)NewVariableData + Offset, ListWalker, 
ListWalker->SignatureListSize);
   Offset += ListWalker->SignatureListSize;
@@ -3157,17 +3157,17 @@ DeleteSignatureEx (
   ListIndex++;
 }
 
-//
-//  Handle the target EFI_SIGNATURE_LIST.
-//  If CheckedCount == SIGNATURE_DATA_COUNTS (ListWalker) or DelType == 
Delete_Signature_List_One
-//  it means delete the whole EFI_SIGNATURE_LIST, So we just skip this 
EFI_SIGNATURE_LIST.
-//
-if (CheckedCount < SIGNATURE_DATA_COUNTS (ListWalker) && DelType == 
Delete_Signature_Data) {
+//
+//  Handle the target EFI_SIGNATURE_LIST.
+//  If CheckedCount == SIGNATURE_DATA_COUNTS (ListWalker) or DelType == 
Delete_Signature_List_One
+//  it means delete the whole EFI_SIGNATURE_LIST, So we just skip this 
EFI_SIGNATURE_LIST.
+//
+if (CheckedCount < SIGNATURE_DATA_COUNTS (ListWalker) && DelType == 
Delete_Signature_Data) {
   NewCertList = (EFI_SIGNATURE_LIST *)(NewVariableData + Offset);
   //
   // Copy header.
   //
-  CopyMem ((UINT8 *)NewVariableData + Offset, ListWalker, sizeof 
(EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize);
+  CopyMem ((UINT8 *)NewVariableData + Offset, ListWalker, sizeof 
(EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize);
   Offset += sizeof (EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize;
 
   DataWalker = (EFI_SIGNATURE_DATA *)((UINT8 *)ListWalker + 
sizeof(EFI_SIGNATURE_LIST) + ListWalker->SignatureHeaderSize);
@@ -3188,9 +3188,9 @@ DeleteSignatureEx (
   }
 }
 
-RemainingSize -= ListWalker->SignatureListSize;
-ListWalker = (EFI_SIGNATURE_LIST *)((UINT8 *)ListWalker + 
ListWalker->SignatureListSize);
-
+RemainingSize -= ListWalker->SignatureListSize;
+ListWalker = (EFI_SIGNATURE_LIST *)((UINT8 *)ListWalker + 
ListWalker->SignatureListSize);
+
 //
 // Copy remaining data, maybe 0.
 //
-- 
2.11.0.windows.1

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


[edk2] [Patch 3/4] SourceLevelDebugPkg: Convert source file to DOS format

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Wu Hao A 
---
 .../Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c 
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
index 9a827ef4db..9f5223a695 100644
--- 
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
+++ 
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
@@ -32,7 +32,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR  
 mVectorHandoffInf
   }
 };
 
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR 
mDebugAgentMemoryDiscoveredNotifyList[1] = {
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR 
mDebugAgentMemoryDiscoveredNotifyList[1] = {
   {
 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
 ,
@@ -554,7 +554,7 @@ InitializeDebugAgent (
 // Register for a callback once memory has been initialized.
 // If memery has been ready, the callback funtion will be invoked 
immediately
 //
-Status = PeiServicesNotifyPpi ([0]);
+Status = PeiServicesNotifyPpi ([0]);
 if (EFI_ERROR (Status)) {
   DEBUG ((EFI_D_ERROR, "DebugAgent: Failed to register memory discovered 
callback function!\n"));
   CpuDeadLoop ();
-- 
2.11.0.windows.1

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


[edk2] [Patch 1/4] IntelFspWrapperPkg: Convert INF file to dos format

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Jiewen Yao 
---
 .../Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
 
b/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
index 4d2cbd850f..865a0205d6 100644
--- 
a/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
+++ 
b/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
@@ -53,4 +53,4 @@
   HobLib
 
 [Guids]
-  gFspBootLoaderTolumHobGuid## SOMETIMES_CONSUMES ## GUID
\ No newline at end of file
+  gFspBootLoaderTolumHobGuid## SOMETIMES_CONSUMES ## GUID
-- 
2.11.0.windows.1

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


[edk2] [Patch 0/4] Update source file as DOS format

2017-12-27 Thread Liming Gao
Liming Gao (4):
  IntelFspWrapperPkg: Convert INF file to dos format
  NetworkPkg: Convert source file to DOS format
  SourceLevelDebugPkg: Convert source file to DOS format
  SecurityPkg: Convert source file to DOS format

 .../PeiFspWrapperApiTestLib.inf|  2 +-
 NetworkPkg/HttpDxe/HttpProto.c |  2 +-
 .../SecureBootConfigDxe/SecureBootConfigImpl.c | 26 +++---
 .../SecPeiDebugAgent/SecPeiDebugAgentLib.c |  4 ++--
 4 files changed, 17 insertions(+), 17 deletions(-)

-- 
2.11.0.windows.1

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


Re: [edk2] [PATCH edk2-platforms 0/3] Platform/NXP-Added NXP PCI Host Bridge Driver

2017-12-27 Thread Ard Biesheuvel
On 27 December 2017 at 13:02, Vabhav Sharma  wrote:
>
>
>>-Original Message-
>>From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>>Sent: Friday, December 22, 2017 9:04 PM
>>To: Vabhav Sharma 
>>Cc: Leif Lindholm ; Kinney, Michael D
>>; edk2-devel@lists.01.org; Udit Kumar
>>; Varun Sethi 
>>Subject: Re: [PATCH edk2-platforms 0/3] Platform/NXP-Added NXP PCI Host
>>Bridge Driver
>>
>>On 21 December 2017 at 18:48, Vabhav  wrote:
>>> Following patches will add support of NXP PCI Host Bridge Driver in edk2-
>>platforms directory 'edk2-platforms/Platform/NXP'
>>>
>>
>>Why do you need a new PciHostBridgeDxe driver? Can't you use the one in
>>MdeModulePkg instead?
> Using  PciHostbridge dxe driver with changes for multiple(three)  host bridge 
> instances with 1:1 mapping  for HostBridge:Root bridge(Hb:Rb), I will 
> evaluate MdeModulePkg for
> Multiple host bridge support

You will need to re-implement PciSegmentLib for that. Please find an
example here:

https://git.linaro.org/leg/noupstream/edk2-platforms.git/tree/Silicon/Socionext/SynQuacer/Library/SynQuacerPciSegmentLib?h=developer-box

>>
>>> Updated Directory structure for added folders in 'edk2-
>>platforms/Platform/NXP' will be:
>>>
>>> Platform/NXP/Drivers/PciHostBridgeDxe/
>>> |-- PciHostBridgeDxe.c
>>> |-- PciHostBridgeDxe.inf
>>> `-- PciRootBridgeIo.c
>>>
>>> Platform/NXP/Library/PciHostBridgeLib/
>>> |-- PciCntrl.c
>>> |-- PciHostBridgeLib.inf
>>> `-- PciRbLib.c
>>>
>>
>>Please put these in Silicon/NXP, not Platform/NXP
> Reference is taken from ARM/Hisilicon directory structure , We plan to put 
> only chassis specific code in Silicon/NXP and Drivers, Library in 
> Platform/NXP.
> Please suggest if there is any specific reason for putting them in 
> Silicon/NXP?

Yes. Platform/ contains platform specific pieces, e.g., board level
driver, device tree images, .DSC files etc. Libraries and drivers that
can be shared between different platforms using the same SoC belong in
Silicon/NXP.

>>
>>> In Platform/NXP/Library
>>> PciHostBridgeLib librady is added
>>>
>>> In Platform/NXP/Drivers:
>>> PciHostBridgeDxe driver is added
>>>
>>> Please review and look forward for your support in upstreaming the patches 
>>> in
>>edk2-platforms.
>>>
>>> Vabhav (3):
>>>   Platform/NXP : Add PCI Host Bridge Libary
>>>   Platform/NXP : Add PCI Host Bridge Driver
>>>   Compilation:Modify dsc,fdf files
>>>
>>>  .../Drivers/PciHostBridgeDxe/PciHostBridgeDxe.c|  967 
>>>  .../Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf  |   61 +
>>>  .../NXP/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 1193
>>
>>>  Platform/NXP/Include/PciCntrlLib.h |  323 ++
>>>  Platform/NXP/Include/PciHostBridge.h   |  466 
>>>  Platform/NXP/Include/PciLib.h  |  414 +++
>>>  Platform/NXP/Include/PciRootBridge.h   |  674 +++
>>>  Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc   |   31 +
>>>  Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf   |6 +
>>>  Platform/NXP/Library/PciHostBridgeLib/PciCntrl.c   |  628 +++
>>>  .../Library/PciHostBridgeLib/PciHostBridgeLib.inf  |   49 +
>>>  Platform/NXP/Library/PciHostBridgeLib/PciRbLib.c   |  331 ++
>>>  Silicon/NXP/Chassis/Chassis.c  |   11 +
>>>  Silicon/NXP/Chassis/Chassis2/SerDes.h  |   11 +
>>>  Silicon/NXP/LS1043A/LS1043A.dsc|1 +
>>>  15 files changed, 5166 insertions(+)
>>>  create mode 100644
>>> Platform/NXP/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.c
>>>  create mode 100644
>>> Platform/NXP/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>>  create mode 100644
>>> Platform/NXP/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
>>>  create mode 100644 Platform/NXP/Include/PciCntrlLib.h
>>>  create mode 100644 Platform/NXP/Include/PciHostBridge.h
>>>  create mode 100644 Platform/NXP/Include/PciLib.h  create mode 100644
>>> Platform/NXP/Include/PciRootBridge.h
>>>  create mode 100644 Platform/NXP/Library/PciHostBridgeLib/PciCntrl.c
>>>  create mode 100644
>>> Platform/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf
>>>  create mode 100644 Platform/NXP/Library/PciHostBridgeLib/PciRbLib.c
>>>
>>> --
>>> 1.9.1
>>>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms 0/3] Platform/NXP-Added NXP PCI Host Bridge Driver

2017-12-27 Thread Vabhav Sharma


>-Original Message-
>From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>Sent: Friday, December 22, 2017 9:04 PM
>To: Vabhav Sharma 
>Cc: Leif Lindholm ; Kinney, Michael D
>; edk2-devel@lists.01.org; Udit Kumar
>; Varun Sethi 
>Subject: Re: [PATCH edk2-platforms 0/3] Platform/NXP-Added NXP PCI Host
>Bridge Driver
>
>On 21 December 2017 at 18:48, Vabhav  wrote:
>> Following patches will add support of NXP PCI Host Bridge Driver in edk2-
>platforms directory 'edk2-platforms/Platform/NXP'
>>
>
>Why do you need a new PciHostBridgeDxe driver? Can't you use the one in
>MdeModulePkg instead?
Using  PciHostbridge dxe driver with changes for multiple(three)  host bridge 
instances with 1:1 mapping  for HostBridge:Root bridge(Hb:Rb), I will evaluate 
MdeModulePkg for
Multiple host bridge support
>
>> Updated Directory structure for added folders in 'edk2-
>platforms/Platform/NXP' will be:
>>
>> Platform/NXP/Drivers/PciHostBridgeDxe/
>> |-- PciHostBridgeDxe.c
>> |-- PciHostBridgeDxe.inf
>> `-- PciRootBridgeIo.c
>>
>> Platform/NXP/Library/PciHostBridgeLib/
>> |-- PciCntrl.c
>> |-- PciHostBridgeLib.inf
>> `-- PciRbLib.c
>>
>
>Please put these in Silicon/NXP, not Platform/NXP
Reference is taken from ARM/Hisilicon directory structure , We plan to put only 
chassis specific code in Silicon/NXP and Drivers, Library in Platform/NXP.
Please suggest if there is any specific reason for putting them in Silicon/NXP?
>
>> In Platform/NXP/Library
>> PciHostBridgeLib librady is added
>>
>> In Platform/NXP/Drivers:
>> PciHostBridgeDxe driver is added
>>
>> Please review and look forward for your support in upstreaming the patches in
>edk2-platforms.
>>
>> Vabhav (3):
>>   Platform/NXP : Add PCI Host Bridge Libary
>>   Platform/NXP : Add PCI Host Bridge Driver
>>   Compilation:Modify dsc,fdf files
>>
>>  .../Drivers/PciHostBridgeDxe/PciHostBridgeDxe.c|  967 
>>  .../Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf  |   61 +
>>  .../NXP/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 1193
>
>>  Platform/NXP/Include/PciCntrlLib.h |  323 ++
>>  Platform/NXP/Include/PciHostBridge.h   |  466 
>>  Platform/NXP/Include/PciLib.h  |  414 +++
>>  Platform/NXP/Include/PciRootBridge.h   |  674 +++
>>  Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc   |   31 +
>>  Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf   |6 +
>>  Platform/NXP/Library/PciHostBridgeLib/PciCntrl.c   |  628 +++
>>  .../Library/PciHostBridgeLib/PciHostBridgeLib.inf  |   49 +
>>  Platform/NXP/Library/PciHostBridgeLib/PciRbLib.c   |  331 ++
>>  Silicon/NXP/Chassis/Chassis.c  |   11 +
>>  Silicon/NXP/Chassis/Chassis2/SerDes.h  |   11 +
>>  Silicon/NXP/LS1043A/LS1043A.dsc|1 +
>>  15 files changed, 5166 insertions(+)
>>  create mode 100644
>> Platform/NXP/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.c
>>  create mode 100644
>> Platform/NXP/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>  create mode 100644
>> Platform/NXP/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
>>  create mode 100644 Platform/NXP/Include/PciCntrlLib.h
>>  create mode 100644 Platform/NXP/Include/PciHostBridge.h
>>  create mode 100644 Platform/NXP/Include/PciLib.h  create mode 100644
>> Platform/NXP/Include/PciRootBridge.h
>>  create mode 100644 Platform/NXP/Library/PciHostBridgeLib/PciCntrl.c
>>  create mode 100644
>> Platform/NXP/Library/PciHostBridgeLib/PciHostBridgeLib.inf
>>  create mode 100644 Platform/NXP/Library/PciHostBridgeLib/PciRbLib.c
>>
>> --
>> 1.9.1
>>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] UefiCpuPkg CpuExceptionHandlerLib: Enhance DumpModuleImageInfo()

2017-12-27 Thread Yao, Jiewen
reviewed by jiewen@intel.com

thank you!
Yao, Jiewen


> 在 2017年12月27日,下午7:07,Zeng, Star  写道:
> 
> Enhance DumpModuleImageInfo() for page fault with I/D set.
> 
> If it is page fault with I/D set, the (E/R)IP in SystemContext
> could not be used for DumpModuleImageInfo(), instead of, the next
> IP of the IP triggering this page fault could be found from stack
> by (E/R)SP in SystemContext.
> 
> IA32 SDM:
> ― I/D flag (bit 4).
> This flag is 1 if the access causing the page-fault exception was
> an instruction fetch. This flag describes the access causing the
> page-fault exception, not the access rights specified by paging.
> 
> The idea comes from SmiPFHandler () in
> UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c and
> UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c.
> 
> Cc: Jiewen Yao 
> Cc: Eric Dong 
> Cc: Laszlo Ersek 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
> .../Library/CpuExceptionHandlerLib/CpuExceptionCommon.c   |  4 ++--
> .../CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c| 11 ++-
> .../Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c | 11 ++-
> 3 files changed, 22 insertions(+), 4 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c 
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
> index dbfaae1d3038..01b06103647b 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
> @@ -1,7 +1,7 @@
> /** @file
>   CPU Exception Handler Library common functions.
> 
> -  Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.
>   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
> @@ -131,7 +131,7 @@ DumpModuleImageInfo (
> if (EFI_ERROR (Status)) {
>   EntryPoint = NULL;
> }
> -InternalPrintMessage (" Find image ");
> +InternalPrintMessage (" Find image based on IP(0x%x) ", CurrentEip);
> PdbPointer = PeCoffLoaderGetPdbPointer ((VOID *) Pe32Data);
> if (PdbPointer != NULL) {
>   InternalPrintMessage ("%a", PdbPointer);
> diff --git 
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c 
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
> index 6ac8549839ce..04f2ab593c3e 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
> @@ -414,5 +414,14 @@ DumpImageAndCpuContent (
>   //
>   // Dump module image base and module entry point by EIP
>   //
> -  DumpModuleImageInfo (SystemContext.SystemContextIa32->Eip);
> +  if ((ExceptionType == EXCEPT_IA32_PAGE_FAULT) &&
> +  ((SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_ID) != 
> 0)) {
> +//
> +// The EIP in SystemContext could not be used
> +// if it is page fault with I/D set.
> +//
> +DumpModuleImageInfo ((*(UINTN 
> *)(UINTN)SystemContext.SystemContextIa32->Esp));
> +  } else {
> +DumpModuleImageInfo (SystemContext.SystemContextIa32->Eip);
> +  }
> }
> diff --git 
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c 
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> index 1dcf4277dea9..56180f4c17e4 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> @@ -414,5 +414,14 @@ DumpImageAndCpuContent (
>   //
>   // Dump module image base and module entry point by RIP
>   //
> -  DumpModuleImageInfo (SystemContext.SystemContextX64->Rip);
> +  if ((ExceptionType == EXCEPT_IA32_PAGE_FAULT) &&
> +  ((SystemContext.SystemContextX64->ExceptionData & IA32_PF_EC_ID) != 
> 0)) {
> +//
> +// The RIP in SystemContext could not be used
> +// if it is page fault with I/D set.
> +//
> +DumpModuleImageInfo ((*(UINTN 
> *)(UINTN)SystemContext.SystemContextX64->Rsp));
> +  } else {
> +DumpModuleImageInfo (SystemContext.SystemContextX64->Rip);
> +  }
> }
> -- 
> 2.7.0.windows.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] UefiCpuPkg CpuExceptionHandlerLib: Enhance DumpModuleImageInfo()

2017-12-27 Thread Star Zeng
Enhance DumpModuleImageInfo() for page fault with I/D set.

If it is page fault with I/D set, the (E/R)IP in SystemContext
could not be used for DumpModuleImageInfo(), instead of, the next
IP of the IP triggering this page fault could be found from stack
by (E/R)SP in SystemContext.

IA32 SDM:
— I/D flag (bit 4).
This flag is 1 if the access causing the page-fault exception was
an instruction fetch. This flag describes the access causing the
page-fault exception, not the access rights specified by paging.

The idea comes from SmiPFHandler () in
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c and
UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c.

Cc: Jiewen Yao 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 .../Library/CpuExceptionHandlerLib/CpuExceptionCommon.c   |  4 ++--
 .../CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c| 11 ++-
 .../Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c | 11 ++-
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
index dbfaae1d3038..01b06103647b 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
@@ -1,7 +1,7 @@
 /** @file
   CPU Exception Handler Library common functions.
 
-  Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.
   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
@@ -131,7 +131,7 @@ DumpModuleImageInfo (
 if (EFI_ERROR (Status)) {
   EntryPoint = NULL;
 }
-InternalPrintMessage (" Find image ");
+InternalPrintMessage (" Find image based on IP(0x%x) ", CurrentEip);
 PdbPointer = PeCoffLoaderGetPdbPointer ((VOID *) Pe32Data);
 if (PdbPointer != NULL) {
   InternalPrintMessage ("%a", PdbPointer);
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
index 6ac8549839ce..04f2ab593c3e 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
@@ -414,5 +414,14 @@ DumpImageAndCpuContent (
   //
   // Dump module image base and module entry point by EIP
   //
-  DumpModuleImageInfo (SystemContext.SystemContextIa32->Eip);
+  if ((ExceptionType == EXCEPT_IA32_PAGE_FAULT) &&
+  ((SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_ID) != 0)) 
{
+//
+// The EIP in SystemContext could not be used
+// if it is page fault with I/D set.
+//
+DumpModuleImageInfo ((*(UINTN 
*)(UINTN)SystemContext.SystemContextIa32->Esp));
+  } else {
+DumpModuleImageInfo (SystemContext.SystemContextIa32->Eip);
+  }
 }
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
index 1dcf4277dea9..56180f4c17e4 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
@@ -414,5 +414,14 @@ DumpImageAndCpuContent (
   //
   // Dump module image base and module entry point by RIP
   //
-  DumpModuleImageInfo (SystemContext.SystemContextX64->Rip);
+  if ((ExceptionType == EXCEPT_IA32_PAGE_FAULT) &&
+  ((SystemContext.SystemContextX64->ExceptionData & IA32_PF_EC_ID) != 0)) {
+//
+// The RIP in SystemContext could not be used
+// if it is page fault with I/D set.
+//
+DumpModuleImageInfo ((*(UINTN 
*)(UINTN)SystemContext.SystemContextX64->Rsp));
+  } else {
+DumpModuleImageInfo (SystemContext.SystemContextX64->Rip);
+  }
 }
-- 
2.7.0.windows.1

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


Re: [edk2] [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote format warning

2017-12-27 Thread Ard Biesheuvel
On 27 December 2017 at 09:59, Long, Qin  wrote:
> This makes sense to me.
> Reviewed-by: Long Qin 
>

Thanks. Pushed as c24d664dca26

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Wednesday, December 27, 2017 5:27 PM
> To: edk2-devel@lists.01.org; Long, Qin ; Ye, Ting 
> 
> Cc: Ard Biesheuvel 
> Subject: [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote 
> format warning
>
> We recently added -Wno-error=format to the OpenSslLib build script to work 
> around an issue in the upstream OpenSSL code. This does not inhibit the 
> warning, but prevents it from breaking the build by not treating it as a 
> fatal error.
>
> Unfortunately, this interacts poorly with the -Wno-unused-const-variable 
> option that we added to GCC49 and later. Those versions of GCC ignore 
> -Wno- options that they don't understand, unless warnings are emitted for 
> another reason, in which case the warning is emitted after all, and in our 
> case, this breaks the build when the non-fatal format warning is emitted.
>
> CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: In function 
> 'uint64_print':
> CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:105:32: warning: 
> format '%ld' expects argument of type 'long int', but argument 3 has type 
> 'int64_t {aka long long int}' [-Wformat=]
>  return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
> ^
> CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:106:28: warning: 
> format '%lu' expects argument of type 'long unsigned int', but argument 3 has 
> type 'uint64_t {aka long long unsigned int}' [-Wformat=]
>  return BIO_printf(out, "%"BIO_PRI64"u\n", **(uint64_t **)pval);
> ^
> CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: At top level:
> cc1: error: unrecognized command line option '-Wno-unused-const-variable' 
> [-Werror]
> cc1: all warnings being treated as errors
>
> So replace -Wno-error=format with -Wno-format to suppress the warning 
> entirely.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 6 +++---
>  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> index 602953eefff7..f3eb19afd34e 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> @@ -557,10 +557,10 @@ [BuildOptions]
>#   types appropriate to the format string specified.
>#
>GCC:*_*_IA32_CC_FLAGS= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized
> -  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
> -  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-error=format
> +  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS
> +  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-format
>GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
> -  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
> +  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format
>
># suppress the following warnings in openssl so we don't break the build 
> with warnings-as-errors:
># 1295: Deprecated declaration  - give arg types diff --git 
> a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> index f697243f9787..88134b5b5ff3 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> @@ -518,10 +518,10 @@ [BuildOptions]
>#   types appropriate to the format string specified.
>#
>GCC:*_*_IA32_CC_FLAGS= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized
> -  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
> -  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-error=format
> +  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS
> +  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
> -Wno-error=maybe-uninitialized -Wno-format
>GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
> -  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
> +  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) 

Re: [edk2] [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote format warning

2017-12-27 Thread Long, Qin
This makes sense to me. 
Reviewed-by: Long Qin 


Best Regards & Thanks,
LONG, Qin

-Original Message-
From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
Sent: Wednesday, December 27, 2017 5:27 PM
To: edk2-devel@lists.01.org; Long, Qin ; Ye, Ting 

Cc: Ard Biesheuvel 
Subject: [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote 
format warning

We recently added -Wno-error=format to the OpenSslLib build script to work 
around an issue in the upstream OpenSSL code. This does not inhibit the 
warning, but prevents it from breaking the build by not treating it as a fatal 
error.

Unfortunately, this interacts poorly with the -Wno-unused-const-variable option 
that we added to GCC49 and later. Those versions of GCC ignore -Wno- 
options that they don't understand, unless warnings are emitted for another 
reason, in which case the warning is emitted after all, and in our case, this 
breaks the build when the non-fatal format warning is emitted.

CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: In function 
'uint64_print':
CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:105:32: warning: 
format '%ld' expects argument of type 'long int', but argument 3 has type 
'int64_t {aka long long int}' [-Wformat=]
 return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
^
CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:106:28: warning: 
format '%lu' expects argument of type 'long unsigned int', but argument 3 has 
type 'uint64_t {aka long long unsigned int}' [-Wformat=]
 return BIO_printf(out, "%"BIO_PRI64"u\n", **(uint64_t **)pval);
^
CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: At top level:
cc1: error: unrecognized command line option '-Wno-unused-const-variable' 
[-Werror]
cc1: all warnings being treated as errors

So replace -Wno-error=format with -Wno-format to suppress the warning entirely.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 6 +++---
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 602953eefff7..f3eb19afd34e 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -557,10 +557,10 @@ [BuildOptions]
   #   types appropriate to the format string specified.
   #
   GCC:*_*_IA32_CC_FLAGS= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized
-  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
-  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
+  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS
+  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types diff --git 
a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index f697243f9787..88134b5b5ff3 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -518,10 +518,10 @@ [BuildOptions]
   #   types appropriate to the format string specified.
   #
   GCC:*_*_IA32_CC_FLAGS= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized
-  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
-  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
+  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS
+  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
--
2.11.0

___
edk2-devel mailing list

Re: [edk2] [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList

2017-12-27 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>BobCF
>Sent: Wednesday, December 27, 2017 2:04 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [edk2] [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList
>
>'COMMON' is an alias of 'DEFAULT' for internal code,
>it should be removed before generating Pcd DataBase.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index e4f3586654..929c317957 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1706,12 +1706,11 @@ class DscBuildData(PlatformBuildClassObject):
> else:
> return False
> def CompletePcdValues(self,PcdSet):
> Pcds = {}
> DefaultStoreObj = DefaultStore(self._GetDefaultStores())
>-SkuIds = set([(skuid,skuobj.SkuId) for pcdobj in PcdSet.values() for
>skuid,skuobj in pcdobj.SkuInfoList.items()])
>-SkuIds = self.SkuIdMgr.AvailableSkuIdSet
>+SkuIds = {skuname:skuid for skuname,skuid in
>self.SkuIdMgr.AvailableSkuIdSet.items() if skuname !='COMMON'}
> DefaultStores = set([storename for pcdobj in PcdSet.values() for 
> skuobj
>in pcdobj.SkuInfoList.values() for storename in
>skuobj.DefaultStoreDict.keys()])
> for PcdCName, TokenSpaceGuid in PcdSet:
> PcdObj = PcdSet[(PcdCName, TokenSpaceGuid)]
> if PcdObj.Type not in
>[self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_DEFAULT],
> self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
>--
>2.14.3.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/4] Coding style clean-up

2017-12-27 Thread Gao, Liming
Jian:
  I prefer to roll back this change. So, the definition in BaseLib.h can be 
kept in the same style. 

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Wang, Jian J
>Sent: Wednesday, December 27, 2017 8:40 AM
>To: Kinney, Michael D ; edk2-
>de...@lists.01.org
>Subject: Re: [edk2] [PATCH 0/4] Coding style clean-up
>
>Hi Mike,
>
>Since this patch has been checked in trunk, do you think it should be reverted?
>In addition, instead of using exception list for the ECC tool, I think it'd be
>better
>to update ECC tool to use keyword match to check if a field name is public
>spec
>defined one. Otherwise, if there's new structure type using those field names,
>the tool will still report errors.
>
>Regards,
>Jian
>
>> -Original Message-
>> From: Kinney, Michael D
>> Sent: Wednesday, December 27, 2017 12:48 AM
>> To: Wang, Jian J ; edk2-devel@lists.01.org; Kinney,
>> Michael D 
>> Subject: RE: [edk2] [PATCH 0/4] Coding style clean-up
>>
>> Jian,
>>
>> I do not think this change should be made.
>>
>> One of the exceptions for not following the
>> EDK II code style is if the field names are
>> defined in a public specification.  In this case
>> these fields are all listed in a structure in
>> the Intel 64 and IA-32 Architectures Software
>> Development Manual, Section 7.2.1, Figure 7-2
>> using upper case register names.
>>
>> Thanks,
>>
>> Mike
>>
>>
>>
>> > -Original Message-
>> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org]
>> > On Behalf Of Jian J Wang
>> > Sent: Sunday, December 24, 2017 5:07 PM
>> > To: edk2-devel@lists.01.org
>> > Subject: [edk2] [PATCH 0/4] Coding style clean-up
>> >
>> > This patch series are meant for cleaning up code
>> > according to coding style
>> > requirements.
>> >
>> > Jian J Wang (4):
>> >   MdePkg/BaseLib.h: Coding style clean-up
>> >   MdeModulePkg/Core: Coding style clean-up
>> >   UefiCpuPkg/UefiCpuPkg.uni: Add missing string
>> > definition for new PCDs
>> >   UefiCpuPkg: Update code to use new structure field
>> > names
>> >
>> >  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c   |  5
>> > ++
>> >  MdePkg/Include/Library/BaseLib.h   | 72
>> > +++---
>> >  .../Ia32/ArchExceptionHandler.c| 24
>> > 
>> >  .../X64/ArchExceptionHandler.c |  6
>> > +-
>> >  UefiCpuPkg/Library/MpInitLib/MpLib.c   |  2
>> > +-
>> >  UefiCpuPkg/UefiCpuPkg.uni  | 16
>> > -
>> >  6 files changed, 71 insertions(+), 54 deletions(-)
>> >
>> > --
>> > 2.15.1.windows.2
>> >
>> > ___
>> > edk2-devel mailing list
>> > edk2-devel@lists.01.org
>> > https://lists.01.org/mailman/listinfo/edk2-devel
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] CryptoPkg/OpensslLib AARCH64: disable rather than demote format warning

2017-12-27 Thread Ard Biesheuvel
We recently added -Wno-error=format to the OpenSslLib build script to
work around an issue in the upstream OpenSSL code. This does not inhibit
the warning, but prevents it from breaking the build by not treating it
as a fatal error.

Unfortunately, this interacts poorly with the -Wno-unused-const-variable
option that we added to GCC49 and later. Those versions of GCC ignore
-Wno- options that they don't understand, unless warnings are emitted
for another reason, in which case the warning is emitted after all, and
in our case, this breaks the build when the non-fatal format warning is
emitted.

CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: In function 
'uint64_print':
CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:105:32: warning: 
format '%ld' expects argument of type 'long int', but argument 3 has type 
'int64_t {aka long long int}' [-Wformat=]
 return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
^
CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c:106:28: warning: 
format '%lu' expects argument of type 'long unsigned int', but argument 3 has 
type 'uint64_t {aka long long unsigned int}' [-Wformat=]
 return BIO_printf(out, "%"BIO_PRI64"u\n", **(uint64_t **)pval);
^
CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/x_int64.c: At top level:
cc1: error: unrecognized command line option '-Wno-unused-const-variable' 
[-Werror]
cc1: all warnings being treated as errors

So replace -Wno-error=format with -Wno-format to suppress the warning
entirely.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 6 +++---
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 602953eefff7..f3eb19afd34e 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -557,10 +557,10 @@ [BuildOptions]
   #   types appropriate to the format string specified.
   #
   GCC:*_*_IA32_CC_FLAGS= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized
-  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
-  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
+  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS
+  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index f697243f9787..88134b5b5ff3 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -518,10 +518,10 @@ [BuildOptions]
   #   types appropriate to the format string specified.
   #
   GCC:*_*_IA32_CC_FLAGS= -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized
-  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
-  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
+  GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format -DNO_MSABI_VA_FUNCS
+  GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
-- 
2.11.0

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


Re: [edk2] [Patch] MdePkg: Update PI spec version to 1.6 in MdePkg.dec

2017-12-27 Thread Zeng, Star
Reviewed-by: Star Zeng 

Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
Gao
Sent: Wednesday, December 27, 2017 5:12 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch] MdePkg: Update PI spec version to 1.6 in MdePkg.dec

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
---
 MdePkg/MdePkg.dec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 603e498..3c61a8f 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2,7 +2,7 @@
 # This Package provides all definitions, library classes and libraries 
instances.
 #
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
-# EFI1.10/UEFI2.7/PI1.4 and some Industry Standards.
+# EFI1.10/UEFI2.7/PI1.6 and some Industry Standards.
 #
 # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-- 
2.8.0.windows.1

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


[edk2] [Patch] MdePkg: Update PI spec version to 1.6 in MdePkg.dec

2017-12-27 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
---
 MdePkg/MdePkg.dec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 603e498..3c61a8f 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2,7 +2,7 @@
 # This Package provides all definitions, library classes and libraries 
instances.
 #
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
-# EFI1.10/UEFI2.7/PI1.4 and some Industry Standards.
+# EFI1.10/UEFI2.7/PI1.6 and some Industry Standards.
 #
 # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-- 
2.8.0.windows.1

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


Re: [edk2] [PATCH] CryptoPkg/OpensslLib AARCH64: suppress format string warning

2017-12-27 Thread Long, Qin
Thanks, Ard.
Reviewed-by: Long Qin 


Best Regards & Thanks,
LONG, Qin

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
Biesheuvel
Sent: Wednesday, December 27, 2017 4:05 PM
To: edk2-devel@lists.01.org; Long, Qin ; Ye, Ting 

Cc: Ard Biesheuvel 
Subject: [edk2] [PATCH] CryptoPkg/OpensslLib AARCH64: suppress format string 
warning

On GCC Build: openssl-1.1.0g introduced one additional build warning:
 ...\openssl\crypto\asn1\x_int64.c:105:32: error: format '%ld' expects
 argument of type 'long int', but argument 3 has type 'int64_t
 {aka long long int}' [-Werror=format=]  return BIO_printf(out, 
"%"BIO_PRI64"d\n", **(int64_t **)pval);
 ^
Add "-Wno-error=format" to GCC build flags to suppress this warning, since we 
have no real printf usage in BaseCryptLib, and BIO_printf() was already wrapped 
as a dummy implementation in CryptoPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 2 +-
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 5302ad7fb5ef..602953eefff7 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -560,7 +560,7 @@ [BuildOptions]
   GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
   GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS)
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types diff --git 
a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 0c7f9e9e66f4..f697243f9787 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -521,7 +521,7 @@ [BuildOptions]
   GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
   GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS)
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
--
2.11.0

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


Re: [edk2] [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release version.

2017-12-27 Thread Wu, Jiaxin
After talked with Siyuan, we agree to use the int 0-1 value instead of Boolean 
type so as to keep the same coding style in TcpInput.c.

Thanks,
Jiaxin 

> -Original Message-
> From: Fu, Siyuan
> Sent: Wednesday, December 27, 2017 11:03 AM
> To: Wu, Jiaxin ; edk2-devel@lists.01.org
> Cc: Ye, Ting ; Wang, Fan 
> Subject: RE: [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release
> version.
> 
> Hi, Jiaxin
> 
> I think it's better to return a Boolean type than int 0-1 value in
> TcpTrimSegment().
> Other part of good to me.
> 
> 
> Reviewed-by: Fu Siyuan 
> 
> 
> 
> > -Original Message-
> > From: Wu, Jiaxin
> > Sent: Tuesday, December 26, 2017 2:50 PM
> > To: edk2-devel@lists.01.org
> > Cc: Ye, Ting ; Fu, Siyuan ; Wang,
> > Fan ; Wu, Jiaxin 
> > Subject: [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release
> > version.
> >
> > TCP payload check is implemented by TcpVerifySegment(), but all the
> > function
> > calls of TcpVerifySegment() are placed in ASSERT(), which is only valid
> > for
> > debug version:
> >   ASSERT (TcpVerifySegment (Nbuf) != 0);
> >
> > This patch is to enable the check for release version.
> >
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Cc: Wang Fan 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Wu Jiaxin 
> > ---
> >  NetworkPkg/TcpDxe/TcpInput.c  | 125
> +
> > -
> >  NetworkPkg/TcpDxe/TcpOutput.c |  29 +++---
> >  2 files changed, 122 insertions(+), 32 deletions(-)
> >
> > diff --git a/NetworkPkg/TcpDxe/TcpInput.c
> b/NetworkPkg/TcpDxe/TcpInput.c
> > index f8845dc..92a0ab8 100644
> > --- a/NetworkPkg/TcpDxe/TcpInput.c
> > +++ b/NetworkPkg/TcpDxe/TcpInput.c
> > @@ -279,12 +279,15 @@ TcpComputeRtt (
> >
> >@param[in]  Nbuf The buffer that contains a received TCP segment
> > without an IP header.
> >@param[in]  Left The sequence number of the window's left edge.
> >@param[in]  RightThe sequence number of the window's right edge.
> >
> > +  @retval 0The segment is broken.
> > +  @retval 1The segment is in good shape.
> > +
> >  **/
> > -VOID
> > +INTN
> >  TcpTrimSegment (
> >IN NET_BUF   *Nbuf,
> >IN TCP_SEQNO Left,
> >IN TCP_SEQNO Right
> >)
> > @@ -304,11 +307,11 @@ TcpTrimSegment (
> >  TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_SYN);
> >  TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_FIN);
> >
> >  Seg->Seq = Seg->End;
> >  NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_HEAD);
> > -return;
> > +return 1;
> >}
> >
> >//
> >// Adjust the buffer header
> >//
> > @@ -357,27 +360,30 @@ TcpTrimSegment (
> >  if (Drop != 0) {
> >NetbufTrim (Nbuf, Drop, NET_BUF_TAIL);
> >  }
> >}
> >
> > -  ASSERT (TcpVerifySegment (Nbuf) != 0);
> > +  return TcpVerifySegment (Nbuf);
> >  }
> >
> >  /**
> >Trim off the data outside the tcb's receive window.
> >
> >@param[in]  Tcb  Pointer to the TCP_CB of this TCP instance.
> >@param[in]  Nbuf Pointer to the NET_BUF containing the received tcp
> > segment.
> >
> > +  @retval 0The segment is broken.
> > +  @retval 1The segment is in good shape.
> > +
> >  **/
> > -VOID
> > +INTN
> >  TcpTrimInWnd (
> >IN TCP_CB  *Tcb,
> >IN NET_BUF *Nbuf
> >)
> >  {
> > -  TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
> > +  return TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb-
> >RcvWnd);
> >  }
> >
> >  /**
> >Process the data and FIN flag, and check whether to deliver
> >data to the socket layer.
> > @@ -419,11 +425,20 @@ TcpDeliverData (
> >
> >while (Entry != >RcvQue) {
> >  Nbuf  = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
> >  Seg   = TCPSEG_NETBUF (Nbuf);
> >
> > -ASSERT (TcpVerifySegment (Nbuf) != 0);
> > +if (TcpVerifySegment (Nbuf) == 0) {
> > +  DEBUG (
> > +(EFI_D_ERROR,
> > +"TcpToSendData: discard a broken segment for TCB %p\n",
> > +Tcb)
> > +);
> > +  NetbufFree (Nbuf);
> > +  return -1;
> > +}
> > +
> >  ASSERT (Nbuf->Tcp == NULL);
> >
> >  if (TCP_SEQ_GT (Seg->Seq, Seq)) {
> >break;
> >  }
> > @@ -559,12 +574,15 @@ TcpDeliverData (
> >Store the data into the reassemble queue.
> >
> >@param[in, out]  Tcb   Pointer to the TCP_CB of this TCP instance.
> >@param[in]   Nbuf  Pointer to the buffer containing the data to be
> > queued.
> >
> > +  @retval  0 An error condition occurred.
> > +  @retval  1 No error occurred to queue data.
> > +
> >  **/
> > -VOID
> > +INTN
> >  TcpQueueData (
> >IN OUT TCP_CB  *Tcb,
> >IN NET_BUF *Nbuf
> >)
> >  {
> > @@ -586,11 +604,11 @@ TcpQueueData (
> >// 

Re: [edk2] [PATCH] UefiCpuPkg: Fix comment typo for MtrrLibApplyFixedMtrrs function

2017-12-27 Thread Dong, Eric
Reviewed-by: Eric Dong 

-Original Message-
From: Song, BinX 
Sent: Wednesday, December 27, 2017 3:54 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric ; ler...@redhat.com
Subject: [PATCH] UefiCpuPkg: Fix comment typo for MtrrLibApplyFixedMtrrs 
function

Fix comment typo for MtrrLibApplyFixedMtrrs function

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c 
b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index 619b500..f37b740 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -1683,7 +1683,7 @@ MtrrLibCalculateMtrrs (
 
 
 /**
-  Apply the variable MTRR settings to memory range array.
+  Apply the fixed MTRR settings to memory range array.
 
   @param Fixed The fixed MTRR settings.
   @param RangesReturn the memory range array holding memory type
-- 
2.10.2.windows.1

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


[edk2] [PATCH] CryptoPkg/OpensslLib AARCH64: suppress format string warning

2017-12-27 Thread Ard Biesheuvel
On GCC Build: openssl-1.1.0g introduced one additional build warning:
 ...\openssl\crypto\asn1\x_int64.c:105:32: error: format '%ld' expects
 argument of type 'long int', but argument 3 has type 'int64_t
 {aka long long int}' [-Werror=format=]
 return BIO_printf(out, "%"BIO_PRI64"d\n", **(int64_t **)pval);
 ^
Add "-Wno-error=format" to GCC build flags to suppress this warning,
since we have no real printf usage in BaseCryptLib, and BIO_printf()
was already wrapped as a dummy implementation in CryptoPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   | 2 +-
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 5302ad7fb5ef..602953eefff7 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -560,7 +560,7 @@ [BuildOptions]
   GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
   GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS)
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 0c7f9e9e66f4..f697243f9787 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -521,7 +521,7 @@ [BuildOptions]
   GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format -DNO_MSABI_VA_FUNCS
   GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-error=format
   GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS)
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS)
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
-- 
2.11.0

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