Re: [edk2] Patch to fix EFIAPI definition

2018-02-08 Thread Andrew Fish


> On Feb 8, 2018, at 11:12 PM, Ruslan Nikolaev  wrote:
> 
> Well, what I was implying is that if MdePkg (Ia32) headers are included in 
> some UEFI program which itself is compiled with some custom register-based 
> calling convention, current EFIAPI definition is insufficient.
> Current definition with cdecl attribute merely forces caller stack clean-up 
> in gcc/clang for Ia32
> So, if I build with '-mrtd' option (a callee cleans up the stack) current 
> EFIAPI definition will take care of it. However, if in addition to that I 
> specify -mregparm=1,2,3 to pass some parameters in registers, cdecl will not 
> take care of it.
> EFIAPI for Ia32 wants all parameters in the stack. Therefore, it should be 
> reasonable to specify regparm(0) as part of EFIAPI definition as well, so 
> that regardless of mregparm parameter the compiler will generate correct 
> code. 
> 

Ruslan,

Thanks for the info. I guess I still have the question of if you are making 
firmware why not solve this problem with compiler flags in the 1st place. 

Thanks,

Andrew Fish

> 
>On Friday, February 9, 2018 1:59 AM, Andrew Fish  wrote:
> 
> 
> 
> 
> On Feb 8, 2018, at 5:32 PM, Ruslan Nikolaev  wrote:
> I submitted a bug report and a patch: 
> https://bugzilla.tianocore.org/show_bug.cgi?id=870
> It is very straight-forward. Can someone review it, and, hopefully, commit 
> the change?
> 
> 
> Ruslan,
> Was there an example of how to code this? Sorry if I missed it, I'm getting a 
> lot of email these days.
> Also what is you usage model? Clang is very cross compiler friendly and you 
> can specify a triple to support the ABI you need. To get EFI supported on 
> macOS tools we ended up open sourcing a triple to support the EFIAPI. If you 
> look in 
> https://github.com/tianocore/edk2/blob/master/BaseTools/Conf/tools_def.template
>  you will see that you can use Xcode to build EFIAPI if you pass -target 
> x86_64-pc-win32-macho. 
> I guess I'm asking the question if you really need to support multiple ABIs 
> with clang? The best way to solve this in clang is to make it support EFIAPI. 
> If you don't need multiple ABIs take a look at what we did with -target 
> x86_64-pc-win32-macho, which tells clang to build EFIABI, but output a mach-O 
> executable (we need the mach-O for our debugger). Basically with clang you 
> could upstream what you need into the compiler you are using for other 
> things...
> Thanks,
> Andrew Fish
> 
> - Ruslan
> ___
> 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


Re: [edk2] Patch to fix EFIAPI definition

2018-02-08 Thread Ruslan Nikolaev
Well, what I was implying is that if MdePkg (Ia32) headers are included in some 
UEFI program which itself is compiled with some custom register-based calling 
convention, current EFIAPI definition is insufficient.
Current definition with cdecl attribute merely forces caller stack clean-up in 
gcc/clang for Ia32
So, if I build with '-mrtd' option (a callee cleans up the stack) current 
EFIAPI definition will take care of it. However, if in addition to that I 
specify -mregparm=1,2,3 to pass some parameters in registers, cdecl will not 
take care of it.
EFIAPI for Ia32 wants all parameters in the stack. Therefore, it should be 
reasonable to specify regparm(0) as part of EFIAPI definition as well, so that 
regardless of mregparm parameter the compiler will generate correct code. 


On Friday, February 9, 2018 1:59 AM, Andrew Fish  wrote:
 

 

On Feb 8, 2018, at 5:32 PM, Ruslan Nikolaev  wrote:
I submitted a bug report and a patch: 
https://bugzilla.tianocore.org/show_bug.cgi?id=870
It is very straight-forward. Can someone review it, and, hopefully, commit the 
change?


Ruslan,
Was there an example of how to code this? Sorry if I missed it, I'm getting a 
lot of email these days.
Also what is you usage model? Clang is very cross compiler friendly and you can 
specify a triple to support the ABI you need. To get EFI supported on macOS 
tools we ended up open sourcing a triple to support the EFIAPI. If you look in 
https://github.com/tianocore/edk2/blob/master/BaseTools/Conf/tools_def.template 
you will see that you can use Xcode to build EFIAPI if you pass -target 
x86_64-pc-win32-macho. 
I guess I'm asking the question if you really need to support multiple ABIs 
with clang? The best way to solve this in clang is to make it support EFIAPI. 
If you don't need multiple ABIs take a look at what we did with -target 
x86_64-pc-win32-macho, which tells clang to build EFIABI, but output a mach-O 
executable (we need the mach-O for our debugger). Basically with clang you 
could upstream what you need into the compiler you are using for other things...
Thanks,
Andrew Fish

- Ruslan
___
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/2] NetworkPkg: Support the platform to configure TLS CipherList.

2018-02-08 Thread Wu, Jiaxin
Sure, I will update the wiki once the patch is committed.

Thanks
Jiaxin



> -Original Message-
> From: Li, Ruth
> Sent: Friday, February 9, 2018 3:08 PM
> To: Fu, Siyuan ; Wu, Jiaxin ;
> edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Zimmer, Vincent
> ; Ye, Ting ; Yao, Jiewen
> 
> Subject: RE: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> CipherList.
> 
> Jiaxin
> 
> With this capability introduced, could you update Wiki page to notify platform
> to configure that if needed?
> https://github.com/tianocore/tianocore.github.io/wiki/HTTPS-Boot
> 
> Thanks,
> Ruth
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu,
> Siyuan
> Sent: Friday, February 9, 2018 1:23 PM
> To: Wu, Jiaxin ; edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Zimmer, Vincent
> ; Ye, Ting ; Laszlo Ersek
> ; Yao, Jiewen 
> Subject: Re: [edk2] [Patch 0/2] NetworkPkg: Support the platform to
> configure TLS CipherList.
> 
> Hi, Jiaxin
> 
> I think we can remove the "TlsCipherList.h" to another name like
> "HttpTlsCipherListVariable.h" to  highlight that the variable is only used for
> HTTP configuration. And also the variable name and GUID name.
> 
> Siyuan
> 
> > -Original Message-
> > From: Wu, Jiaxin
> > Sent: Friday, February 9, 2018 12:00 PM
> > To: edk2-devel@lists.01.org
> > Cc: Laszlo Ersek ; Kinney, Michael D
> > ; Zimmer, Vincent
> ;
> > Yao, Jiewen ; Ye, Ting ; Fu,
> > Siyuan ; Wu, Jiaxin 
> > Subject: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> > CipherList.
> >
> > Cc: Laszlo Ersek 
> > Cc: Kinney Michael D 
> > Cc: Zimmer Vincent 
> > Cc: Yao Jiewen 
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Wu Jiaxin 
> >
> > Jiaxin Wu (2):
> >   NetworkPkg: Define one private variable for TLS CipherList
> > configuration.
> >   NetworkPkg: Read TlsCipherList variable and configure it for HTTPS
> > session.
> >
> >  NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
> >  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
> >  NetworkPkg/HttpDxe/HttpsSupport.c   | 92
> > -
> >  NetworkPkg/Include/Guid/TlsCipherList.h | 38 ++
> >  NetworkPkg/NetworkPkg.dec   |  3 ++
> >  5 files changed, 136 insertions(+), 3 deletions(-)
> >  create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h
> >
> > --
> > 1.9.5.msysgit.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/2] NetworkPkg: Support the platform to configure TLS CipherList.

2018-02-08 Thread Li, Ruth
Jiaxin

With this capability introduced, could you update Wiki page to notify platform 
to configure that if needed? 
https://github.com/tianocore/tianocore.github.io/wiki/HTTPS-Boot 

Thanks,
Ruth
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu, 
Siyuan
Sent: Friday, February 9, 2018 1:23 PM
To: Wu, Jiaxin ; edk2-devel@lists.01.org
Cc: Kinney, Michael D ; Zimmer, Vincent 
; Ye, Ting ; Laszlo Ersek 
; Yao, Jiewen 
Subject: Re: [edk2] [Patch 0/2] NetworkPkg: Support the platform to configure 
TLS CipherList.

Hi, Jiaxin

I think we can remove the "TlsCipherList.h" to another name like 
"HttpTlsCipherListVariable.h" to  highlight that the variable is only used for 
HTTP configuration. And also the variable name and GUID name. 

Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, February 9, 2018 12:00 PM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Kinney, Michael D
> ; Zimmer, Vincent ;
> Yao, Jiewen ; Ye, Ting ; Fu,
> Siyuan ; Wu, Jiaxin 
> Subject: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> CipherList.
> 
> Cc: Laszlo Ersek 
> Cc: Kinney Michael D 
> Cc: Zimmer Vincent 
> Cc: Yao Jiewen 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin 
> 
> Jiaxin Wu (2):
>   NetworkPkg: Define one private variable for TLS CipherList
> configuration.
>   NetworkPkg: Read TlsCipherList variable and configure it for HTTPS
> session.
> 
>  NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
>  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
>  NetworkPkg/HttpDxe/HttpsSupport.c   | 92
> -
>  NetworkPkg/Include/Guid/TlsCipherList.h | 38 ++
>  NetworkPkg/NetworkPkg.dec   |  3 ++
>  5 files changed, 136 insertions(+), 3 deletions(-)
>  create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h
> 
> --
> 1.9.5.msysgit.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 to fix EFIAPI definition

2018-02-08 Thread Andrew Fish

> On Feb 8, 2018, at 5:32 PM, Ruslan Nikolaev  wrote:
> 
> I submitted a bug report and a patch: 
> https://bugzilla.tianocore.org/show_bug.cgi?id=870
> It is very straight-forward. Can someone review it, and, hopefully, commit 
> the change?

Ruslan,

Was there an example of how to code this? Sorry if I missed it, I'm getting a 
lot of email these days.

Also what is you usage model? Clang is very cross compiler friendly and you can 
specify a triple to support the ABI you need. To get EFI supported on macOS 
tools we ended up open sourcing a triple to support the EFIAPI. If you look in 
https://github.com/tianocore/edk2/blob/master/BaseTools/Conf/tools_def.template 

 you will see that you can use Xcode to build EFIAPI if you pass -target 
x86_64-pc-win32-macho. 

I guess I'm asking the question if you really need to support multiple ABIs 
with clang? The best way to solve this in clang is to make it support EFIAPI. 
If you don't need multiple ABIs take a look at what we did with -target 
x86_64-pc-win32-macho, which tells clang to build EFIABI, but output a mach-O 
executable (we need the mach-O for our debugger). Basically with clang you 
could upstream what you need into the compiler you are using for other things...

Thanks,

Andrew Fish

> - Ruslan
> ___
> 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 1/2] ShellPkg/Dp: Add null pointer check

2018-02-08 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Bi, Dandan
>Sent: Friday, February 09, 2018 11:10 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Wu, Hao A 
>Subject: [patch 1/2] ShellPkg/Dp: Add null pointer check
>
>Cc: Liming Gao 
>Cc: Hao Wu 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dandan Bi 
>---
> ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>index fafc64f..4dd7dd9 100644
>--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>@@ -255,11 +255,11 @@ GetBootPerformanceTable (
> Status = EfiGetSystemConfigurationTable (
>,
>
>  );
>   }
>-  if (EFI_ERROR(Status)) {
>+  if (EFI_ERROR(Status) || AcpiTable == NULL) {
> return Status;
>   }
>
>   FirmwarePerformanceTable = FindAcpiPtr (
>   (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER
>*)AcpiTable,
>--
>1.9.5.msysgit.1

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


Re: [edk2] [patch 2/2] ShellPkg/DP: Update the error message info

2018-02-08 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Dandan Bi
>Sent: Friday, February 09, 2018 11:10 AM
>To: edk2-devel@lists.01.org
>Cc: Yao, Jiewen ; Gao, Liming 
>Subject: [edk2] [patch 2/2] ShellPkg/DP: Update the error message info
>
>Make the error message clearer if fail to get ACPI/FPDT table.
>
>Cc: Liming Gao 
>Cc: Jiewen Yao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dandan Bi 
>---
> ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c   | 3 ++-
> ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>index 4dd7dd9..aa9c2cd 100644
>--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
>@@ -256,18 +256,20 @@ GetBootPerformanceTable (
>,
>
>  );
>   }
>   if (EFI_ERROR(Status) || AcpiTable == NULL) {
>+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
>(STR_DP_GET_ACPI_TABLE_FAIL), mDpHiiHandle);
> return Status;
>   }
>
>   FirmwarePerformanceTable = FindAcpiPtr (
>   (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER
>*)AcpiTable,
>
>EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_SIGNATURE
>   );
>   if (FirmwarePerformanceTable == NULL) {
>+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
>(STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle);
> return EFI_NOT_FOUND;
>   }
>
>   mBootPerformanceTable = (UINT8*) (UINTN)FirmwarePerformanceTable-
>>BootPointerRecord.BootPerformanceTablePointer;
>   mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE *)
>mBootPerformanceTable)->Header.Length;
>@@ -737,11 +739,10 @@ RunDp (
>   //
>   //1. Get FPDT from ACPI table.
>   //
>   Status = GetBootPerformanceTable ();
>   if (EFI_ERROR(Status)) {
>-ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
>(STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL), mDpHiiHandle);
> return Status;
>   }
>
>   //
>   //2. Cache the ModuleGuid and hanlde mapping table.
>diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
>b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
>index b6069ae..c7eb0fb 100644
>--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
>+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
>@@ -88,11 +88,12 @@
> #string STR_DP_RAW_VARS2   #language en-US
>"%5d: %16LX %16LX %16LX  %31a  %31a %5d\n"
> #string STR_DP_RAW_HEADR2  #language en-US  "\nIndex   Handle
>Start Count   End Count  Token  
>Module   ID\n"
> #string STR_DP_INCOMPLETE  #language en-US  " I "
> #string STR_DP_COMPLETE#language en-US  "   "
> #string STR_ALIT_UNKNOWN   #language en-US  "Unknown"
>-#string STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL  #language en-
>US  "Fail to get boot performance table\n"
>+#string STR_DP_GET_ACPI_TABLE_FAIL #language en-US  "Fail to get ACPI
>Table\n"
>+#string STR_DP_GET_ACPI_FPDT_FAIL  #language en-US  "Fail to get
>Firmware Performance Data Table (FPDT) in ACPI Table\n"
>
> #string STR_GET_HELP_DP #language en-US ""
> ".TH dp 0 "Display performance metrics"\r\n"
> ".SH NAME\r\n"
> "Displays performance metrics that are stored in memory.\r\n"
>--
>1.9.5.msysgit.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] MdeModulePkg/DriverSampleDxe: Make bit fields aligned in C structure

2018-02-08 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Bi, Dandan
>Sent: Thursday, February 08, 2018 10:29 PM
>To: edk2-devel@lists.01.org
>Cc: Dong, Eric ; Gao, Liming 
>Subject: [patch] MdeModulePkg/DriverSampleDxe: Make bit fields aligned in
>C structure
>
>For a structure with a series of bit fields and used as a storage
>in vfr file, and if the bit fields do not add up to the size of
>the defined type.In the C code use sizeof() to get size of the
>structure, the results may vary form the compiler(VS,GCC...).
>But the size of the storage calculated by VfrCompiler is fixed
>(calculate with alignment).To avoid the issue cased by above case,
>we need to make the total width of the bit fields in the structure
>aligned with the size of the defined type for these bit fields.
>
>Cc: Eric Dong 
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dandan Bi 
>---
> MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h | 11
>+++
> 1 file changed, 11 insertions(+)
>
>diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
>b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
>index 40fb3d0..af3d4bc 100644
>--- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
>+++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
>@@ -33,10 +33,18 @@ Revision History:
> #define CONFIGURATION_VARSTORE_ID0x1234
> #define BITS_VARSTORE_ID 0x2345
>
> #pragma pack(1)
>
>+//
>+// !!! For a structure with a series of bit fields and used as a storage in 
>vfr file,
>and if the bit fields do not add up to the size of the defined type.
>+// In the C code use sizeof() to get the size the strucure, the results may 
>vary
>form the compiler(VS,GCC...).
>+// But the size of the storage calculated by VfrCompiler is fixed (calculate
>with alignment).
>+// To avoid above case, we need to make the total bit width in the structure
>aligned with the size of the defined type for these bit fields. We can:
>+// 1. Add bit field (with/without name) with remianing with for padding.
>+// 2. Add unnamed bit field with 0 for padding, the amount of padding is
>determined by the alignment characteristics of the members of the structure.
>+//
> typedef struct {
>   UINT16   NestByteField;
>   UINT8: 1;  // unamed field can be used for padding
>   UINT8NestBitCheckbox : 1;
>   UINT8NestBitOneof: 2;
>@@ -82,11 +90,13 @@ typedef struct {
>   EFI_HII_TIME  Time;
>   UINT8   RefreshGuidCount;
>   UINT8   Match2;
>   UINT8   GetDefaultValueFromCallBackForOrderedList[3];
>   UINT8   BitCheckbox : 1;
>+  UINT8   ReservedBits: 7;  // Reserved bit fields for padding.
>   UINT16  BitOneof: 6;
>+  UINT16  : 0;  // Width 0 used to force alignment.
>   UINT16  BitNumeric  : 12;
>   MY_BITS_DATA  MyBitData;
>   MY_EFI_UNION_DATA MyUnionData;
> } DRIVER_SAMPLE_CONFIGURATION;
>
>@@ -107,10 +117,11 @@ typedef struct {
>   MY_BITS_DATA  BitsData;
>   UINT32   EfiBitGrayoutTest : 5;
>   UINT32   EfiBitNumeric : 4;
>   UINT32   EfiBitOneof   : 10;
>   UINT32   EfiBitCheckbox: 1;
>+  UINT32 : 0;  // Width 0 used to force alignment.
> } MY_EFI_BITS_VARSTORE_DATA;
>
> //
> // Labels definition
> //
>--
>1.9.5.msysgit.1

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


Re: [edk2] [PATCH v4 1/1] MdePkg/Include: Add management mode FV file type and depex.

2018-02-08 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Supreeth Venkatesh [mailto:supreeth.venkat...@arm.com]
>Sent: Friday, February 09, 2018 4:25 AM
>To: edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Gao, Liming
>; Yao, Jiewen ; Supreeth
>Venkatesh ; Achin Gupta
>
>Subject: [PATCH v4 1/1] MdePkg/Include: Add management mode FV file
>type and depex.
>
>As per PI specification v1.6,
>As per section 2.1.4.1,
>The following file types exist:
>Table 3. Defined File Types
>Name   Value
>EFI_FV_FILETYPE_RAW0x01
>EFI_FV_FILETYPE_FREEFORM   0x02
>EFI_FV_FILETYPE_SECURITY_CORE  0x03
>EFI_FV_FILETYPE_PEI_CORE   0x04
>EFI_FV_FILETYPE_DXE_CORE   0x05
>EFI_FV_FILETYPE_PEIM   0x06
>EFI_FV_FILETYPE_DRIVER 0x07
>EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER   0x08
>EFI_FV_FILETYPE_APPLICATION0x09
>EFI_FV_FILETYPE_MM 0x0A
>EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE  0x0B
>EFI_FV_FILETYPE_COMBINED_MM_DXE0x0C
>EFI_FV_FILETYPE_MM_CORE0x0D
>EFI_FV_FILETYPE_MM_STANDALONE  0x0E
>EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F
>
>The following new section type is added:
>EFI_SECTION_MM_DEPEX
>
>This patch adds the management mode FV file type and depex.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Achin Gupta 
>Signed-off-by: Supreeth Venkatesh 
>Reviewed-by: Jiewen Yao 
>Reviewed-by: Liming Gao 
>---
> MdePkg/Include/Pi/PiFirmwareFile.h | 14 ++
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
>diff --git a/MdePkg/Include/Pi/PiFirmwareFile.h
>b/MdePkg/Include/Pi/PiFirmwareFile.h
>index b982c9eda3..16c007fc75 100644
>--- a/MdePkg/Include/Pi/PiFirmwareFile.h
>+++ b/MdePkg/Include/Pi/PiFirmwareFile.h
>@@ -71,10 +71,15 @@ typedef UINT8 EFI_FFS_FILE_STATE;
> #define EFI_FV_FILETYPE_DRIVER0x07
> #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER  0x08
> #define EFI_FV_FILETYPE_APPLICATION   0x09
>-#define EFI_FV_FILETYPE_SMM   0x0A
>+#define EFI_FV_FILETYPE_MM0x0A
>+#define EFI_FV_FILETYPE_SMM   EFI_FV_FILETYPE_MM
> #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
>-#define EFI_FV_FILETYPE_COMBINED_SMM_DXE  0x0C
>-#define EFI_FV_FILETYPE_SMM_CORE  0x0D
>+#define EFI_FV_FILETYPE_COMBINED_MM_DXE   0x0C
>+#define EFI_FV_FILETYPE_COMBINED_SMM_DXE
>EFI_FV_FILETYPE_COMBINED_MM_DXE
>+#define EFI_FV_FILETYPE_MM_CORE   0x0D
>+#define EFI_FV_FILETYPE_SMM_CORE  EFI_FV_FILETYPE_MM_CORE
>+#define EFI_FV_FILETYPE_MM_STANDALONE 0x0E
>+#define EFI_FV_FILETYPE_MM_CORE_STANDALONE0x0F
> #define EFI_FV_FILETYPE_OEM_MIN   0xc0
> #define EFI_FV_FILETYPE_OEM_MAX   0xdf
> #define EFI_FV_FILETYPE_DEBUG_MIN 0xe0
>@@ -217,7 +222,8 @@ typedef UINT8 EFI_SECTION_TYPE;
> #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
> #define EFI_SECTION_RAW   0x19
> #define EFI_SECTION_PEI_DEPEX 0x1B
>-#define EFI_SECTION_SMM_DEPEX 0x1C
>+#define EFI_SECTION_MM_DEPEX  0x1C
>+#define EFI_SECTION_SMM_DEPEX EFI_SECTION_MM_DEPEX
>
> ///
> /// Common section header.
>--
>2.14.1

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


Re: [edk2] [Patch 0/2] NetworkPkg: Support the platform to configure TLS CipherList.

2018-02-08 Thread Wu, Jiaxin
Thanks the comment, I will refine the series patch.



> -Original Message-
> From: Fu, Siyuan
> Sent: Friday, February 9, 2018 1:23 PM
> To: Wu, Jiaxin ; edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Kinney, Michael D
> ; Zimmer, Vincent
> ; Yao, Jiewen ; Ye,
> Ting 
> Subject: RE: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> CipherList.
> 
> Hi, Jiaxin
> 
> I think we can remove the "TlsCipherList.h" to another name like
> "HttpTlsCipherListVariable.h" to  highlight that the variable is only used for
> HTTP configuration. And also the variable name and GUID name.
> 
> Siyuan
> 
> > -Original Message-
> > From: Wu, Jiaxin
> > Sent: Friday, February 9, 2018 12:00 PM
> > To: edk2-devel@lists.01.org
> > Cc: Laszlo Ersek ; Kinney, Michael D
> > ; Zimmer, Vincent
> ;
> > Yao, Jiewen ; Ye, Ting ; Fu,
> > Siyuan ; Wu, Jiaxin 
> > Subject: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> > CipherList.
> >
> > Cc: Laszlo Ersek 
> > Cc: Kinney Michael D 
> > Cc: Zimmer Vincent 
> > Cc: Yao Jiewen 
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Wu Jiaxin 
> >
> > Jiaxin Wu (2):
> >   NetworkPkg: Define one private variable for TLS CipherList
> > configuration.
> >   NetworkPkg: Read TlsCipherList variable and configure it for HTTPS
> > session.
> >
> >  NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
> >  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
> >  NetworkPkg/HttpDxe/HttpsSupport.c   | 92
> > -
> >  NetworkPkg/Include/Guid/TlsCipherList.h | 38 ++
> >  NetworkPkg/NetworkPkg.dec   |  3 ++
> >  5 files changed, 136 insertions(+), 3 deletions(-)
> >  create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h
> >
> > --
> > 1.9.5.msysgit.1

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


Re: [edk2] [Patch 0/2] NetworkPkg: Support the platform to configure TLS CipherList.

2018-02-08 Thread Fu, Siyuan
Hi, Jiaxin

I think we can remove the "TlsCipherList.h" to another name like 
"HttpTlsCipherListVariable.h" to  highlight that the variable is only used for 
HTTP configuration. And also the variable name and GUID name. 

Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, February 9, 2018 12:00 PM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Kinney, Michael D
> ; Zimmer, Vincent ;
> Yao, Jiewen ; Ye, Ting ; Fu,
> Siyuan ; Wu, Jiaxin 
> Subject: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> CipherList.
> 
> Cc: Laszlo Ersek 
> Cc: Kinney Michael D 
> Cc: Zimmer Vincent 
> Cc: Yao Jiewen 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin 
> 
> Jiaxin Wu (2):
>   NetworkPkg: Define one private variable for TLS CipherList
> configuration.
>   NetworkPkg: Read TlsCipherList variable and configure it for HTTPS
> session.
> 
>  NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
>  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
>  NetworkPkg/HttpDxe/HttpsSupport.c   | 92
> -
>  NetworkPkg/Include/Guid/TlsCipherList.h | 38 ++
>  NetworkPkg/NetworkPkg.dec   |  3 ++
>  5 files changed, 136 insertions(+), 3 deletions(-)
>  create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h
> 
> --
> 1.9.5.msysgit.1

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


[edk2] [Patch] BaseTools: Improve build performance

2018-02-08 Thread BobCF
Add cache for building PcdValueInit.c.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/GenFds/GenFds.py  |   1 +
 BaseTools/Source/Python/Workspace/DscBuildData.py | 150 +++---
 2 files changed, 78 insertions(+), 73 deletions(-)

diff --git a/BaseTools/Source/Python/GenFds/GenFds.py 
b/BaseTools/Source/Python/GenFds/GenFds.py
index dcba9f24cb..cd705630a3 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -324,10 +324,11 @@ def main():
 EdkLogger.error("GenFds", 
FORMAT_INVALID, "The FV %s's region is specified in multiple FD with different 
value." %FvObj.UiFvName)
 else:
 FvObj.FvRegionInFD = RegionObj.Size
 
RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj)
 
+GlobalData.BuildOptionPcd = Options.OptionPcd if Options.OptionPcd 
else {}
 """Call GenFds"""
 GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
 
 """Generate GUID cross reference file"""
 GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList, FdfParserObj)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 0da3efbb43..70dd83cfbc 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -35,10 +35,11 @@ from Common.Misc import ProcessDuplicatedInf
 import re
 from Common.Parsing import IsValidWord
 from Common.VariableAttributes import VariableAttributes
 import Common.GlobalData as GlobalData
 import subprocess
+from Common.Misc import SaveFileOnChange
 from Workspace.BuildClassObject import PlatformBuildClassObject, StructurePcd, 
PcdClassObject, ModuleBuildClassObject
 
 #
 # Treat CHAR16 as a synonym for UINT16.  CHAR16 support is required for VFR C 
structs
 #
@@ -154,12 +155,14 @@ class DscBuildData(PlatformBuildClassObject):
 self._Target = Target
 self._Toolchain = Toolchain
 self._ToolChainFamily = None
 self._Clear()
 self._HandleOverridePath()
+self.WorkspaceDir = ""
 if os.getenv("WORKSPACE"):
 self.OutputPath = os.path.join(os.getenv("WORKSPACE"), 'Build', 
PcdValueInitName)
+self.WorkspaceDir = os.getenv("WORKSPACE")
 else:
 self.OutputPath = os.path.dirname(self.DscFile)
 self.DefaultStores = None
 self.SkuIdMgr = SkuClass(self.SkuName, self.SkuIds)
 
@@ -1289,11 +1292,11 @@ class DscBuildData(PlatformBuildClassObject):
 str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: 
str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, 
str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in 
DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
 else:
 str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: 
str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, 
str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in 
DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
 for str_pcd_data in StrPcdSet[str_pcd]:
 if str_pcd_data[3] in SkuIds:
-str_pcd_obj_str.AddOverrideValue(str_pcd_data[2], 
str(str_pcd_data[6]), 'DEFAULT' if str_pcd_data[3] == 'COMMON' else 
str_pcd_data[3],'STANDARD' if str_pcd_data[4] == 'COMMON' else str_pcd_data[4], 
self.MetaFile.File,LineNo=str_pcd_data[5])
+str_pcd_obj_str.AddOverrideValue(str_pcd_data[2], 
str(str_pcd_data[6]), 'DEFAULT' if str_pcd_data[3] == 'COMMON' else 
str_pcd_data[3],'STANDARD' if str_pcd_data[4] == 'COMMON' else str_pcd_data[4], 
self.MetaFile.File if self.WorkspaceDir not in self.MetaFile.File else 
self.MetaFile.File[len(self.WorkspaceDir) if 
self.WorkspaceDir.endswith(os.path.sep) else 
len(self.WorkspaceDir)+1:],LineNo=str_pcd_data[5])
 S_pcd_set[str_pcd[1], str_pcd[0]] = str_pcd_obj_str
 else:
 EdkLogger.error('build', PARSER_ERROR,
 "Pcd (%s.%s) defined in DSC is not declared in DEC 
files. Arch: ['%s']" % (str_pcd[0], str_pcd[1], self._Arch),
 File=self.MetaFile,Line = StrPcdSet[str_pcd][0][5])
@@ -1781,14 +1784,14 @@ class DscBuildData(PlatformBuildClassObject):
 for IncludeFile in Pcd.StructuredPcdIncludeFile:
 if IncludeFile not in Includes:
 Includes[IncludeFile] = True
 CApp = CApp + '#include <%s>\n' % (IncludeFile)
 CApp = CApp + '\n'
-
 for PcdName in StructuredPcds:
 Pcd = StructuredPcds[PcdName]
-if not Pcd.SkuOverrideValues:
+  

Re: [edk2] [PATCH v2 00/10] Formalize the reset system core design

2018-02-08 Thread Zeng, Star
Thanks for the new version patch series.

With minor comments (I provided to V1) handled, Reviewed-by: Star Zeng 
 to the patch series. :)

For patch 007: "@param[in]  ResetType Base reset type as defined in UEFI 
spec." needs to be removed in ResetUtilityLib.h

For patch 009: It changed EFI_SOFTWARE_RUNTIME_SERVICE to 
EFI_SOFTWARE_PEI_SERVICE, but forgets to change 'runtime' to 'PEI' in comments 
and change EFI_SW_RS_PC_RESET_SYSTEM to EFI_SW_PS_PC_RESET_SYSTEM.


Thanks,
Star
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Friday, February 9, 2018 12:16 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH v2 00/10] Formalize the reset system core design

The patches add/update two core modules that perform the reset action
  ResetSystemPei and ResetSystemRuntimeDxe

With the two core modules, every time a reset action is performed in either PEI 
phase or DXE phase, the accordingly registerred reset 
filter/notification/handler will be triggered.

Reset filters are processed first so the final reset type and reset data can be 
determined.  Reset Notifications are processed second so all components that 
have registered for a Reset Notification can perform any required clean up 
actions. Reset handlers are processed third.  If there are no registered reset 
handlers or none of them resets the platform, then the default reset action 
based on the ResetSystemLib is performed.

The v2 changes against v2 are attached in the end of this mail. 

Bret Barkelew (1):
  MdeModulePkg/ResetSystemPei: Add reset notifications in PEI

Michael D Kinney (6):
  MdePkg/PeiServicesLib: Add PeiServicesResetSystem2()
  MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first
  MdeModulePkg/PeiMain: Cleanup whitespace in Reset.c
  MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler
  MdeModulePkg: Add ResetSystemLib instances that call core services
  MdeModulePkg: Add ResetUtility librray class and BASE instance

Ruiyu Ni (3):
  MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message
  MdePkg/UefiRuntimeLib: Support more module types.
  MdeModulePkg: Add ResetSystemPei PEIM

 MdeModulePkg/Core/Pei/Reset/Reset.c|  67 ++--
 MdeModulePkg/Include/Library/ResetUtilityLib.h | 111 ++
 .../Include/Ppi/PlatformSpecificResetFilter.h  |  31 ++
 .../Include/Ppi/PlatformSpecificResetHandler.h |  29 ++
 .../Ppi/PlatformSpecificResetNotification.h|  32 ++
 .../Include/Protocol/PlatformSpecificResetFilter.h |  31 ++
 .../Protocol/PlatformSpecificResetHandler.h|  29 ++
 .../Library/DxeResetSystemLib/DxeResetSystemLib.c  |  98 ++
 .../DxeResetSystemLib/DxeResetSystemLib.inf|  39 +++
 .../DxeResetSystemLib/DxeResetSystemLib.uni|  21 ++
 .../Library/PeiResetSystemLib/PeiResetSystemLib.c  |  98 ++
 .../PeiResetSystemLib/PeiResetSystemLib.inf|  39 +++
 .../PeiResetSystemLib/PeiResetSystemLib.uni|  21 ++
 .../Library/ResetUtilityLib/ResetUtility.c | 220 
 .../Library/ResetUtilityLib/ResetUtilityLib.inf|  40 +++
 MdeModulePkg/MdeModulePkg.dec  |  20 ++
 MdeModulePkg/MdeModulePkg.dsc  |   7 +
 MdeModulePkg/MdeModulePkg.uni  |   7 +-
 .../Universal/ResetSystemPei/ResetSystem.c | 371 +
 .../Universal/ResetSystemPei/ResetSystem.h | 130 
 .../ResetSystemPei.inf}|  45 ++-
 .../Universal/ResetSystemPei/ResetSystemPei.uni|  20 ++
 .../ResetSystemPei/ResetSystemPeiExtra.uni |  20 ++
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  |  91 -
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.h  |   7 +
 .../ResetSystemRuntimeDxe.inf  |   7 +-
 MdePkg/Include/Library/PeiServicesLib.h|  24 ++
 MdePkg/Library/PeiServicesLib/PeiServicesLib.c |  26 ++
 MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf   |   4 +-
 29 files changed, 1615 insertions(+), 70 deletions(-)  create mode 100644 
MdeModulePkg/Include/Library/ResetUtilityLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.uni
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
 create mode 100644 

[edk2] [PATCH v2 03/10] MdeModulePkg/PeiMain: Cleanup whitespace in Reset.c

2018-02-08 Thread Ruiyu Ni
From: Michael D Kinney 

Cc: Liming Gao 
Reviewed-by: Ruiyu Ni 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
Reviewed-by: Star Zeng 
---
 MdeModulePkg/Core/Pei/Reset/Reset.c | 41 ++---
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/Reset/Reset.c 
b/MdeModulePkg/Core/Pei/Reset/Reset.c
index cd36c526b5..e6d7899ef7 100644
--- a/MdeModulePkg/Core/Pei/Reset/Reset.c
+++ b/MdeModulePkg/Core/Pei/Reset/Reset.c
@@ -1,14 +1,14 @@
 /** @file
   Pei Core Reset System Support
-  
+
 Copyright (c) 2006 - 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.  
   
+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.
 
 **/
 
@@ -29,11 +29,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 EFI_STATUS
 EFIAPI
 PeiResetSystem (
-  IN CONST EFI_PEI_SERVICES **PeiServices
+  IN CONST EFI_PEI_SERVICES  **PeiServices
   )
 {
-  EFI_STATUSStatus;
-  EFI_PEI_RESET_PPI *ResetPpi;
+  EFI_STATUS Status;
+  EFI_PEI_RESET_PPI  *ResetPpi;
 
   //
   // Attempt to use newer ResetSystem2().  If this returns, then ResetSystem2()
@@ -52,9 +52,10 @@ PeiResetSystem (
  );
   if (!EFI_ERROR (Status)) {
 return ResetPpi->ResetSystem (PeiServices);
-  } 
+  }
+
   //
-  // Report Status Code that Reset PPI is not available
+  // Report Status Code that Reset PPI is not available.
   //
   REPORT_STATUS_CODE (
 EFI_ERROR_CODE | EFI_ERROR_MINOR,
@@ -85,14 +86,14 @@ PeiResetSystem (
 VOID
 EFIAPI
 PeiResetSystem2 (
-  IN EFI_RESET_TYPE ResetType,
-  IN EFI_STATUS ResetStatus,
-  IN UINTN  DataSize,
-  IN VOID   *ResetData OPTIONAL
+  IN EFI_RESET_TYPE  ResetType,
+  IN EFI_STATUS  ResetStatus,
+  IN UINTN   DataSize,
+  IN VOID*ResetData OPTIONAL
   )
 {
-  EFI_STATUSStatus;
-  EFI_PEI_RESET2_PPI*Reset2Ppi;
+  EFI_STATUS  Status;
+  EFI_PEI_RESET2_PPI  *Reset2Ppi;
 
   //
   // Look for PEI Reset System 2 PPI
@@ -103,7 +104,6 @@ PeiResetSystem2 (
  NULL,
  (VOID **)
  );
-
   if (!EFI_ERROR (Status)) {
 Reset2Ppi->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
 return;
@@ -117,4 +117,3 @@ PeiResetSystem2 (
 (EFI_SOFTWARE_PEI_CORE | EFI_SW_PS_EC_RESET_NOT_AVAILABLE)
 );
 }
-
-- 
2.16.1.windows.1

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


[edk2] [PATCH v2 00/10] Formalize the reset system core design

2018-02-08 Thread Ruiyu Ni
The patches add/update two core modules that perform the reset action
  ResetSystemPei and ResetSystemRuntimeDxe

With the two core modules, every time a reset action is performed in
either PEI phase or DXE phase, the accordingly registerred
reset filter/notification/handler will be triggered.

Reset filters are processed first so the final reset type and reset
data can be determined.  Reset Notifications are processed second
so all components that have registered for a Reset Notification can
perform any required clean up actions. Reset handlers are processed
third.  If there are no registered reset handlers or none of them
resets the platform, then the default reset action based on the
ResetSystemLib is performed.

The v2 changes against v2 are attached in the end of this mail. 

Bret Barkelew (1):
  MdeModulePkg/ResetSystemPei: Add reset notifications in PEI

Michael D Kinney (6):
  MdePkg/PeiServicesLib: Add PeiServicesResetSystem2()
  MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first
  MdeModulePkg/PeiMain: Cleanup whitespace in Reset.c
  MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler
  MdeModulePkg: Add ResetSystemLib instances that call core services
  MdeModulePkg: Add ResetUtility librray class and BASE instance

Ruiyu Ni (3):
  MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message
  MdePkg/UefiRuntimeLib: Support more module types.
  MdeModulePkg: Add ResetSystemPei PEIM

 MdeModulePkg/Core/Pei/Reset/Reset.c|  67 ++--
 MdeModulePkg/Include/Library/ResetUtilityLib.h | 111 ++
 .../Include/Ppi/PlatformSpecificResetFilter.h  |  31 ++
 .../Include/Ppi/PlatformSpecificResetHandler.h |  29 ++
 .../Ppi/PlatformSpecificResetNotification.h|  32 ++
 .../Include/Protocol/PlatformSpecificResetFilter.h |  31 ++
 .../Protocol/PlatformSpecificResetHandler.h|  29 ++
 .../Library/DxeResetSystemLib/DxeResetSystemLib.c  |  98 ++
 .../DxeResetSystemLib/DxeResetSystemLib.inf|  39 +++
 .../DxeResetSystemLib/DxeResetSystemLib.uni|  21 ++
 .../Library/PeiResetSystemLib/PeiResetSystemLib.c  |  98 ++
 .../PeiResetSystemLib/PeiResetSystemLib.inf|  39 +++
 .../PeiResetSystemLib/PeiResetSystemLib.uni|  21 ++
 .../Library/ResetUtilityLib/ResetUtility.c | 220 
 .../Library/ResetUtilityLib/ResetUtilityLib.inf|  40 +++
 MdeModulePkg/MdeModulePkg.dec  |  20 ++
 MdeModulePkg/MdeModulePkg.dsc  |   7 +
 MdeModulePkg/MdeModulePkg.uni  |   7 +-
 .../Universal/ResetSystemPei/ResetSystem.c | 371 +
 .../Universal/ResetSystemPei/ResetSystem.h | 130 
 .../ResetSystemPei.inf}|  45 ++-
 .../Universal/ResetSystemPei/ResetSystemPei.uni|  20 ++
 .../ResetSystemPei/ResetSystemPeiExtra.uni |  20 ++
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  |  91 -
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.h  |   7 +
 .../ResetSystemRuntimeDxe.inf  |   7 +-
 MdePkg/Include/Library/PeiServicesLib.h|  24 ++
 MdePkg/Library/PeiServicesLib/PeiServicesLib.c |  26 ++
 MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf   |   4 +-
 29 files changed, 1615 insertions(+), 70 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/ResetUtilityLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.uni
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.uni
 create mode 100644 MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
 create mode 100644 MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
 copy MdeModulePkg/Universal/{ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf 
=> ResetSystemPei/ResetSystemPei.inf} (50%)
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.uni
 create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPeiExtra.uni
diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h

index 0f1432f5f8..1f728387b7 

[edk2] [PATCH v2 08/10] MdePkg/UefiRuntimeLib: Support more module types.

2018-02-08 Thread Ruiyu Ni
Because DxeResetSystemLib links to this library to provide
reset system services, change UefiRuntimeLib to support
the same set of module types as what DxeResetSystemLib does.

Cc: Liming Gao 
Cc: Michael D Kinney 
Reviewed-by: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
---
 MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf 
b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
index 8f46495fc5..d053da545a 100644
--- a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+++ b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
@@ -5,7 +5,7 @@
 #  EVT_SIGNAL_EXIT_BOOT_SERVICES event, to provide runtime services.
 # This instance also supports SAL drivers for better performance.
 #
-# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 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
@@ -24,7 +24,7 @@ [Defines]
   FILE_GUID  = b1ee6c28-54aa-4d17-b705-3e28ccb27b2e
   MODULE_TYPE= DXE_RUNTIME_DRIVER
   VERSION_STRING = 1.0
-  LIBRARY_CLASS  = UefiRuntimeLib|DXE_RUNTIME_DRIVER 
DXE_SAL_DRIVER
+  LIBRARY_CLASS  = UefiRuntimeLib|DXE_RUNTIME_DRIVER 
DXE_SAL_DRIVER DXE_CORE DXE_DRIVER DXE_SMM_DRIVER 
 
   CONSTRUCTOR= RuntimeDriverLibConstruct
   DESTRUCTOR = RuntimeDriverLibDeconstruct
-- 
2.16.1.windows.1

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


[edk2] [PATCH v2 01/10] MdePkg/PeiServicesLib: Add PeiServicesResetSystem2()

2018-02-08 Thread Ruiyu Ni
From: Michael D Kinney 

Add the PeiServicesResetSytstem2() function to the PeiServiesLib
to call the ResetSystem2() services in the PEI Services Table.

Cc: Liming Gao 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
Signed-off-by: Ruiyu Ni 
Reviewed-by: Star Zeng 
---
 MdePkg/Include/Library/PeiServicesLib.h| 24 
 MdePkg/Library/PeiServicesLib/PeiServicesLib.c | 26 ++
 2 files changed, 50 insertions(+)

diff --git a/MdePkg/Include/Library/PeiServicesLib.h 
b/MdePkg/Include/Library/PeiServicesLib.h
index 9fc22a10c1..0be72237f2 100644
--- a/MdePkg/Include/Library/PeiServicesLib.h
+++ b/MdePkg/Include/Library/PeiServicesLib.h
@@ -540,4 +540,28 @@ PeiServicesInstallFvInfo2Ppi (
   IN   UINT32  AuthenticationStatus
   );
 
+/**
+  Resets the entire platform.
+
+  @param[in] ResetType  The type of reset to perform.
+  @param[in] ResetStatusThe status code for the reset.
+  @param[in] DataSize   The size, in bytes, of ResetData.
+  @param[in] ResetData  For a ResetType of EfiResetCold, EfiResetWarm, or 
EfiResetShutdown
+the data buffer starts with a Null-terminated 
string, optionally
+followed by additional binary data. The string is 
a description
+that the caller may use to further indicate the 
reason for the
+system reset. ResetData is only valid if 
ResetStatus is something
+other than EFI_SUCCESS unless the ResetType is 
EfiResetPlatformSpecific
+where a minimum amount of ResetData is always 
required.
+
+**/
+VOID
+EFIAPI
+PeiServicesResetSystem2 (
+  IN EFI_RESET_TYPE ResetType,
+  IN EFI_STATUS ResetStatus,
+  IN UINTN  DataSize,
+  IN VOID   *ResetData OPTIONAL
+  );
+
 #endif
diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c 
b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
index 89166ccd38..d0838ed709 100644
--- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
+++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
@@ -789,3 +789,29 @@ PeiServicesInstallFvInfo2Ppi (
   InternalPeiServicesInstallFvInfoPpi (FALSE, FvFormat, FvInfo, FvInfoSize, 
ParentFvName, ParentFileName, AuthenticationStatus);
 }
 
+/**
+  Resets the entire platform.
+
+  @param[in] ResetType  The type of reset to perform.
+  @param[in] ResetStatusThe status code for the reset.
+  @param[in] DataSize   The size, in bytes, of ResetData.
+  @param[in] ResetData  For a ResetType of EfiResetCold, EfiResetWarm, or 
EfiResetShutdown
+the data buffer starts with a Null-terminated 
string, optionally
+followed by additional binary data. The string is 
a description
+that the caller may use to further indicate the 
reason for the
+system reset. ResetData is only valid if 
ResetStatus is something
+other than EFI_SUCCESS unless the ResetType is 
EfiResetPlatformSpecific
+where a minimum amount of ResetData is always 
required.
+
+**/
+VOID
+EFIAPI
+PeiServicesResetSystem2 (
+  IN EFI_RESET_TYPE ResetType,
+  IN EFI_STATUS ResetStatus,
+  IN UINTN  DataSize,
+  IN VOID   *ResetData OPTIONAL
+  )
+{
+  (*GetPeiServicesTablePointer())->ResetSystem2 (ResetType, ResetStatus, 
DataSize, ResetData);
+}
-- 
2.16.1.windows.1

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


[edk2] [PATCH v2 06/10] MdeModulePkg: Add ResetSystemLib instances that call core services

2018-02-08 Thread Ruiyu Ni
From: Michael D Kinney 

Add a PEI instance of ResetSystemLib that calls the ResetSystem2()
service in the PEI Services Table.

Add a DXE instance of ResetSystemLib that calls the ResetSystem()
service in the UEFI Runtime Services Table.

These 2 library instances should be the default ResetSystemLib
mapping for most PEIMs and DXE drivers so all reset system requests
go through the core service.

Only the implementation of the core servies should use the
platform specific instance of the ResetSystemLib that actually
performs the hardware actions to reset the platform.

Cc: Liming Gao 
Reviewed-by: Ruiyu Ni 
Reviewed-by: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 .../Library/DxeResetSystemLib/DxeResetSystemLib.c  | 98 ++
 .../DxeResetSystemLib/DxeResetSystemLib.inf| 39 +
 .../DxeResetSystemLib/DxeResetSystemLib.uni| 21 +
 .../Library/PeiResetSystemLib/PeiResetSystemLib.c  | 98 ++
 .../PeiResetSystemLib/PeiResetSystemLib.inf| 39 +
 .../PeiResetSystemLib/PeiResetSystemLib.uni| 21 +
 6 files changed, 316 insertions(+)
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.uni
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.uni

diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c 
b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
new file mode 100644
index 00..ea452e3231
--- /dev/null
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
@@ -0,0 +1,98 @@
+/** @file
+  DXE Reset System Library instance that calls gRT->ResetSystem().
+
+  Copyright (c) 2017 - 2018, 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.
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  This function causes a system-wide reset (cold reset), in which
+  all circuitry within the system returns to its initial state. This type of 
reset 
+  is asynchronous to system operation and operates without regard to
+  cycle boundaries.
+
+  If this function returns, it means that the system does not support cold 
reset. 
+**/
+VOID
+EFIAPI
+ResetCold (
+  VOID
+  )
+{
+  EfiResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+}
+
+/**
+  This function causes a system-wide initialization (warm reset), in which all 
processors 
+  are set to their initial state. Pending cycles are not corrupted.
+
+  If this function returns, it means that the system does not support warm 
reset.
+**/
+VOID
+EFIAPI
+ResetWarm (
+  VOID
+  )
+{
+  EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+}
+
+/**
+  This function causes the system to enter a power state equivalent 
+  to the ACPI G2/S5 or G3 states.
+
+  If this function returns, it means that the system does not support shut 
down reset.
+**/
+VOID
+EFIAPI
+ResetShutdown (
+  VOID
+  )
+{
+  EfiResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+}
+
+/**
+  This function causes the system to enter S3 and then wake up immediately.
+
+  If this function returns, it means that the system does not support S3 
feature.
+**/
+VOID
+EFIAPI
+EnterS3WithImmediateWake (
+  VOID
+  )
+{
+}
+
+/**
+  This function causes a systemwide reset. The exact type of the reset is
+  defined by the EFI_GUID that follows the Null-terminated Unicode string 
passed
+  into ResetData. If the platform does not recognize the EFI_GUID in ResetData
+  the platform must pick a supported reset type to perform.The platform may
+  optionally log the parameters from any non-normal reset that occurs.
+
+  @param[in]  DataSize   The size, in bytes, of ResetData.
+  @param[in]  ResetData  The data buffer starts with a Null-terminated string,
+ followed by the EFI_GUID.
+**/
+VOID
+EFIAPI
+ResetPlatformSpecific (
+  IN UINTN   DataSize,
+  IN VOID*ResetData
+  )
+{
+  EfiResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetData);
+}
diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf 
b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
new file mode 100644
index 

[edk2] [PATCH v2 09/10] MdeModulePkg: Add ResetSystemPei PEIM

2018-02-08 Thread Ruiyu Ni
This driver implements Reset2, ResetFilter and ResetHandler PPIs.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
---
 MdeModulePkg/MdeModulePkg.dec  |   4 +
 MdeModulePkg/MdeModulePkg.dsc  |   4 +
 MdeModulePkg/MdeModulePkg.uni  |   6 +-
 .../Universal/ResetSystemPei/ResetSystem.c | 355 +
 .../Universal/ResetSystemPei/ResetSystem.h | 129 
 .../Universal/ResetSystemPei/ResetSystemPei.inf|  62 
 .../Universal/ResetSystemPei/ResetSystemPei.uni|  20 ++
 .../ResetSystemPei/ResetSystemPeiExtra.uni |  20 ++
 8 files changed, 599 insertions(+), 1 deletion(-)
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.uni
 create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPeiExtra.uni

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index b444e38f1a..484ad3fb4d 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1422,6 +1422,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
   # @Prompt CapsuleMax value in capsule report variable.
   gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax|0x|UINT16|0x0107
 
+  ## Indicates the allowable maximum number of Reset Filters or Reset Handlers 
in PEI phase.
+  # @Prompt Maximum Number of PEI Reset Filters or Reset Handlers.
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdMaximumPeiResetNotifies|0x10|UINT32|0x0109
+
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This PCD defines the Console output row. The default value is 25 
according to UEFI spec.
   #  This PCD could be set to 0 then console output would be at max column and 
max row.
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index abac00e08f..d96bff90b0 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -361,6 +361,10 @@ [Components]
   MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
   MdeModulePkg/Universal/Metronome/Metronome.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+  MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf {
+
+  
ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
+  }
   MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
   MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
   MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.inf
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index 0e068422e4..a63d4764a3 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -4,7 +4,7 @@
 // It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and library 
classes)
 // and libraries instances, which are used for those modules.
 //
-// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+// Copyright (c) 2007 - 2018, 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 that accompanies this 
distribution.
@@ -1059,6 +1059,10 @@
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleMax_HELP  #language en-US 
"CapsuleMax value in capsule report variable."
 
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMaximumPeiResetNotifies_PROMPT  
#language en-US "Maximum Number of PEI Reset Filters or Reset Handlers."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMaximumPeiResetNotifies_HELP  
#language en-US "Indicates the allowable maximum number of Reset Filters or 
Reset Handlers in PEI phase."
+
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdRecoveryFileName_PROMPT  
#language en-US "Recover file name in PEI phase"
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdRecoveryFileName_HELP  #language 
en-US "This is recover file name in PEI phase.\n"
diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c 
b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
new file mode 100644
index 00..8d9bd4884a
--- /dev/null
+++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
@@ -0,0 +1,355 @@
+/** @file
+  Implementation of Reset2, ResetFilter and ResetHandler PPIs.
+
+  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
+  

[edk2] [PATCH v2 05/10] MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message

2018-02-08 Thread Ruiyu Ni
The patch adds more debug message in ResetSystem().
It also removes unnecessary check of mResetNotifyDepth.

Cc: Liming Gao 
Cc: Michael D Kinney 
Reviewed-by: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
---
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  | 88 +++---
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c 
b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
index fed527fac2..2c795426f5 100644
--- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
+++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
@@ -15,6 +15,10 @@
 
 #include "ResetSystem.h"
 
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = {
+  L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"
+};
+
 //
 // The current ResetSystem() notification recursion depth
 //
@@ -251,16 +255,6 @@ ResetSystem (
   LIST_ENTRY  *Link;
   RESET_NOTIFY_ENTRY  *Entry;
 
-  //
-  // Above the maximum recursion depth, so do the smallest amount of
-  // work to perform a cold reset.
-  //
-  if (mResetNotifyDepth >= MAX_RESET_NOTIFY_DEPTH) {
-ResetCold ();
-ASSERT (FALSE);
-return;
-  }
-
   //
   // Only do REPORT_STATUS_CODE() on first call to ResetSystem()
   //
@@ -272,40 +266,47 @@ ResetSystem (
   }
 
   mResetNotifyDepth++;
-  if (!EfiAtRuntime () && mResetNotifyDepth < MAX_RESET_NOTIFY_DEPTH) {
-//
-// Call reset notification functions registered through the
-// EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.
-//
-for ( Link = GetFirstNode ()
-; !IsNull (, Link)
-; Link = GetNextNode (, 
Link)
-) {
-  Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
-  Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
-}
-//
-// Call reset notification functions registered through the
-// EFI_RESET_NOTIFICATION_PROTOCOL.
-//
-for ( Link = GetFirstNode ()
-; !IsNull (, Link)
-; Link = GetNextNode (, Link)
-) {
-  Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
-  Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
-}
-//
-// call reset notification functions registered through the 
-// EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL.
-//
-for ( Link = GetFirstNode ()
-; !IsNull (, Link)
-; Link = GetNextNode (, 
Link)
-) {
-  Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
-  Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
+  DEBUG ((DEBUG_INFO, "DXE ResetSystem2: Reset call depth = %d.\n", 
mResetNotifyDepth));
+
+  if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) {
+if (!EfiAtRuntime ()) {
+  //
+  // Call reset notification functions registered through the
+  // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.
+  //
+  for ( Link = GetFirstNode ()
+  ; !IsNull (, Link)
+  ; Link = GetNextNode (, 
Link)
+  ) {
+Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
+Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
+  }
+  //
+  // Call reset notification functions registered through the
+  // EFI_RESET_NOTIFICATION_PROTOCOL.
+  //
+  for ( Link = GetFirstNode ()
+  ; !IsNull (, Link)
+  ; Link = GetNextNode (, Link)
+  ) {
+Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
+Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
+  }
+  //
+  // call reset notification functions registered through the 
+  // EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL.
+  //
+  for ( Link = GetFirstNode ()
+  ; !IsNull (, Link)
+  ; Link = GetNextNode (, 
Link)
+  ) {
+Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
+Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
+  }
 }
+  } else {
+ASSERT (ResetType < ARRAY_SIZE (mResetTypeStr));
+DEBUG ((DEBUG_ERROR, "DXE ResetSystem2: Maximum reset call depth is met. 
Use the current reset type: %s!\n", mResetTypeStr[ResetType]));
   }
 
   switch (ResetType) {
@@ -331,7 +332,6 @@ ResetSystem (
 }
 
 ResetWarm ();
-
 break;
 
  case EfiResetCold:
-- 
2.16.1.windows.1

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


[edk2] [PATCH v2 04/10] MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler

2018-02-08 Thread Ruiyu Ni
From: Michael D Kinney 

Add support for platform specific reset filters and platform
specific reset handlers to ResetSystem().  A filter may modify
the reset type and reset data and call ResetSystem() with the
modified parameters.  A handler performs the reset action.

The support for platform specific filters and platform specific
handlers is based on the Reset Notification feature added to the
UEFI 2.7 Specification.

Platform specific reset filters are processed first so the final
reset type and reset data can be determined.  In the DXE Phase
The UEFI Reset Notifications are processed second so all UEFI
Drivers that have registered for a Reset Notification can perform
any required clean up actions.  The platform specific reset
handlers are processed third.  If there are no registered
platform specific reset handlers or none of them reset the
platform, then the default reset action based on the
ResetSystemLib is performed.

In the PEI Phase, filters and handlers are registered through
the following 2 PPIs that are based on
EFI_RESET_NOTIFICATION_PROTOCOL.
* gEdkiiPlatformSpecificResetFilterPpiGuid
* gEdkiiPlatformSpecificResetHandlerPpiGuid

In the DXE Phase, filters and handlers are registered through
the following 2 Protocols that are based on
EFI_RESET_NOTIFICATION_PROTOCOL.
* gEdkiiPlatformSpecificResetFilterProtocolGuid
* gEdkiiPlatformSpecificResetHandlerProtocolGuid

Cc: Liming Gao 
Reviewed-by: Ruiyu Ni 
Reviewed-by: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
---
 .../Include/Ppi/PlatformSpecificResetFilter.h  | 31 +
 .../Include/Ppi/PlatformSpecificResetHandler.h | 29 +
 .../Include/Protocol/PlatformSpecificResetFilter.h | 31 +
 .../Protocol/PlatformSpecificResetHandler.h| 29 +
 MdeModulePkg/MdeModulePkg.dec  | 10 +++
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  | 75 --
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.h  |  7 ++
 .../ResetSystemRuntimeDxe.inf  |  7 +-
 8 files changed, 212 insertions(+), 7 deletions(-)
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetHandler.h

diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
new file mode 100644
index 00..0f1432f5f8
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
@@ -0,0 +1,31 @@
+/** @file
+  This PPI provides services to register a platform specific reset filter
+  for ResetSystem().  A reset filter evaluates the parameters passed to
+  ResetSystem() and converts a ResetType of EfiResetPlatformSpecific to a
+  non-platform specific reset type.  The registered filters are processed 
before
+  EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PPI handlers.
+
+  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 that 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.
+
+**/
+
+#ifndef _PLATFORM_SPECIFIC_RESET_FILTER_PPI_H_
+#define _PLATFORM_SPECIFIC_RESET_FILTER_PPI_H_
+
+#include 
+
+#define EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI_GUID \
+  { 0x8c9f4de3, 0x7b90, 0x47ef, { 0x93, 0x8, 0x28, 0x7c, 0xec, 0xd6, 0x6d, 
0xe8 } }
+
+typedef EFI_RESET_NOTIFICATION_PROTOCOL  
EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI;
+
+extern EFI_GUID gEdkiiPlatformSpecificResetFilterPpiGuid;
+
+#endif
diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
new file mode 100644
index 00..d5f1350c69
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
@@ -0,0 +1,29 @@
+/** @file
+  This PPI provides services to register a platform specific handler for
+  ResetSystem().  The registered handlers are processed after
+  EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications.
+
+  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 that 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" 

[edk2] [PATCH v2 07/10] MdeModulePkg: Add ResetUtility librray class and BASE instance

2018-02-08 Thread Ruiyu Ni
From: Michael D Kinney 

The library class that provides services to generate a GUID specific
reset, parse the GUID from a GUID specific reset, and build the
ResetData buffer for any type of reset that requires extra data.

Cc: Liming Gao 
Reviewed-by: Ruiyu Ni 
Reviewed-by: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
Signed-off-by: Ruiyu Ni 
---
 MdeModulePkg/Include/Library/ResetUtilityLib.h | 111 +++
 .../Library/ResetUtilityLib/ResetUtility.c | 220 +
 .../Library/ResetUtilityLib/ResetUtilityLib.inf|  40 
 MdeModulePkg/MdeModulePkg.dec  |   3 +
 MdeModulePkg/MdeModulePkg.dsc  |   3 +
 5 files changed, 377 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/ResetUtilityLib.h
 create mode 100644 MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
 create mode 100644 MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf

diff --git a/MdeModulePkg/Include/Library/ResetUtilityLib.h 
b/MdeModulePkg/Include/Library/ResetUtilityLib.h
new file mode 100644
index 00..94828785e2
--- /dev/null
+++ b/MdeModulePkg/Include/Library/ResetUtilityLib.h
@@ -0,0 +1,111 @@
+/** @file
+  This header describes various helper functions for resetting the system.
+
+  Copyright (c) 2017 Intel Corporation. All rights reserved.
+  Copyright (c) 2016 Microsoft Corporation. All rights reserved.
+
+  This program and the accompanying materials are licensed and made available 
under
+  the terms and conditions of the BSD License that 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.
+
+**/
+#ifndef _RESET_UTILITY_LIB_H_
+#define _RESET_UTILITY_LIB_H_
+
+/**
+  This is a shorthand helper function to reset with a subtype so that
+  the caller doesn't have to bother with a function that has half a dozen
+  parameters.
+
+  This will generate a reset with status EFI_SUCCESS, a NULL string, and
+  no custom data. The subtype will be formatted in such a way that it can be
+  picked up by notification registrations and custom handlers.
+
+  NOTE: This call will fail if the architectural ResetSystem underpinnings
+are not initialized. For DXE, you can add gEfiResetArchProtocolGuid
+to your DEPEX.
+
+  @param[in]  ResetType Base reset type as defined in UEFI spec.
+  @param[in]  ResetSubtype  GUID pointer for the reset subtype to be used.
+
+**/
+VOID
+EFIAPI
+ResetPlatformSpecificGuid (
+  IN CONST  GUID*ResetSubtype
+  );
+
+/**
+  This function examines the DataSize and ResetData parameters passed to
+  to ResetSystem() and detemrines if the ResetData contains a Null-terminated
+  Unicode string followed by a GUID specific subtype.  If the GUID specific 
+  subtype is present, then a pointer to the GUID value in ResetData is 
returned.
+
+  @param[in]  DataSizeThe size, in bytes, of ResetData.
+  @param[in]  ResetData   Pointer to the data buffer passed into ResetSystem().
+
+  @retval Pointer Pointer to the GUID value in ResetData.
+  @retval NULLResetData is NULL.
+  @retval NULLResetData does not start with a Null-terminated
+  Unicode string.
+  @retval NULLA Null-terminated Unicode string is present, but 
there
+  are less than sizeof (GUID) bytes after the string.
+  @retval NULLNo subtype is found.
+
+**/
+GUID *
+EFIAPI
+GetResetPlatformSpecificGuid (
+  IN UINTN   DataSize,
+  IN CONST VOID  *ResetData
+  );
+
+/**
+  This is a helper function that creates the reset data buffer that can be 
+  passed into ResetSystem().
+
+  The reset data buffer is returned in ResetData and contains ResetString
+  followed by the ResetSubtype GUID followed by the ExtraData.
+
+  NOTE: Strings are internally limited by MAX_UINT16.
+
+  @param[in, out] ResetDataSize  On input, the size of the ResetData buffer. On
+ output, either the total number of bytes
+ copied, or the required buffer size.
+  @param[in, out] ResetData  A pointer to the buffer in which to place the
+ final structure.
+  @param[in]  ResetSubtype   Pointer to the GUID specific subtype.  This
+ parameter is optional and may be NULL.
+  @param[in]  ResetStringPointer to a Null-terminated Unicode string
+ that describes the reset.  This parameter is
+ optional and may be NULL.
+  @param[in]  ExtraDataSize  

[edk2] [PATCH v2 10/10] MdeModulePkg/ResetSystemPei: Add reset notifications in PEI

2018-02-08 Thread Ruiyu Ni
From: Bret Barkelew 

The Reset Notification protocol is added in UEFI spec to support
reset notification mechanism in the DXE phase.
This patch adds similar EDKII specific Reset Notification PPI to PEI
phase to provide the same support.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bret Barkelew 
Signed-off-by: Ruiyu Ni 
---
 .../Include/Ppi/PlatformSpecificResetFilter.h  |  4 +--
 .../Include/Ppi/PlatformSpecificResetHandler.h |  4 +--
 .../Ppi/PlatformSpecificResetNotification.h| 32 ++
 MdeModulePkg/MdeModulePkg.dec  |  7 +++--
 MdeModulePkg/MdeModulePkg.uni  |  5 ++--
 .../Universal/ResetSystemPei/ResetSystem.c | 16 +++
 .../Universal/ResetSystemPei/ResetSystem.h |  1 +
 .../Universal/ResetSystemPei/ResetSystemPei.inf|  7 +++--
 8 files changed, 65 insertions(+), 11 deletions(-)
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h

diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
index 0f1432f5f8..1f728387b7 100644
--- a/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
@@ -3,9 +3,9 @@
   for ResetSystem().  A reset filter evaluates the parameters passed to
   ResetSystem() and converts a ResetType of EfiResetPlatformSpecific to a
   non-platform specific reset type.  The registered filters are processed 
before
-  EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PPI handlers.
+  EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI handlers.
 
-  Copyright (c) 2017 Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2018 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 that accompanies this 
distribution.
   The full text of the license may be found at
diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
index d5f1350c69..8d938abb02 100644
--- a/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
@@ -1,9 +1,9 @@
 /** @file
   This PPI provides services to register a platform specific handler for
   ResetSystem().  The registered handlers are processed after
-  EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications.
+  EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI notifications.
 
-  Copyright (c) 2017 Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2018 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 that accompanies this 
distribution.
   The full text of the license may be found at
diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
new file mode 100644
index 00..cf6d1f18a6
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
@@ -0,0 +1,32 @@
+/** @file
+  This PPI provides services to register a platform specific notification 
callback for
+  ResetSystem().  The registered handlers are processed after
+  EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications and before
+  EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PPI notifications.
+
+  Copyright (c) 2017 - 2018 Intel Corporation. All rights reserved.
+  Copyright (c) 2017 Microsoft Corporation. All rights reserved.
+
+  This program and the accompanying materials are licensed and made available 
under
+  the terms and conditions of the BSD License that 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.
+
+**/
+
+#ifndef _PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI_H_
+#define _PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI_H_
+
+#include 
+
+#define EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI_GUID \
+  { 0xe09f355d, 0xdae8, 0x4910, { 0xb1, 0x4a, 0x92, 0x78, 0x0f, 0xdc, 0xf7, 
0xcb } }
+
+typedef EFI_RESET_NOTIFICATION_PROTOCOL  
EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI;
+
+extern EFI_GUID gEdkiiPlatformSpecificResetNotificationPpiGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 484ad3fb4d..0695ce607e 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -447,6 +447,9 @@ [Ppis]
   ## Include/Ppi/PlatformSpecificResetFilter.h
   

[edk2] [Patch 2/2] NetworkPkg: Read TlsCipherList variable and configure it for HTTPS session.

2018-02-08 Thread Jiaxin Wu
This patch is to read the TlsCipherList variable and configure it for the
later HTTPS session.

If the variable is not set by any platform, EFI_NOT_FOUND will be returned
from GetVariable service. In such a case, the default CipherList created in
TlsDxe driver will be used.

Cc: Laszlo Ersek 
Cc: Kinney Michael D 
Cc: Zimmer Vincent 
Cc: Yao Jiewen 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/HttpDxe/HttpDriver.h   |  3 +-
 NetworkPkg/HttpDxe/HttpDxe.inf|  3 +-
 NetworkPkg/HttpDxe/HttpsSupport.c | 92 ++-
 3 files changed, 95 insertions(+), 3 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpDriver.h b/NetworkPkg/HttpDxe/HttpDriver.h
index 93a412a..eba7d32 100644
--- a/NetworkPkg/HttpDxe/HttpDriver.h
+++ b/NetworkPkg/HttpDxe/HttpDriver.h
@@ -1,9 +1,9 @@
 /** @file
   The header files of the driver binding and service binding protocol for 
HttpDxe driver.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 
   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
@@ -59,10 +59,11 @@
 // Produced Protocols
 //
 #include 
 
 #include 
+#include 
 
 #include 
 
 //
 // Driver Version
diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf b/NetworkPkg/HttpDxe/HttpDxe.inf
index 20075f5..b1d7bd2 100644
--- a/NetworkPkg/HttpDxe/HttpDxe.inf
+++ b/NetworkPkg/HttpDxe/HttpDxe.inf
@@ -1,9 +1,9 @@
 ## @file
 #  Implementation of EFI HTTP protocol interfaces.
 #
-#  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+#  Copyright (c) 2015 - 2018, 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.
@@ -72,10 +72,11 @@
   gEfiTlsProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiTlsConfigurationProtocolGuid ## SOMETIMES_CONSUMES
 
 [Guids]
   gEfiTlsCaCertificateGuid ## SOMETIMES_CONSUMES  ## 
Variable:L"TlsCaCertificate"
+  gTlsCipherListGuid   ## SOMETIMES_CONSUMES  ## 
Variable:L"TlsCipherList"
 
 [Pcd]
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections   ## CONSUMES
   gEfiNetworkPkgTokenSpaceGuid.PcdHttpsAuthenticationMode## 
SOMETIMES_CONSUMES
   gEfiNetworkPkgTokenSpaceGuid.PcdHttpsHostPublicCert## 
SOMETIMES_CONSUMES
diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c 
b/NetworkPkg/HttpDxe/HttpsSupport.c
index 288082a..62cb867 100644
--- a/NetworkPkg/HttpDxe/HttpsSupport.c
+++ b/NetworkPkg/HttpDxe/HttpsSupport.c
@@ -1,9 +1,9 @@
 /** @file
   Miscellaneous routines specific to Https for HttpDxe driver.
 
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 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
@@ -492,10 +492,91 @@ TlsConfigCertificate (
   
   return Status;
 }
 
 /**
+  Read the TlsCipherList variable and configure it for HTTPS session.
+
+  @param[in, out]  HttpInstance   The HTTP instance private data.
+
+  @retval EFI_SUCCESSThe prefered TLS CipherList is configured.
+  @retval EFI_NOT_FOUND  Fail to get 'TlsCipherList' variable.
+  @retval EFI_INVALID_PARAMETER  The contents of variable are invalid.
+  @retval EFI_OUT_OF_RESOURCES   Can't allocate memory resources.
+
+  @retval Others Other error as indicated.
+
+**/
+EFI_STATUS
+TlsConfigCipherList (
+  IN OUT HTTP_PROTOCOL  *HttpInstance
+  )
+{
+  EFI_STATUS  Status;
+  UINT8   *CipherList;
+  UINTN   CipherListSize;
+
+  CipherList = NULL;
+  CipherListSize = 0;
+
+  //
+  // Try to read the TlsCipherList variable.
+  //
+  Status  = gRT->GetVariable (
+   EDKII_TLS_CIPHER_LIST_VARIABLE,
+   ,
+   NULL,
+   ,
+   NULL
+   );
+
+  if (EFI_ERROR (Status) && Status != EFI_BUFFER_TOO_SMALL) {
+return Status;
+  }
+
+  if (CipherListSize % sizeof (EFI_TLS_CIPHER) != 0) {

[edk2] [Patch 0/2] NetworkPkg: Support the platform to configure TLS CipherList.

2018-02-08 Thread Jiaxin Wu
Cc: Laszlo Ersek 
Cc: Kinney Michael D 
Cc: Zimmer Vincent 
Cc: Yao Jiewen 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 

Jiaxin Wu (2):
  NetworkPkg: Define one private variable for TLS CipherList
configuration.
  NetworkPkg: Read TlsCipherList variable and configure it for HTTPS
session.

 NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
 NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
 NetworkPkg/HttpDxe/HttpsSupport.c   | 92 -
 NetworkPkg/Include/Guid/TlsCipherList.h | 38 ++
 NetworkPkg/NetworkPkg.dec   |  3 ++
 5 files changed, 136 insertions(+), 3 deletions(-)
 create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h

-- 
1.9.5.msysgit.1

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


[edk2] [Patch 1/2] NetworkPkg: Define one private variable for TLS CipherList configuration.

2018-02-08 Thread Jiaxin Wu
This variable can be set by any platform that want to control its own preferred
TlsCipherList for the later HTTPS session.

The valid contents of variable must follow the TLS CipherList format defined
in RFC 5246. The valid length of variable must be an integral multiple of 2.
For example, if below cipher suites are preferred:
CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C}
CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = {0x00,0x3D}
Then, the contents of variable should be:
{0x00,0x3C,0x00,0x3D}

Cc: Laszlo Ersek 
Cc: Kinney Michael D 
Cc: Zimmer Vincent 
Cc: Yao Jiewen 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/Include/Guid/TlsCipherList.h | 38 +
 NetworkPkg/NetworkPkg.dec   |  3 +++
 2 files changed, 41 insertions(+)
 create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h

diff --git a/NetworkPkg/Include/Guid/TlsCipherList.h 
b/NetworkPkg/Include/Guid/TlsCipherList.h
new file mode 100644
index 000..e31b7bf
--- /dev/null
+++ b/NetworkPkg/Include/Guid/TlsCipherList.h
@@ -0,0 +1,38 @@
+/** @file
+  This file defines the TlsCipherList variable for HTTPS to configure Tls 
Cipher List.
+
+Copyright (c) 2018, 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 that 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.
+
+**/
+
+#ifndef __TLS_CIPHER_LIST_H__
+#define __TLS_CIPHER_LIST_H__
+
+//
+// Private Variable for HTTPS to configure Tls Cipher List.
+// The valid contents of variable must follow the TLS CipherList format 
defined in RFC 5246. 
+// The valid length of variable must be an integral multiple of 2.
+// For example, if below cipher suites are preferred:
+//  CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C}
+//   CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = {0x00,0x3D}
+// Then, the contents of variable should be:
+//   {0x00,0x3C,0x00,0x3D}
+//
+#define EDKII_TLS_CIPHER_LIST_GUID \
+  { \
+0x46ddb415, 0x5244, 0x49c7, { 0x93, 0x74, 0xf0, 0xe2, 0x98, 0xe7, 0xd3, 
0x86 } \
+  }
+  
+#define EDKII_TLS_CIPHER_LIST_VARIABLE   L"TlsCipherList"
+
+extern EFI_GUID gTlsCipherListGuid;
+
+#endif
+
diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index 902df37..bdf8361 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -44,10 +44,13 @@
   gTlsAuthConfigGuid= { 0xb0eae4f8, 0x9a04, 0x4c6d, { 0xa7, 0x48, 
0x79, 0x3d, 0xaa, 0xf, 0x65, 0xdf }}
   
   # Include/Guid/TlsAuthentication.h
   gEfiTlsCaCertificateGuid  = { 0xfd2340D0, 0x3dab, 0x4349, { 0xa6, 0xc7, 
0x3b, 0x4f, 0x12, 0xb4, 0x8e, 0xae }}
 
+  # Include/Guid/TlsCipherList.h
+  gTlsCipherListGuid   = { 0x46ddb415, 0x5244, 0x49c7, { 0x93, 0x74, 0xf0, 
0xe2, 0x98, 0xe7, 0xd3, 0x86 }}
+
 [PcdsFixedAtBuild]
   ## The max attempt number will be created by iSCSI driver.
   # @Prompt Max attempt number.
   gEfiNetworkPkgTokenSpaceGuid.PcdMaxIScsiAttemptNumber|0x08|UINT8|0x000D
 
-- 
1.9.5.msysgit.1

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


Re: [edk2] [PATCH 09/10] MdeModulePkg: Add ResetSystemPei PEIM

2018-02-08 Thread Ni, Ruiyu

On 2/7/2018 8:35 PM, Zeng, Star wrote:

On 2018/2/2 14:45, Ruiyu Ni wrote:

This driver implements Reset2, ResetFilter and ResetHandler PPIs.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 


Should ResetSystemPei be added in MdeModulePkg.dsc for build coverage?


Good catch. I just found I wrongly added this module in commit:
* MdeModulePkg: Add ResetUtility librray class and BASE instance
That commit happens before this one. I might introduce this bug
when rebasing the patches.
I will change that commit and this commit to make sure ResetSystemPei
is added in this commit.



Same comment has been provided to ResetSystemRuntimeDxe.
Should be (*RecursionDepthPointer < MAX_RESET_NOTIFY_DEPTH) instead of 
(*RecursionDepthPointer <= MAX_RESET_NOTIFY_DEPTH)>


As I just replied, "<=" is the intention actually.




Thanks,
Star


---
  MdeModulePkg/MdeModulePkg.dec  |   4 +
  .../Universal/ResetSystemPei/ResetSystem.c | 355 
+

  .../Universal/ResetSystemPei/ResetSystem.h | 129 
  .../Universal/ResetSystemPei/ResetSystemPei.inf    |  62 
  .../Universal/ResetSystemPei/ResetSystemPei.uni    |  20 ++
  .../ResetSystemPei/ResetSystemPeiExtra.uni |  20 ++
  6 files changed, 590 insertions(+)
  create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
  create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
  create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf
  create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.uni
  create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPeiExtra.uni


diff --git a/MdeModulePkg/MdeModulePkg.dec 
b/MdeModulePkg/MdeModulePkg.dec

index 1cc9bc8ea1..1b971d599f 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1419,6 +1419,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
    # @Prompt CapsuleMax value in capsule report variable.
    gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax|0x|UINT16|0x0107
+  ## Indicates the allowable maximum number of Reset Filters or Reset 
Handlers in PEI phase.

+  # @Prompt Maximum Number of PEI Reset Filters or Reset Handlers.
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdMaximumPeiResetNotifies|0x10|UINT32|0x0109 


+
  [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
    ## This PCD defines the Console output row. The default value is 
25 according to UEFI spec.
    #  This PCD could be set to 0 then console output would be at max 
column and max row.
diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c 
b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c

new file mode 100644
index 00..720593de6a
--- /dev/null
+++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
@@ -0,0 +1,355 @@
+/** @file
+  Implementation of Reset2, ResetFilter and ResetHandler PPIs.
+
+  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.

+
+**/
+
+#include "ResetSystem.h"
+
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = {
+  L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"
+};
+
+EFI_PEI_RESET2_PPI mPpiReset2 = {
+  ResetSystem2
+};
+
+EFI_GUID    *mProcessingOrder[] = {
+  ,
+  
+};
+
+RESET_FILTER_INSTANCE   mResetFilter = {
+  {
+    RegisterResetNotify,
+    UnregisterResetNotify
+  },
+  
+};
+
+RESET_FILTER_INSTANCE   mResetHandler = {
+  {
+    RegisterResetNotify,
+    UnregisterResetNotify
+  },
+  
+};
+
+EFI_PEI_PPI_DESCRIPTOR mPpiListReset[] = {
+  {
+    EFI_PEI_PPI_DESCRIPTOR_PPI,
+    ,
+    
+  },
+  {
+    EFI_PEI_PPI_DESCRIPTOR_PPI,
+    ,
+    
+  },
+  {
+    EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
+    ,
+    
+  }
+};
+
+/**
+  Register a notification function to be called when ResetSystem() is 
called.

+
+  The RegisterResetNotify() function registers a notification 
function that is called when
+  ResetSystem()is called and prior to completing the reset of the 
platform.
+  The registered functions must not perform a platform reset 
themselves. These
+  notifications are intended only for the notification of components 
which may need some

+  special-purpose maintenance prior to the platform resetting.
+  The list of registered reset notification functions are processed 
if ResetSystem()is called
+  before ExitBootServices(). The list of registered reset 
notification 

[edk2] [patch 2/2] ShellPkg/DP: Update the error message info

2018-02-08 Thread Dandan Bi
Make the error message clearer if fail to get ACPI/FPDT table.

Cc: Liming Gao 
Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c   | 3 ++-
 ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c 
b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
index 4dd7dd9..aa9c2cd 100644
--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
@@ -256,18 +256,20 @@ GetBootPerformanceTable (
,

  );
   }
   if (EFI_ERROR(Status) || AcpiTable == NULL) {
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_TABLE_FAIL), 
mDpHiiHandle);
 return Status;
   }
 
   FirmwarePerformanceTable = FindAcpiPtr (
   (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER 
*)AcpiTable,
   EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_SIGNATURE
   );
   if (FirmwarePerformanceTable == NULL) {
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_FPDT_FAIL), 
mDpHiiHandle);
 return EFI_NOT_FOUND;
   }
 
   mBootPerformanceTable = (UINT8*) 
(UINTN)FirmwarePerformanceTable->BootPointerRecord.BootPerformanceTablePointer;
   mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE *) 
mBootPerformanceTable)->Header.Length;
@@ -737,11 +739,10 @@ RunDp (
   //
   //1. Get FPDT from ACPI table.
   //
   Status = GetBootPerformanceTable ();
   if (EFI_ERROR(Status)) {
-ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
(STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL), mDpHiiHandle);
 return Status;
   }
 
   //
   //2. Cache the ModuleGuid and hanlde mapping table.
diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni 
b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
index b6069ae..c7eb0fb 100644
--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni
@@ -88,11 +88,12 @@
 #string STR_DP_RAW_VARS2   #language en-US  "%5d: %16LX %16LX 
%16LX  %31a  %31a %5d\n"
 #string STR_DP_RAW_HEADR2  #language en-US  "\nIndex   Handle  
  Start Count   End Count  Token
  Module   ID\n"
 #string STR_DP_INCOMPLETE  #language en-US  " I "
 #string STR_DP_COMPLETE#language en-US  "   "
 #string STR_ALIT_UNKNOWN   #language en-US  "Unknown"
-#string STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL  #language en-US  "Fail 
to get boot performance table\n"
+#string STR_DP_GET_ACPI_TABLE_FAIL #language en-US  "Fail to get ACPI 
Table\n"
+#string STR_DP_GET_ACPI_FPDT_FAIL  #language en-US  "Fail to get Firmware 
Performance Data Table (FPDT) in ACPI Table\n"
 
 #string STR_GET_HELP_DP #language en-US ""
 ".TH dp 0 "Display performance metrics"\r\n"
 ".SH NAME\r\n"
 "Displays performance metrics that are stored in memory.\r\n"
-- 
1.9.5.msysgit.1

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


[edk2] [patch 1/2] ShellPkg/Dp: Add null pointer check

2018-02-08 Thread Dandan Bi
Cc: Liming Gao 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c 
b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
index fafc64f..4dd7dd9 100644
--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
@@ -255,11 +255,11 @@ GetBootPerformanceTable (
 Status = EfiGetSystemConfigurationTable (
,

  );
   }
-  if (EFI_ERROR(Status)) {
+  if (EFI_ERROR(Status) || AcpiTable == NULL) {
 return Status;
   }
 
   FirmwarePerformanceTable = FindAcpiPtr (
   (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER 
*)AcpiTable,
-- 
1.9.5.msysgit.1

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


Re: [edk2] [PATCH 08/10] MdePkg/UefiRuntimeLib: Support more module types.

2018-02-08 Thread Ni, Ruiyu

On 2/7/2018 8:24 PM, Zeng, Star wrote:

On 2018/2/2 14:45, Ruiyu Ni wrote:

Because DxeResetSystemLib links to this library to provide
reset system services, change UefiRuntimeLib to support
the same set of module types as what DxeResetSystemLib does.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 


Do you think it is ok or not to let DxeResetSystemLib consume 
UefiRuntimeServicesTableLib and use gRT->ResetSystem? Then this patch 
will be not needed.


RuntimeLib handles the gRT pointer conversion when entering RT phase.
DxeResetSystemLib actually can also be used by a RT driver.
Directly calling gRT->ResetSystem from DxeResetSystemLib loses the
capability.





If we still prefer to let DxeResetSystemLib consume UefiRuntimeLib, I am 
also ok. Reviewed-by: Star Zeng 


Thanks,
Star


---
  MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf 
b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf

index 8f46495fc5..d053da545a 100644
--- a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+++ b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
@@ -5,7 +5,7 @@
  #  EVT_SIGNAL_EXIT_BOOT_SERVICES event, to provide runtime services.
  # This instance also supports SAL drivers for better performance.
  #
-# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 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

@@ -24,7 +24,7 @@ [Defines]
    FILE_GUID  = b1ee6c28-54aa-4d17-b705-3e28ccb27b2e
    MODULE_TYPE    = DXE_RUNTIME_DRIVER
    VERSION_STRING = 1.0
-  LIBRARY_CLASS  = UefiRuntimeLib|DXE_RUNTIME_DRIVER 
DXE_SAL_DRIVER
+  LIBRARY_CLASS  = UefiRuntimeLib|DXE_RUNTIME_DRIVER 
DXE_SAL_DRIVER DXE_CORE DXE_DRIVER DXE_SMM_DRIVER

    CONSTRUCTOR    = RuntimeDriverLibConstruct
    DESTRUCTOR = RuntimeDriverLibDeconstruct






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


Re: [edk2] [PATCH 05/10] MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message

2018-02-08 Thread Ni, Ruiyu

On 2/7/2018 8:04 PM, Zeng, Star wrote:

On 2018/2/2 14:45, Ruiyu Ni wrote:

The patch adds more debug message in ResetSystem().
It also removes unnecessary check of mResetNotifyDepth.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
---
  .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  | 88 
+++---

  1 file changed, 44 insertions(+), 44 deletions(-)

diff --git 
a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c 
b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c

index 43400e1338..4b5af76999 100644
--- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
+++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
@@ -15,6 +15,10 @@
  #include "ResetSystem.h"
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = {
+  L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"
+};
+
  //
  // The current ResetSystem() notification recursion depth
  //
@@ -251,16 +255,6 @@ ResetSystem (
    LIST_ENTRY  *Link;
    RESET_NOTIFY_ENTRY  *Entry;
-  //
-  // Above the maximum recursion depth, so do the smallest amount of
-  // work to perform a cold reset.
-  //
-  if (mResetNotifyDepth >= MAX_RESET_NOTIFY_DEPTH) {
-    ResetCold ();
-    ASSERT (FALSE);
-    return;
-  }
-
    //
    // Only do REPORT_STATUS_CODE() on first call to ResetSystem()
    //
@@ -272,40 +266,47 @@ ResetSystem (
    }
    mResetNotifyDepth++;
-  if (!EfiAtRuntime () && mResetNotifyDepth < MAX_RESET_NOTIFY_DEPTH) {
-    //
-    // Call reset notification functions registered through the
-    // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.
-    //
-    for ( Link = GetFirstNode 
()

-    ; !IsNull (, Link)
-    ; Link = GetNextNode 
(, Link)

-    ) {
-  Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
-  Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
-    }
-    //
-    // Call reset notification functions registered through the
-    // EFI_RESET_NOTIFICATION_PROTOCOL.
-    //
-    for ( Link = GetFirstNode ()
-    ; !IsNull (, Link)
-    ; Link = GetNextNode (, Link)
-    ) {
-  Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
-  Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
-    }
-    //
-    // call reset notification functions registered through the
-    // EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PROTOCOL.
-    //
-    for ( Link = GetFirstNode 
()

-    ; !IsNull (, Link)
-    ; Link = GetNextNode 
(, Link)

-    ) {
-  Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
-  Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);
+  DEBUG ((DEBUG_INFO, "DXE ResetSystem2: Reset call depth = %d.\n", 
mResetNotifyDepth));

+
+  if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) {


Should be mResetNotifyDepth < MAX_RESET_NOTIFY_DEPTH?


No. The intention is the MAX_RESET_NOTIFY_DEPTH times of call is
permitted.



Thanks,
Star


+    if (!EfiAtRuntime ()) {
+  //
+  // Call reset notification functions registered through the
+  // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.
+  //
+  for ( Link = GetFirstNode 
()

+  ; !IsNull (, Link)
+  ; Link = GetNextNode 
(, Link)

+  ) {
+    Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
+    Entry->ResetNotify (ResetType, ResetStatus, DataSize, 
ResetData);

+  }
+  //
+  // Call reset notification functions registered through the
+  // EFI_RESET_NOTIFICATION_PROTOCOL.
+  //
+  for ( Link = GetFirstNode ()
+  ; !IsNull (, Link)
+  ; Link = GetNextNode (, Link)
+  ) {
+    Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
+    Entry->ResetNotify (ResetType, ResetStatus, DataSize, 
ResetData);

+  }
+  //
+  // call reset notification functions registered through the
+  // EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PROTOCOL.
+  //
+  for ( Link = GetFirstNode 
()

+  ; !IsNull (, Link)
+  ; Link = GetNextNode 
(, Link)

+  ) {
+    Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);
+    Entry->ResetNotify (ResetType, ResetStatus, DataSize, 
ResetData);

+  }
  }
+  } else {
+    ASSERT (ResetType < ARRAY_SIZE (mResetTypeStr));
+    DEBUG ((DEBUG_ERROR, "DXE ResetSystem2: Maximum reset call depth 
is met. Use the current reset type: %s!\n", mResetTypeStr[ResetType]));

    }
    switch (ResetType) {
@@ -331,7 +332,6 @@ ResetSystem (
  }
  ResetWarm ();
-
  break;
   case EfiResetCold:






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


Re: [edk2] [PATCH] SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it

2018-02-08 Thread Wu, Hao A
Reviewed-by: Hao Wu 

Best Regards,
Hao Wu


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Star
> Zeng
> Sent: Friday, February 09, 2018 10:45 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu; Wu, Hao A; Zeng, Star
> Subject: [edk2] [PATCH] SourceLevelDebugPkg DebugUsb3: Check
> mUsb3Instance before dereferencing it
> 
> Cc: Ruiyu Ni 
> Cc: Hao Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
>  .../Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
> | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> index 1582b9a8d6de..29cec56f39dc 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> +++
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> @@ -443,7 +443,7 @@ DebugCommunicationUsb3DxeConstructor (
>}
> 
>  Done:
> -  if (mUsb3Instance->Ready && (mUsb3Instance->PciIoEvent == 0)) {
> +  if ((mUsb3Instance != NULL) && mUsb3Instance->Ready && (mUsb3Instance-
> >PciIoEvent == 0)) {
>  Status = Usb3NamedEventListen (
> ,
> TPL_NOTIFY,
> --
> 2.7.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] SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it

2018-02-08 Thread Star Zeng
Cc: Ruiyu Ni 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 .../Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
 
b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
index 1582b9a8d6de..29cec56f39dc 100644
--- 
a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
+++ 
b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
@@ -443,7 +443,7 @@ DebugCommunicationUsb3DxeConstructor (
   }
 
 Done:
-  if (mUsb3Instance->Ready && (mUsb3Instance->PciIoEvent == 0)) {
+  if ((mUsb3Instance != NULL) && mUsb3Instance->Ready && 
(mUsb3Instance->PciIoEvent == 0)) {
 Status = Usb3NamedEventListen (
,
TPL_NOTIFY,
-- 
2.7.0.windows.1

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


Re: [edk2] [edk2-platforms][PATCH] Platform/Hisilicon/HiKey960: add skeleton of HiKey960

2018-02-08 Thread Guo Heyi
On Thu, Feb 08, 2018 at 04:02:39PM +, Ard Biesheuvel wrote:
> On 8 February 2018 at 16:01, Haojian Zhuang  wrote:
> > On 7 February 2018 at 01:29, Leif Lindholm  wrote:
> >> On Mon, Feb 05, 2018 at 04:25:52PM +0800, Haojian Zhuang wrote:
> >>> Add skeleton of HiKey960 platform.
> >>>
> >>> Contributed-under: TianoCore Contribution Agreement 1.1
> >>> Signed-off-by: Haojian Zhuang 
> >>> ---
> >>>  Platform/Hisilicon/HiKey960/HiKey960.dsc   | 457 
> >>> +
> >>>  Platform/Hisilicon/HiKey960/HiKey960.fdf   | 343 
> >>>  .../HiKey960/Library/HiKey960Lib/HiKey960.c| 144 +++
> >>>  .../HiKey960/Library/HiKey960Lib/HiKey960Helper.S  |  52 +++
> >>>  .../HiKey960/Library/HiKey960Lib/HiKey960Lib.inf   |  47 +++
> >>>  .../HiKey960/Library/HiKey960Lib/HiKey960Mem.c | 167 
> >>>  6 files changed, 1210 insertions(+)
> >>>  create mode 100644 Platform/Hisilicon/HiKey960/HiKey960.dsc
> >>>  create mode 100644 Platform/Hisilicon/HiKey960/HiKey960.fdf
> >>>  create mode 100644 
> >>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960.c
> >>>  create mode 100644 
> >>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Helper.S
> >>>  create mode 100644 
> >>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Lib.inf
> >>>  create mode 100644 
> >>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Mem.c
> >>>
> >>
> >> (I would be even happier if you could break the common parts of
> >> Hikey/Hikey960 descriptions into a common .dsc, like the d02,3,5
> >> platforms do with Silicon/Hisilicon/Hisilicon.dsc.inc.)
> >>
> >
> > Hi Leif,
> >
> > I met an issue that blocks me. Hisilicon.dsc.inc makes use of dynamic
> > PCD value on PcdPlatformBootTimeOut.
> > And this PCD value is expected to store in variable storage device. As you 
> > know,
> > we haven't enabled variable storage device on HiKey yet.
> >
> > This one makes UEFI hang on HiKey.

Hi Haojian,

Even if we don't have non-volatile variable store on Hikey, we should have some
emulated variable store, like memory emulated, which is necessary to complete
UEFI architecture, isn't it? I think dynamic PCD will never know whether the
variable store is real non-volatile or some emulated one, so I'm curious why it
hangs on HiKey.

Heyi

> >
> 
> Can't you just redeclare it as fixed in your .DSC ?
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Patch to fix EFIAPI definition

2018-02-08 Thread Ruslan Nikolaev
I submitted a bug report and a patch: 
https://bugzilla.tianocore.org/show_bug.cgi?id=870
It is very straight-forward. Can someone review it, and, hopefully, commit the 
change?
- Ruslan
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools: Update Expression.py for string comparison and MACRO replace issue

2018-02-08 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Thursday, February 08, 2018 10:46 PM
To: edk2-devel@lists.01.org
Cc: Feng, YunhuaX ; Gao, Liming 
Subject: [edk2] [PATCH] BaseTools: Update Expression.py for string comparison 
and MACRO replace issue

From: Yunhua Feng 

1. Fix string comparison incorrect issue, we expected "ABC" is greater than 
"AAD" since the second char 'B' is greater than 'A'.
2. fix MACRO not replace issue.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/Common/Expression.py   | 41 ++
 BaseTools/Source/Python/Workspace/DscBuildData.py  |  2 +-
 .../Source/Python/Workspace/MetaFileParser.py  |  1 +
 3 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py 
b/BaseTools/Source/Python/Common/Expression.py
index 6a1103df2c..a19f35d991 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -155,23 +155,13 @@ class ValueExpression(object):
 
 @staticmethod
 def Eval(Operator, Oprand1, Oprand2 = None):
 WrnExp = None
 
-if Operator not in ["in", "not in"] and (type(Oprand1) == type('') or 
type(Oprand2) == type('')):
-if type(Oprand1) == type(''):
-if Oprand1[0] in ['"', "'"] or Oprand1.startswith('L"') or 
Oprand1.startswith("L'")or Oprand1.startswith('UINT'):
-Oprand1, Size = ParseFieldValue(Oprand1)
-else:
-Oprand1,Size = ParseFieldValue('"' + Oprand1 + '"')
-if type(Oprand2) == type(''):
-if Oprand2[0] in ['"', "'"] or Oprand2.startswith('L"') or 
Oprand2.startswith("L'") or Oprand2.startswith('UINT'):
-Oprand2, Size = ParseFieldValue(Oprand2)
-else:
-Oprand2, Size = ParseFieldValue('"' + Oprand2 + '"')
-if type(Oprand1) == type('') or type(Oprand2) == type(''):
-raise BadExpression(ERR_STRING_EXPR % Operator)
+if Operator not in ["==", "!=", ">=", "<=", ">", "<", "in", "not in"] 
and \
+(type(Oprand1) == type('') or type(Oprand2) == type('')):
+raise BadExpression(ERR_STRING_EXPR % Operator)
 if Operator in ['in', 'not in']:
 if type(Oprand1) != type(''):
 Oprand1 = IntToStr(Oprand1)
 if type(Oprand2) != type(''):
 Oprand2 = IntToStr(Oprand2) @@ -294,12 +284,10 @@ class 
ValueExpression(object):
 try:
 Token = self._GetToken()
 except BadExpression:
 pass
 if type(Token) == type('') and Token.startswith('{') and 
Token.endswith('}') and self._Idx >= self._Len:
-if len(Token) != len(self._Expr.replace(' ', '')):
-raise BadExpression
 return self._Expr
 
 self._Idx = 0
 self._Token = ''
 
@@ -457,19 +445,17 @@ class ValueExpression(object):
 Flag = 0
 for Index in range(len(self._Token)):
 if self._Token[Index] in ['"']:
 Flag += 1
 if Flag == 2 and self._Token.endswith('"'):
-self._Token = ParseFieldValue(self._Token)[0]
 return True
 if self._Token.startswith("'") or self._Token.startswith("L'"):
 Flag = 0
 for Index in range(len(self._Token)):
 if self._Token[Index] in ["'"]:
 Flag += 1
 if Flag == 2 and self._Token.endswith("'"):
-self._Token = ParseFieldValue(self._Token)[0]
 return True
 try:
 self._Token = int(self._Token, Radix)
 return True
 except ValueError:
@@ -620,28 +606,20 @@ class ValueExpression(object):
 if Expr.startswith('L"'):
 # Skip L
 self._Idx += 1
 UStr = self.__GetString()
 self._Token = 'L"' + UStr + '"'
-self._Token, Size = ParseFieldValue(self._Token)
 return self._Token
 elif Expr.startswith("L'"):
 # Skip L
 self._Idx += 1
 UStr = self.__GetString()
 self._Token = "L'" + UStr + "'"
-self._Token, Size = ParseFieldValue(self._Token)
-return self._Token
-elif Expr.startswith('"'):
-UStr = self.__GetString()
-self._Token = '"' + UStr + '"'
-self._Token, Size = ParseFieldValue(self._Token)
 return self._Token
 elif 

[edk2] [PATCH v4 1/1] MdePkg/Include: Add management mode FV file type and depex.

2018-02-08 Thread Supreeth Venkatesh
As per PI specification v1.6,
As per section 2.1.4.1,
The following file types exist:
Table 3. Defined File Types
Name   Value
EFI_FV_FILETYPE_RAW0x01
EFI_FV_FILETYPE_FREEFORM   0x02
EFI_FV_FILETYPE_SECURITY_CORE  0x03
EFI_FV_FILETYPE_PEI_CORE   0x04
EFI_FV_FILETYPE_DXE_CORE   0x05
EFI_FV_FILETYPE_PEIM   0x06
EFI_FV_FILETYPE_DRIVER 0x07
EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER   0x08
EFI_FV_FILETYPE_APPLICATION0x09
EFI_FV_FILETYPE_MM 0x0A
EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE  0x0B
EFI_FV_FILETYPE_COMBINED_MM_DXE0x0C
EFI_FV_FILETYPE_MM_CORE0x0D
EFI_FV_FILETYPE_MM_STANDALONE  0x0E
EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F

The following new section type is added:
EFI_SECTION_MM_DEPEX

This patch adds the management mode FV file type and depex.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta 
Signed-off-by: Supreeth Venkatesh 
Reviewed-by: Jiewen Yao 
Reviewed-by: Liming Gao 
---
 MdePkg/Include/Pi/PiFirmwareFile.h | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/Pi/PiFirmwareFile.h 
b/MdePkg/Include/Pi/PiFirmwareFile.h
index b982c9eda3..16c007fc75 100644
--- a/MdePkg/Include/Pi/PiFirmwareFile.h
+++ b/MdePkg/Include/Pi/PiFirmwareFile.h
@@ -71,10 +71,15 @@ typedef UINT8 EFI_FFS_FILE_STATE;
 #define EFI_FV_FILETYPE_DRIVER0x07
 #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER  0x08
 #define EFI_FV_FILETYPE_APPLICATION   0x09
-#define EFI_FV_FILETYPE_SMM   0x0A
+#define EFI_FV_FILETYPE_MM0x0A
+#define EFI_FV_FILETYPE_SMM   EFI_FV_FILETYPE_MM
 #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
-#define EFI_FV_FILETYPE_COMBINED_SMM_DXE  0x0C
-#define EFI_FV_FILETYPE_SMM_CORE  0x0D
+#define EFI_FV_FILETYPE_COMBINED_MM_DXE   0x0C
+#define EFI_FV_FILETYPE_COMBINED_SMM_DXE  EFI_FV_FILETYPE_COMBINED_MM_DXE
+#define EFI_FV_FILETYPE_MM_CORE   0x0D
+#define EFI_FV_FILETYPE_SMM_CORE  EFI_FV_FILETYPE_MM_CORE
+#define EFI_FV_FILETYPE_MM_STANDALONE 0x0E
+#define EFI_FV_FILETYPE_MM_CORE_STANDALONE0x0F
 #define EFI_FV_FILETYPE_OEM_MIN   0xc0
 #define EFI_FV_FILETYPE_OEM_MAX   0xdf
 #define EFI_FV_FILETYPE_DEBUG_MIN 0xe0
@@ -217,7 +222,8 @@ typedef UINT8 EFI_SECTION_TYPE;
 #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
 #define EFI_SECTION_RAW   0x19
 #define EFI_SECTION_PEI_DEPEX 0x1B
-#define EFI_SECTION_SMM_DEPEX 0x1C
+#define EFI_SECTION_MM_DEPEX  0x1C
+#define EFI_SECTION_SMM_DEPEX EFI_SECTION_MM_DEPEX
 
 ///
 /// Common section header.
-- 
2.14.1

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


Re: [edk2] [PATCH edk2-platforms 1/3] Platform/(AMD|LeMaker|SoftIron), Silicon/AMD: drop unused PcdCacheEnabled

2018-02-08 Thread Ard Biesheuvel
On 8 February 2018 at 19:30, Leif Lindholm  wrote:
> PcdCacheEnabled was never useful for these platforms, but they copied it
> over from other platforms used as templates.
> Delete it here to keep the platforms building once the Pcd is removed
> from EmbeddedPkg.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 

For the series:
Reviewed-by: Ard Biesheuvel 

> ---
>  Platform/AMD/OverdriveBoard/OverdriveBoard.dsc  | 3 ---
>  Platform/LeMaker/CelloBoard/CelloBoard.dsc  | 3 ---
>  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 3 ---
>  Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf  | 3 ---
>  Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf   | 3 ---
>  Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c   | 6 +-
>  6 files changed, 1 insertion(+), 20 deletions(-)
>
> diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc 
> b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> index 21edcc8798..48018abc69 100644
> --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> @@ -282,9 +282,6 @@ 
> [BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,Buil
>  
> 
>
>  [PcdsFeatureFlag.common]
> -  # All pages are cached by default
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
> -
># Use the Vector Table location in CpuDxe. We will not copy the Vector 
> Table at PcdCpuVectorBaseAddress
>gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
>
> diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc 
> b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> index cf3df86514..2468583c0d 100644
> --- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> +++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> @@ -270,9 +270,6 @@ 
> [BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,Buil
>  
> 
>
>  [PcdsFeatureFlag.common]
> -  # All pages are cached by default
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
> -
># Use the Vector Table location in CpuDxe. We will not copy the Vector 
> Table at PcdCpuVectorBaseAddress
>gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
>
> diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc 
> b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> index 0abec8120a..f0a7e97941 100644
> --- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> +++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> @@ -272,9 +272,6 @@ [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
>  
> 
>
>  [PcdsFeatureFlag.common]
> -  # All pages are cached by default
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
> -
># Use the Vector Table location in CpuDxe. We will not copy the Vector 
> Table at PcdCpuVectorBaseAddress
>gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
>
> diff --git a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf 
> b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf
> index 6b7481ec6d..3a38f294eb 100644
> --- a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf
> +++ b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf
> @@ -53,9 +53,6 @@ [Guids]
>  [Ppis]
>gArmMpCoreInfoPpiGuid
>
> -[FeaturePcd]
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable
> -
>  [Pcd]
>gArmTokenSpaceGuid.PcdSystemMemoryBase
>gArmTokenSpaceGuid.PcdSystemMemorySize
> diff --git a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf 
> b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf
> index b313d4baad..b24ffd469a 100644
> --- a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf
> +++ b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf
> @@ -49,9 +49,6 @@ [Sources.AARCH64]
>  [Guids]
>gAmdStyxMpCoreInfoGuid   ## CONSUMER
>
> -[FeaturePcd]
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable
> -
>  [Ppis]
>gArmMpCoreInfoPpiGuid
>
> diff --git a/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c 
> b/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c
> index 3b82132d08..479a40627d 100644
> --- a/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c
> +++ b/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c
> @@ -78,11 +78,7 @@ ArmPlatformGetVirtualMemoryMap (
>return;
>}
>
> -  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
> -  CacheAttributes = DDR_ATTRIBUTES_CACHED;
> -  } else {
> -  CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
> -  }
> +  CacheAttributes = DDR_ATTRIBUTES_CACHED;
>
>DEBUG ((EFI_D_ERROR, " Memory 
> Map\n\n"));
>DEBUG ((EFI_D_ERROR, "Description:START   
> -END [   

[edk2] [PATCH edk2-platforms 2/3] Platform/ARM: drop use of PcdCacheEnabled

2018-02-08 Thread Leif Lindholm
PcdCacheEnabled does nothing useful for these platforms.

Delete all uses of it here to keep the platforms building once the Pcd is
removed from EmbeddedPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf  | 3 ---
 Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c| 6 +-
 .../VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf   | 3 ---
 .../ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c| 6 +-
 .../ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf   | 3 ---
 .../VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf| 3 ---
 Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c   | 4 +---
 7 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf 
b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
index 2dd384daba..d3fc9b6cc7 100644
--- a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
@@ -43,9 +43,6 @@ [Sources.AARCH64]
 [Sources.ARM]
   Arm/ArmJunoHelper.S | GCC
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c 
b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c
index aa8d7d9c3b..2d9c2c95a8 100644
--- a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c
+++ b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c
@@ -72,11 +72,7 @@ ArmPlatformGetVirtualMemoryMap (
   return;
   }
 
-  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
-  CacheAttributes = DDR_ATTRIBUTES_CACHED;
-  } else {
-  CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
-  }
+  CacheAttributes = DDR_ATTRIBUTES_CACHED;
 
   // SMB CS0 - NOR0 Flash
   VirtualMemoryTable[Index].PhysicalBase= ARM_VE_SMB_NOR0_BASE;
diff --git 
a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
index 9e81b1c1cc..329f80dcfe 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
@@ -40,9 +40,6 @@ [Sources.common]
   CTA15-A7Helper.asm | RVCT
   CTA15-A7Helper.S   | GCC
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmPlatformTokenSpaceGuid.PcdCoreCount
 
diff --git 
a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c
index 4403cbacb8..05e9abc572 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c
@@ -53,11 +53,7 @@ ArmPlatformGetVirtualMemoryMap (
 return;
   }
 
-  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
-CacheAttributes = DDR_ATTRIBUTES_CACHED;
-  } else {
-CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
-  }
+  CacheAttributes = DDR_ATTRIBUTES_CACHED;
 
 #ifdef ARM_BIGLITTLE_TC2
   // Secure NOR0 Flash
diff --git 
a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
index 4cbd2ff4b4..8c6291c42f 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
@@ -45,9 +45,6 @@ [Sources.ARM]
 [Sources.AARCH64]
   AArch64/RTSMHelper.S
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git 
a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
index 269760f8ba..2287756cf8 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
@@ -41,9 +41,6 @@ [Sources.ARM]
 [Sources.AARCH64]
   AArch64/RTSMHelper.S
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
index 6379e81751..9fb0803d31 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c
@@ -90,9 +90,7 @@ ArmPlatformGetVirtualMemoryMap (
 return;
   }
 
-  CacheAttributes = (FeaturePcdGet(PcdCacheEnable))
-? DDR_ATTRIBUTES_CACHED
-: DDR_ATTRIBUTES_UNCACHED;

[edk2] [PATCH edk2-platforms 3/3] (Platform/Silicon)/Hisilicon: drop use of PcdCacheEnabled

2018-02-08 Thread Leif Lindholm
PcdCacheEnabled was never useful for these platforms, but it was
copied over from other platforms used as templates.

Delete it here to keep the platforms building once the Pcd is removed
from EmbeddedPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf  | 3 ---
 Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c| 6 +-
 .../Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf| 3 ---
 .../Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibMem.c   | 6 +-
 .../Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf | 3 ---
 5 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf 
b/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf
index 79723d3b17..6a47a4501e 100644
--- a/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf
+++ b/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyLib.inf
@@ -41,9 +41,6 @@ [Sources.common]
 [Sources.AARCH64]
   HiKeyHelper.S
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdArmPrimaryCore
   gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
diff --git a/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c 
b/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c
index c388a7a5ab..0f6ad89a02 100644
--- a/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c
+++ b/Platform/Hisilicon/HiKey/Library/HiKeyLib/HiKeyMem.c
@@ -164,11 +164,7 @@ ArmPlatformGetVirtualMemoryMap (
 return;
   }
 
-  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
-CacheAttributes = DDR_ATTRIBUTES_CACHED;
-  } else {
-CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
-  }
+  CacheAttributes = DDR_ATTRIBUTES_CACHED;
 
   Index = 0;
 
diff --git 
a/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf 
b/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf
index 0a3a6c1bb7..706497584e 100644
--- a/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf
+++ b/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf
@@ -45,9 +45,6 @@ [Sources.common]
 [Sources.AARCH64]
   AArch64/Helper.S
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git 
a/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibMem.c 
b/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibMem.c
index b7bc75dc74..c5a745a44b 100644
--- a/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibMem.c
+++ b/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibMem.c
@@ -58,11 +58,7 @@ ArmPlatformGetVirtualMemoryMap (
   return;
   }
 
-  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
-  CacheAttributes = DDR_ATTRIBUTES_CACHED;
-  } else {
-  CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
-  }
+  CacheAttributes = DDR_ATTRIBUTES_CACHED;
 
   Index = OemSetVirtualMapDesc(VirtualMemoryTable, CacheAttributes);
 
diff --git 
a/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf 
b/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
index 23eca287fe..b31ea41f51 100644
--- a/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
+++ b/Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
@@ -41,9 +41,6 @@ [Sources.common]
 [Sources.AARCH64]
   AArch64/Helper.S
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
-- 
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/3] Platform/(AMD|LeMaker|SoftIron), Silicon/AMD: drop unused PcdCacheEnabled

2018-02-08 Thread Leif Lindholm
PcdCacheEnabled was never useful for these platforms, but they copied it
over from other platforms used as templates.
Delete it here to keep the platforms building once the Pcd is removed
from EmbeddedPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 Platform/AMD/OverdriveBoard/OverdriveBoard.dsc  | 3 ---
 Platform/LeMaker/CelloBoard/CelloBoard.dsc  | 3 ---
 Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 3 ---
 Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf  | 3 ---
 Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf   | 3 ---
 Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c   | 6 +-
 6 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc 
b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
index 21edcc8798..48018abc69 100644
--- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
+++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
@@ -282,9 +282,6 @@ 
[BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,Buil
 

 
 [PcdsFeatureFlag.common]
-  # All pages are cached by default
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
-
   # Use the Vector Table location in CpuDxe. We will not copy the Vector Table 
at PcdCpuVectorBaseAddress
   gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
 
diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc 
b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
index cf3df86514..2468583c0d 100644
--- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
+++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
@@ -270,9 +270,6 @@ 
[BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,Buil
 

 
 [PcdsFeatureFlag.common]
-  # All pages are cached by default
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
-
   # Use the Vector Table location in CpuDxe. We will not copy the Vector Table 
at PcdCpuVectorBaseAddress
   gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
 
diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc 
b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
index 0abec8120a..f0a7e97941 100644
--- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
+++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
@@ -272,9 +272,6 @@ [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
 

 
 [PcdsFeatureFlag.common]
-  # All pages are cached by default
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
-
   # Use the Vector Table location in CpuDxe. We will not copy the Vector Table 
at PcdCpuVectorBaseAddress
   gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
 
diff --git a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf 
b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf
index 6b7481ec6d..3a38f294eb 100644
--- a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf
+++ b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLib.inf
@@ -53,9 +53,6 @@ [Guids]
 [Ppis]
   gArmMpCoreInfoPpiGuid
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [Pcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf 
b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf
index b313d4baad..b24ffd469a 100644
--- a/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf
+++ b/Silicon/AMD/Styx/Library/AmdStyxLib/AmdStyxLibSec.inf
@@ -49,9 +49,6 @@ [Sources.AARCH64]
 [Guids]
   gAmdStyxMpCoreInfoGuid   ## CONSUMER
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [Ppis]
   gArmMpCoreInfoPpiGuid
 
diff --git a/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c 
b/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c
index 3b82132d08..479a40627d 100644
--- a/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c
+++ b/Silicon/AMD/Styx/Library/AmdStyxLib/StyxMem.c
@@ -78,11 +78,7 @@ ArmPlatformGetVirtualMemoryMap (
   return;
   }
 
-  if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
-  CacheAttributes = DDR_ATTRIBUTES_CACHED;
-  } else {
-  CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
-  }
+  CacheAttributes = DDR_ATTRIBUTES_CACHED;
 
   DEBUG ((EFI_D_ERROR, " Memory 
Map\n\n"));
   DEBUG ((EFI_D_ERROR, "Description:START   -  
  END [SIZE]{  ATTR 
}\n"));
-- 
2.11.0

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


Re: [edk2] [PATCH 1/2] BeagleBoardPkg: drop unused PcdCacheEnabled dependency

2018-02-08 Thread Ard Biesheuvel
On 8 February 2018 at 19:19, Leif Lindholm  wrote:
> Commit f72df138 got rid of the use of PcdCacheEnabled, but failed to
> actually drop it as a dependency for BeagleBoardLib.
>
> Get rid of it, so the module will still build when the Pcd is _really_
> removed.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 

For the series:
Reviewed-by: Ard Biesheuvel 

> ---
>  BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf 
> b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> index e004d6f10b..3b62f3cbf7 100644
> --- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> +++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> @@ -44,9 +44,6 @@ [Sources.common]
>BeagleBoardHelper.S| GCC
>BeagleBoardHelper.asm  | RVCT
>
> -[FeaturePcd]
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable
> -
>  [FixedPcd]
>gArmTokenSpaceGuid.PcdFdBaseAddress
>gArmTokenSpaceGuid.PcdFdSize
> --
> 2.11.0
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 2/2] EmbeddedPkg: _really_ delete PcdCacheEnable from .dec

2018-02-08 Thread Leif Lindholm
Commit e537d878 meant to, but failed to, remove PcdCacheEnable.
Address this, and get rid of this obsolete flag.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 EmbeddedPkg/EmbeddedPkg.dec | 1 -
 1 file changed, 1 deletion(-)

diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index 7cb04d61b1..e48ce2e95b 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -86,7 +86,6 @@ [Ppis]
 
 [PcdsFeatureFlag.common]
   
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|FALSE|BOOLEAN|0x001b
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable|FALSE|BOOLEAN|0x0042
   gEmbeddedTokenSpaceGuid.PcdGdbSerial|FALSE|BOOLEAN|0x0053
 
   
gEmbeddedTokenSpaceGuid.PcdSataSiI3132FeaturePMPSupport|FALSE|BOOLEAN|0x0050
-- 
2.11.0

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


[edk2] [PATCH 1/2] BeagleBoardPkg: drop unused PcdCacheEnabled dependency

2018-02-08 Thread Leif Lindholm
Commit f72df138 got rid of the use of PcdCacheEnabled, but failed to
actually drop it as a dependency for BeagleBoardLib.

Get rid of it, so the module will still build when the Pcd is _really_
removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf 
b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
index e004d6f10b..3b62f3cbf7 100644
--- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
+++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
@@ -44,9 +44,6 @@ [Sources.common]
   BeagleBoardHelper.S| GCC
   BeagleBoardHelper.asm  | RVCT
 
-[FeaturePcd]
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable
-
 [FixedPcd]
   gArmTokenSpaceGuid.PcdFdBaseAddress
   gArmTokenSpaceGuid.PcdFdSize
-- 
2.11.0

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


Re: [edk2] [PATCH] CorebootPayloadPkg: Use correct BytesPerScanLine

2018-02-08 Thread Arthur Heymans
"You, Benjamin"  writes:

> Hi Arthur,
>
> I agree with your suggestion that Payload interpret BytesPerScanLine and 
> Horizontal Resolution properly such that a 1366 display can be handled well.
>
> The functioning will depend on Coreboot interpreting properly too. However
> fixing the Payload will not cause any regression anyway.
>

This is coreboot's interface of telling payloads how the framebuffer was
set up, for the payload to reuse it. The internal implementations in
coreboot really shouldn't matter for payloads. The payload should assume
it is sane.

> I am still not very clear about some cases in Coreboot as below:
>
>> -Original Message-
>> From: Arthur Heymans [mailto:art...@aheymans.xyz]
>> Sent: Friday, January 26, 2018 5:09 PM
>> To: You, Benjamin 
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] [PATCH] CorebootPayloadPkg: Use correct BytesPerScanLine
>> 
>> "You, Benjamin"  writes:
>> 
>> >
>> > I noticed in coreboot-4.7\src\include\edid.h, there are following comments:
>> >
>> > /* 3 variables needed for coreboot framebuffer.
>> > * In most cases, they are the same as the ha
>> > * and va variables, but not always, as in the
>> > * case of a 1366 wide display.
>> > */
>> >u32 x_resolution;
>> >u32 y_resolution;
>> >u32 bytes_per_line;
>> >
>> > And in coreboot-4.7\src\lib\edid.c:
>> >
>> >edid->bytes_per_line = ALIGN_UP(edid->mode.ha *
>> >div_round_up(fb_bpp, 8), row_byte_alignment);
>> >edid->x_resolution = edid->bytes_per_line / (fb_bpp / 8);
>> >
>> 
>> This is how x_resolution initially gets set after the EDID is read, but
>> it is further modified to satisfy the display controllers needs,
>> e.g. src/northbridge/intel/gm45/gma.c:
>> 
>> edid->bytes_per_line = (edid->bytes_per_line + 63) & ~63;
>
> This line does not change the value of edid->bytes_per_line since it is 
> already rounded up to 64 by previous calculation in edid.c:
>
>   edid->bytes_per_line = ALIGN_UP(edid->mode.ha *
>   div_round_up(fb_bpp, 8), row_byte_alignment);
>

Could be, but that doesn't really matter for this patch. What is
important is that coreboot has an interface for bytes_per_line for the
framebuffer and that it is the payloads job to use that interface.

>> 
>> before it gets send to code that sets up the coreboot tables from which
>> payloads extract this information:
>> 
>> set_vbe_mode_info_valid(edid, lfb);
>> 
>> There are also other code paths that don't use src/lib/edid.c to set up
>> the framebuffer.
>> 
>> In src/drivers/intel/gma/hires_fb/gma.adb we have:
>> x_resolution => word32 (fb.Width),
>> y_resolution => word32 (fb.Height),
>> bytes_per_line   => 4 * word32 (fb.Stride),
>>
> From the same file, I found:
> Stride  => ((Width_Type (min_h) + 63) / 64) * 64
> 
> This line seems to expand Stride to 64 alignment in the unit of Pixel, not
> Byte. I thought line padding is on 64 byte alignment, not on 64 pixel 
> alignment.
>

"bytes_per_line   => 4 * word32 (fb.Stride)", changes it from pixel to
bytes (32bits per pixel). That Stride is the maximum stride btw. What it
ends up being is something else that depends on the internal of that
library.

>> >> >> -Original Message-
>> >> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> >> >> art...@aheymans.xyz
>> >> >> Sent: Wednesday, January 24, 2018 6:58 PM
>> >> >> To: edk2-devel@lists.01.org
>> >> >> Cc: Arthur Heymans 
>> >> >> Subject: [edk2] [PATCH] CorebootPayloadPkg: Use correct
>> BytesPerScanLine
>> >> >>
>> >> >> From: Arthur Heymans 
>> >> >>
>> >> >> Fetch BytesPerScanLine from coreboot table to reflect how the actual
>> >> >> framebuffer is set up instead of guessing it from the horizontal
>> >> >> resolution.
>> >> >>
>> >> >> This fixes a garbled display when HorizontalResolution * (BitsPerPixel
>> >> >> / 8) and pFbInfo->BytesPerScanLine don't match.
>> >> >>
>> >> >> Contributed-under: TianoCore Contribution Agreement 1.1
>> >> >> Signed-off-by: Arthur Heymans 
>> >> >>
>> >> >> diff --git a/CorebootPayloadPkg/FbGop/FbGop.c
>> >> >> b/CorebootPayloadPkg/FbGop/FbGop.c
>> >> >> index 37d6def7f7..6790617033 100644
>> >> >> --- a/CorebootPayloadPkg/FbGop/FbGop.c
>> >> >> +++ b/CorebootPayloadPkg/FbGop/FbGop.c
>> >> >> @@ -822,7 +822,7 @@ FbGopCheckForVbe (
>> >> >>BitsPerPixel = pFbInfo->BitsPerPixel;
>> >> >>HorizontalResolution = pFbInfo->HorizontalResolution;
>> >> >>VerticalResolution   = pFbInfo->VerticalResolution;
>> >> >> -  BytesPerScanLine = HorizontalResolution * (BitsPerPixel / 8);
>> >> >> +  BytesPerScanLine = pFbInfo->BytesPerScanLine;
>> >> >>
>> >> >>ModeBuffer = (FB_VIDEO_MODE_DATA *) AllocatePool (
>> >> >>
>> >> >>
>> >> >>ModeNumber * sizeof
>> 

[edk2] Poll: When to use OVMF and Nt32?

2018-02-08 Thread Palmer, Thomas

EDK2 community,

When developing/testing UEFI and you can easily choose between 
using OVMF and Nt32, which do you choose and why?  When is OVMF better/easier 
to use than Nt32 and vice versa?

I ask because I am giving an internal presentation to our newer 
employees.  I've used one over the other for personal reasons, but I'd like to 
hear your thoughts and learn something new.


Regards,

Thomas Palmer
Firmware Engineer
Enterprise Group
Industry Standard Servers

thomas.pal...@hpe.com
T +1 281 518 2564
Hewlett Packard Enterprise
11445 Compaq Center Drive West
Houston, TX 77070-1433
USA

[cid:image001.jpg@01D1CF0D.54B64190]

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


Re: [edk2] [PATCH edk2-platforms] Silicon/SynQuacer/DeviceTree: remove SCPI/MHU nodes

2018-02-08 Thread Ard Biesheuvel
On 8 February 2018 at 16:17, Leif Lindholm  wrote:
> On Thu, Feb 08, 2018 at 02:57:51PM +, Ard Biesheuvel wrote:
>> On our SynQuacer based platform, power state handling and other
>> low-level duties are handled by the secure firmware, not by the
>> OS, so remove the various MHU/SCPI related nodes from the device
>> tree.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel 
>
> Ah, yes please.
> Reviewed-by: Leif Lindholm 

Pushed as 69f992e8543128df4e40ae6d7418e6dab8b6a8fa

Thanks.

>
>> ---
>>  Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi | 30 
>> 
>>  1 file changed, 30 deletions(-)
>>
>> diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi 
>> b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
>> index 3db3c5ed1c50..a113780c2ab8 100644
>> --- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
>> +++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
>> @@ -388,36 +388,6 @@
>>  method = "smc";
>>  };
>>
>> -mailbox: mhu@4500 {
>> -compatible = "arm,mhu", "arm,primecell";
>> -reg = <0x0 0x4500 0x0 0x1000>;
>> -interrupts = ,
>> - ; /* Non-Sec */
>> -interrupt-names = "mhu_lpri_rx", "mhu_hpri_rx";
>> -#mbox-cells = <1>;
>> -clocks = <_apb>;
>> -clock-names = "apb_pclk";
>> -};
>> -
>> -sram: sram@4520 {
>> -compatible = "mmio-sram";
>> -reg = <0x0 0x4520 0x0 0x200>;
>> -
>> -#address-cells = <1>;
>> -#size-cells = <1>;
>> -ranges = <0 0x0 0x4520 0x200>;
>> -
>> -cpu_scp_hpri: scp-shmem@0 {
>> -  reg = <0x0 0x200>;
>> -};
>> -};
>> -
>> -scpi {
>> -compatible = "arm,scpi";
>> -mboxes = < 1>;
>> -shmem = <_scp_hpri>;
>> -};
>> -
>>  clk_uart: refclk62500khz {
>>  compatible = "fixed-clock";
>>  #clock-cells = <0>;
>> --
>> 2.11.0
>>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms 1/3] Platform/ARM: drop unused EmbeddedPkg Pcds

2018-02-08 Thread Ard Biesheuvel
On 8 February 2018 at 17:45, Leif Lindholm  wrote:
> On Thu, Feb 08, 2018 at 03:08:19PM +, Alexei Fedorov wrote:
>> This patch causes Juno and other ARM platforms to raise an assert during MMU 
>> initialisation in ArmConfigureMmu()
>
> Huh...
>
>> (edk2\ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuLibCore.c):
>>
>>
>>   ASSERT (TranslationTableAttribute == 
>> ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK ||
>>   TranslationTableAttribute == 
>> ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK);
>>
>>
>> see debug output:
>>
>> UEFI firmware (version  built at 12:01:21 on Feb  8 2018)
>> add-symbol-file 
>> n:\edk2\Build\ArmJuno\DEBUG_GCC5\AARCH64\ArmPlatformPkg\PrePi\PeiUniCore\DEBUG\ArmPlatformPrePiUniCore.dll
>>  0xE800
>> ASSERT [ArmPlatformPrePiUniCore] 
>> n:\edk2\ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuLibCore.c(744): 
>> TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK || 
>> TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK
>>
>> because removal of
>> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
>> from ArmVExpress.dsc.inc now makes ArmPlatformGetVirtualMemoryMap () 
>> function in
>> \edk2-platforms\Platform\ARM\JunoPkg\Library\ArmJunoLib\ArmJunoMem.c
>>
>> use default FALSE value defined in EmbeddedPkg.dec:
>>
>>
>> [PcdsFeatureFlag.common]
>>   gEmbeddedTokenSpaceGuid.PcdCacheEnable|FALSE|BOOLEAN|0x0042
>>
>>
>> & set CacheAttributes to DDR_ATTRIBUTES_UNCACHED:
>>
>> if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
>> CacheAttributes = DDR_ATTRIBUTES_CACHED;
>>   } else {
>> CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
>>   }
>
> So. I spent a while scratching my head here over how i didn't spot
> this when I did my final test build before generating the patches.
>
> Turns out, somewhere amongst my rebasing,
> gEmbeddedTokenSpaceGuid.PcdCacheEnable managed to reintroduce itself
> into EmbeddedPkg.dec (I explicitly deleted it).
>
> Since I _knew_ I'd deleted it, and all the platforms still built, I
> didn't bother grepping for it through all of edk2-platforms.
>
> Ho hum.
>
> Well, the fix is trivial - just excise it from all platforms, and turn
> all conditional statements into the unconditional execution of the
> TRUE path. There is no code in public trees that actually does
> anything different initialisation-wise depending on the value of this
> Pcd.
>
> Scream if you disagree.
>

My vote would be to get rid of it entirely. These days, uncached means
non-coherent, which breaks all sorts of assumptions in UEFI itself but
also in Trusted Firmware.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms 1/3] Platform/ARM: drop unused EmbeddedPkg Pcds

2018-02-08 Thread Leif Lindholm
On Thu, Feb 08, 2018 at 03:08:19PM +, Alexei Fedorov wrote:
> This patch causes Juno and other ARM platforms to raise an assert during MMU 
> initialisation in ArmConfigureMmu()

Huh...

> (edk2\ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuLibCore.c):
> 
> 
>   ASSERT (TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK 
> ||
>   TranslationTableAttribute == 
> ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK);
> 
> 
> see debug output:
>
> UEFI firmware (version  built at 12:01:21 on Feb  8 2018)
> add-symbol-file 
> n:\edk2\Build\ArmJuno\DEBUG_GCC5\AARCH64\ArmPlatformPkg\PrePi\PeiUniCore\DEBUG\ArmPlatformPrePiUniCore.dll
>  0xE800
> ASSERT [ArmPlatformPrePiUniCore] 
> n:\edk2\ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuLibCore.c(744): 
> TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK || 
> TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK
> 
> because removal of
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
> from ArmVExpress.dsc.inc now makes ArmPlatformGetVirtualMemoryMap () function 
> in
> \edk2-platforms\Platform\ARM\JunoPkg\Library\ArmJunoLib\ArmJunoMem.c
> 
> use default FALSE value defined in EmbeddedPkg.dec:
> 
> 
> [PcdsFeatureFlag.common]
>   gEmbeddedTokenSpaceGuid.PcdCacheEnable|FALSE|BOOLEAN|0x0042
> 
> 
> & set CacheAttributes to DDR_ATTRIBUTES_UNCACHED:
> 
> if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
> CacheAttributes = DDR_ATTRIBUTES_CACHED;
>   } else {
> CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
>   }

So. I spent a while scratching my head here over how i didn't spot
this when I did my final test build before generating the patches.

Turns out, somewhere amongst my rebasing,
gEmbeddedTokenSpaceGuid.PcdCacheEnable managed to reintroduce itself
into EmbeddedPkg.dec (I explicitly deleted it).

Since I _knew_ I'd deleted it, and all the platforms still built, I
didn't bother grepping for it through all of edk2-platforms.

Ho hum.

Well, the fix is trivial - just excise it from all platforms, and turn
all conditional statements into the unconditional execution of the
TRUE path. There is no code in public trees that actually does
anything different initialisation-wise depending on the value of this
Pcd.

Scream if you disagree.

> Thank you for your cooperation.

Thanks for reporting!

/
Leif

> Alexei.
> 
> 
> From: edk2-devel  on behalf of Leif Lindholm 
> 
> Sent: 06 February 2018 17:12
> To: edk2-devel@lists.01.org
> Cc: ard.biesheu...@linaro.org
> Subject: [edk2] [PATCH edk2-platforms 1/3] Platform/ARM: drop unused 
> EmbeddedPkg Pcds
> 
> A set of mostly Ebl-related Pcds are about to be deleted from
> edk2. Delete references to them here to keep platforms building.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 
> ---
>  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 18 --
>  1 file changed, 18 deletions(-)
> 
> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc 
> b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> index 717f7332c9..b026ce3a42 100644
> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> @@ -257,20 +257,6 @@ [PcdsFeatureFlag.common]
>gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
>gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
> 
> -  #
> -  # Control what commands are supported from the UI
> -  # Turn these on and off to add features or save size
> -  #
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedHwDebugCmd|TRUE
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedPciDebugCmd|TRUE
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedIoEnable|FALSE
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE
> -
> -  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
> -
># Use the Vector Table location in CpuDxe. We will not copy the Vector 
> Table at PcdCpuVectorBaseAddress
>gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
> 
> @@ -333,10 +319,6 @@ [PcdsFixedAtBuild.common]
> 
>gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
> 
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07
> -  gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x1
> -
>#
># Optional feature to help prevent EFI memory map fragments
># Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob
> --
> 2.11.0
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> 

Re: [edk2] [PATCH v2 0/2] sync some function definitions with their declarations

2018-02-08 Thread Laszlo Ersek
On 02/08/18 16:14, Carsey, Jaben wrote:
> Reviewed-by: Jaben Carsey 

Thank you all; series pushed as commit range de8373fa07f8..c0d221a34854.

Laszlo

>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> Laszlo Ersek
>> Sent: Wednesday, February 07, 2018 2:45 PM
>> To: edk2-devel@lists.01.org
>> Cc: Ni, Ruiyu ; Brijesh Singh ;
>> Ard Biesheuvel ; Justen, Jordan L
>> ; Gary Lin ; Carsey, Jaben
>> 
>> Subject: [edk2] [PATCH v2 0/2] sync some function definitions with their
>> declarations
>> Importance: High
>>
>> Repo:   https://github.com/lersek/edk2.git
>> Branch: sync_defs_to_decls_v2
>>
>> This is version 2 of the series that I posted earlier. Because that
>> series didn't reach the list at all, due to SMTP issues on my end, I'm
>> including the v1 blurb here:
>>
>>> The patches say it all, just a side remark up here:
>>>
>>> These errors would have been caught long ago if we had enabled the
>>> "-Wmissing-prototypes" gcc option.
>>>
>>> (Unfortunately, we can't enable that option even now, because it --
>>> laudably -- forces the programmer to give internal linkage ("STATIC")
>>> to their helper / local functions, and -- as we've learned -- some
>>> versions of the the Visual Studio debugger choke on STATIC functions.
>>> Thus, core modules basically never make their internal functions
>>> STATIC.)
>>
>> The v2 changes are noted per patch.
>>
>> (This posting should hopefully reach the list; while the original SMTP
>> issue remains undiagnosed, I attempted to put a work-around in place.
>> Let's see if it works.)
>>
>> Cc: Ard Biesheuvel 
>> Cc: Brijesh Singh 
>> Cc: Gary Lin 
>> Cc: Jaben Carsey 
>> Cc: Jordan Justen 
>> Cc: Ruiyu Ni 
>>
>> Thanks,
>> Laszlo
>>
>> Laszlo Ersek (2):
>>   ShellPkg/UefiShellDebug1CommandsLib: sync Compress() definition with
>> decl.
>>   OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with
>> declaration
>>
>>  OvmfPkg/PlatformPei/AmdSev.c   |  3 ++-
>>  ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 14
>> --
>>  ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h |  1 -
>>  3 files changed, 10 insertions(+), 8 deletions(-)
>>
>> --
>> 2.14.1.3.gb7cf6e02401b
>>
>> ___
>> 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


Re: [edk2] [PATCH edk2-platforms] Silicon/SynQuacer/DeviceTree: remove SCPI/MHU nodes

2018-02-08 Thread Leif Lindholm
On Thu, Feb 08, 2018 at 02:57:51PM +, Ard Biesheuvel wrote:
> On our SynQuacer based platform, power state handling and other
> low-level duties are handled by the secure firmware, not by the
> OS, so remove the various MHU/SCPI related nodes from the device
> tree.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 

Ah, yes please.
Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi | 30 
> 
>  1 file changed, 30 deletions(-)
> 
> diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi 
> b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
> index 3db3c5ed1c50..a113780c2ab8 100644
> --- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
> +++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
> @@ -388,36 +388,6 @@
>  method = "smc";
>  };
>  
> -mailbox: mhu@4500 {
> -compatible = "arm,mhu", "arm,primecell";
> -reg = <0x0 0x4500 0x0 0x1000>;
> -interrupts = ,
> - ; /* Non-Sec */
> -interrupt-names = "mhu_lpri_rx", "mhu_hpri_rx";
> -#mbox-cells = <1>;
> -clocks = <_apb>;
> -clock-names = "apb_pclk";
> -};
> -
> -sram: sram@4520 {
> -compatible = "mmio-sram";
> -reg = <0x0 0x4520 0x0 0x200>;
> -
> -#address-cells = <1>;
> -#size-cells = <1>;
> -ranges = <0 0x0 0x4520 0x200>;
> -
> -cpu_scp_hpri: scp-shmem@0 {
> -  reg = <0x0 0x200>;
> -};
> -};
> -
> -scpi {
> -compatible = "arm,scpi";
> -mboxes = < 1>;
> -shmem = <_scp_hpri>;
> -};
> -
>  clk_uart: refclk62500khz {
>  compatible = "fixed-clock";
>  #clock-cells = <0>;
> -- 
> 2.11.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-platforms][PATCH] Platform/Hisilicon/HiKey960: add skeleton of HiKey960

2018-02-08 Thread Ard Biesheuvel
On 8 February 2018 at 16:01, Haojian Zhuang  wrote:
> On 7 February 2018 at 01:29, Leif Lindholm  wrote:
>> On Mon, Feb 05, 2018 at 04:25:52PM +0800, Haojian Zhuang wrote:
>>> Add skeleton of HiKey960 platform.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Haojian Zhuang 
>>> ---
>>>  Platform/Hisilicon/HiKey960/HiKey960.dsc   | 457 
>>> +
>>>  Platform/Hisilicon/HiKey960/HiKey960.fdf   | 343 
>>>  .../HiKey960/Library/HiKey960Lib/HiKey960.c| 144 +++
>>>  .../HiKey960/Library/HiKey960Lib/HiKey960Helper.S  |  52 +++
>>>  .../HiKey960/Library/HiKey960Lib/HiKey960Lib.inf   |  47 +++
>>>  .../HiKey960/Library/HiKey960Lib/HiKey960Mem.c | 167 
>>>  6 files changed, 1210 insertions(+)
>>>  create mode 100644 Platform/Hisilicon/HiKey960/HiKey960.dsc
>>>  create mode 100644 Platform/Hisilicon/HiKey960/HiKey960.fdf
>>>  create mode 100644 
>>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960.c
>>>  create mode 100644 
>>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Helper.S
>>>  create mode 100644 
>>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Lib.inf
>>>  create mode 100644 
>>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Mem.c
>>>
>>
>> (I would be even happier if you could break the common parts of
>> Hikey/Hikey960 descriptions into a common .dsc, like the d02,3,5
>> platforms do with Silicon/Hisilicon/Hisilicon.dsc.inc.)
>>
>
> Hi Leif,
>
> I met an issue that blocks me. Hisilicon.dsc.inc makes use of dynamic
> PCD value on PcdPlatformBootTimeOut.
> And this PCD value is expected to store in variable storage device. As you 
> know,
> we haven't enabled variable storage device on HiKey yet.
>
> This one makes UEFI hang on HiKey.
>

Can't you just redeclare it as fixed in your .DSC ?
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-platforms][PATCH] Platform/Hisilicon/HiKey960: add skeleton of HiKey960

2018-02-08 Thread Haojian Zhuang
On 7 February 2018 at 01:29, Leif Lindholm  wrote:
> On Mon, Feb 05, 2018 at 04:25:52PM +0800, Haojian Zhuang wrote:
>> Add skeleton of HiKey960 platform.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Haojian Zhuang 
>> ---
>>  Platform/Hisilicon/HiKey960/HiKey960.dsc   | 457 
>> +
>>  Platform/Hisilicon/HiKey960/HiKey960.fdf   | 343 
>>  .../HiKey960/Library/HiKey960Lib/HiKey960.c| 144 +++
>>  .../HiKey960/Library/HiKey960Lib/HiKey960Helper.S  |  52 +++
>>  .../HiKey960/Library/HiKey960Lib/HiKey960Lib.inf   |  47 +++
>>  .../HiKey960/Library/HiKey960Lib/HiKey960Mem.c | 167 
>>  6 files changed, 1210 insertions(+)
>>  create mode 100644 Platform/Hisilicon/HiKey960/HiKey960.dsc
>>  create mode 100644 Platform/Hisilicon/HiKey960/HiKey960.fdf
>>  create mode 100644 
>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960.c
>>  create mode 100644 
>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Helper.S
>>  create mode 100644 
>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Lib.inf
>>  create mode 100644 
>> Platform/Hisilicon/HiKey960/Library/HiKey960Lib/HiKey960Mem.c
>>
>
> (I would be even happier if you could break the common parts of
> Hikey/Hikey960 descriptions into a common .dsc, like the d02,3,5
> platforms do with Silicon/Hisilicon/Hisilicon.dsc.inc.)
>

Hi Leif,

I met an issue that blocks me. Hisilicon.dsc.inc makes use of dynamic
PCD value on PcdPlatformBootTimeOut.
And this PCD value is expected to store in variable storage device. As you know,
we haven't enabled variable storage device on HiKey yet.

This one makes UEFI hang on HiKey.

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


Re: [edk2] [PATCH] ShellPkg/hexedit: Fix a read-after-free bug

2018-02-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Wednesday, February 07, 2018 8:45 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: [PATCH] ShellPkg/hexedit: Fix a read-after-free bug
> Importance: High
> 
> HDiskImageSetDiskNameOffsetSize() and HFileImageSetFileName()
> may be called using the current disk name or file name.
> When this happens, today's implementation firstly frees the memory
> and then accesses the just-freed memory.
> The patch fixes this issue by doing nothing when the disk or file
> name is the current one.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Jaben Carsey 
> ---
>  .../UefiShellDebug1CommandsLib/HexEdit/DiskImage.c | 22 +-
> ---
>  .../UefiShellDebug1CommandsLib/HexEdit/FileImage.c | 23 +--
> ---
>  2 files changed, 18 insertions(+), 27 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
> index 846b102975..8deb643f07 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
> @@ -1,7 +1,7 @@
>  /** @file
>Functions to deal with Disk buffer.
> 
> -  Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved. 
> +  Copyright (c) 2005 - 2018, 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
> @@ -120,27 +120,23 @@ HDiskImageSetDiskNameOffsetSize (
>IN UINTNSize
>)
>  {
> -  UINTN Len;
> -  UINTN Index;
> +  if (Str == HDiskImage.Name) {
> +//
> +// This function might be called using HDiskImage.FileName as Str.
> +// Directly return without updating HDiskImage.FileName.
> +//
> +return EFI_SUCCESS;
> +  }
> 
>//
>// free the old file name
>//
>SHELL_FREE_NON_NULL (HDiskImage.Name);
> -
> -  Len = StrLen (Str);
> -
> -  HDiskImage.Name = AllocateZeroPool (2 * (Len + 1));
> +  HDiskImage.Name = AllocateCopyPool (StrSize (Str), Str);
>if (HDiskImage.Name == NULL) {
>  return EFI_OUT_OF_RESOURCES;
>}
> 
> -  for (Index = 0; Index < Len; Index++) {
> -HDiskImage.Name[Index] = Str[Index];
> -  }
> -
> -  HDiskImage.Name[Len]  = L'\0';
> -
>HDiskImage.Offset = Offset;
>HDiskImage.Size   = Size;
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
> index 2517a57f59..d9fd72cdd2 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
> @@ -1,7 +1,7 @@
>  /** @file
>Functions to deal with file buffer.
> 
> -  Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved. 
> +  Copyright (c) 2005 - 2018, 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
> @@ -110,27 +110,22 @@ HFileImageSetFileName (
>IN CONST CHAR16 *Str
>)
>  {
> -  UINTN Size;
> -  UINTN Index;
> -
> +  if (Str == HFileImage.FileName) {
> +//
> +// This function might be called using HFileImage.FileName as Str.
> +// Directly return without updating HFileImage.FileName.
> +//
> +return EFI_SUCCESS;
> +  }
>//
>// free the old file name
>//
>SHELL_FREE_NON_NULL (HFileImage.FileName);
> -
> -  Size= StrLen (Str);
> -
> -  HFileImage.FileName = AllocateZeroPool (2 * (Size + 1));
> +  HFileImage.FileName = AllocateCopyPool (StrSize (Str), Str);
>if (HFileImage.FileName == NULL) {
>  return EFI_OUT_OF_RESOURCES;
>}
> 
> -  for (Index = 0; Index < Size; Index++) {
> -HFileImage.FileName[Index] = Str[Index];
> -  }
> -
> -  HFileImage.FileName[Size] = L'\0';
> -
>return EFI_SUCCESS;
>  }
> 
> --
> 2.16.1.windows.1

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


Re: [edk2] [PATCH] ShellPkg/rm: fix hang when deleting an absolutely-empty directory An ordinary empty directory should contain "." and ".." entries. When an empty directory even doesn't contain "." o

2018-02-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Wednesday, February 07, 2018 7:41 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: [PATCH] ShellPkg/rm: fix hang when deleting an absolutely-empty
> directory An ordinary empty directory should contain "." and ".." entries.
> When an empty directory even doesn't contain "." or ".." entry,
> FileHandleFindFirstFile() may return error status...
> Importance: High
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Jaben Carsey 
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
> index 618610d0f3..288e7666a8 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
> @@ -2,7 +2,7 @@
>Main file for attrib shell level 2 function.
> 
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2018, 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
> @@ -33,6 +33,7 @@ IsDirectoryEmpty (
>IN EFI_HANDLE   FileHandle
>)
>  {
> +  EFI_STATUS  Status;
>EFI_FILE_INFO   *FileInfo;
>BOOLEAN NoFile;
>BOOLEAN RetVal;
> @@ -41,8 +42,8 @@ IsDirectoryEmpty (
>NoFile = FALSE;
>FileInfo = NULL;
> 
> -  for (FileHandleFindFirstFile(FileHandle, )
> -;  !NoFile
> +  for (Status = FileHandleFindFirstFile(FileHandle, )
> +;  !NoFile && !EFI_ERROR (Status)
>  ;  FileHandleFindNextFile(FileHandle, FileInfo, )
> ){
>  if (StrStr(FileInfo->FileName, L".") != FileInfo->FileName
> --
> 2.16.1.windows.1

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


Re: [edk2] [PATCH v2 0/2] sync some function definitions with their declarations

2018-02-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Wednesday, February 07, 2018 2:45 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Brijesh Singh ;
> Ard Biesheuvel ; Justen, Jordan L
> ; Gary Lin ; Carsey, Jaben
> 
> Subject: [edk2] [PATCH v2 0/2] sync some function definitions with their
> declarations
> Importance: High
> 
> Repo:   https://github.com/lersek/edk2.git
> Branch: sync_defs_to_decls_v2
> 
> This is version 2 of the series that I posted earlier. Because that
> series didn't reach the list at all, due to SMTP issues on my end, I'm
> including the v1 blurb here:
> 
> > The patches say it all, just a side remark up here:
> >
> > These errors would have been caught long ago if we had enabled the
> > "-Wmissing-prototypes" gcc option.
> >
> > (Unfortunately, we can't enable that option even now, because it --
> > laudably -- forces the programmer to give internal linkage ("STATIC")
> > to their helper / local functions, and -- as we've learned -- some
> > versions of the the Visual Studio debugger choke on STATIC functions.
> > Thus, core modules basically never make their internal functions
> > STATIC.)
> 
> The v2 changes are noted per patch.
> 
> (This posting should hopefully reach the list; while the original SMTP
> issue remains undiagnosed, I attempted to put a work-around in place.
> Let's see if it works.)
> 
> Cc: Ard Biesheuvel 
> Cc: Brijesh Singh 
> Cc: Gary Lin 
> Cc: Jaben Carsey 
> Cc: Jordan Justen 
> Cc: Ruiyu Ni 
> 
> Thanks,
> Laszlo
> 
> Laszlo Ersek (2):
>   ShellPkg/UefiShellDebug1CommandsLib: sync Compress() definition with
> decl.
>   OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with
> declaration
> 
>  OvmfPkg/PlatformPei/AmdSev.c   |  3 ++-
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 14
> --
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h |  1 -
>  3 files changed, 10 insertions(+), 8 deletions(-)
> 
> --
> 2.14.1.3.gb7cf6e02401b
> 
> ___
> 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 edk2-platforms 1/3] Platform/ARM: drop unused EmbeddedPkg Pcds

2018-02-08 Thread Alexei Fedorov
This patch causes Juno and other ARM platforms to raise an assert during MMU 
initialisation in ArmConfigureMmu()

(edk2\ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuLibCore.c):


  ASSERT (TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK ||
  TranslationTableAttribute == 
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK);


see debug output:

UEFI firmware (version  built at 12:01:21 on Feb  8 2018)
add-symbol-file 
n:\edk2\Build\ArmJuno\DEBUG_GCC5\AARCH64\ArmPlatformPkg\PrePi\PeiUniCore\DEBUG\ArmPlatformPrePiUniCore.dll
 0xE800
ASSERT [ArmPlatformPrePiUniCore] 
n:\edk2\ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuLibCore.c(744): 
TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK || 
TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK

because removal of
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
from ArmVExpress.dsc.inc now makes ArmPlatformGetVirtualMemoryMap () function in
\edk2-platforms\Platform\ARM\JunoPkg\Library\ArmJunoLib\ArmJunoMem.c

use default FALSE value defined in EmbeddedPkg.dec:


[PcdsFeatureFlag.common]
  gEmbeddedTokenSpaceGuid.PcdCacheEnable|FALSE|BOOLEAN|0x0042


& set CacheAttributes to DDR_ATTRIBUTES_UNCACHED:

if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
CacheAttributes = DDR_ATTRIBUTES_CACHED;
  } else {
CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
  }


Thank you for your cooperation.

Alexei.


From: edk2-devel  on behalf of Leif Lindholm 

Sent: 06 February 2018 17:12
To: edk2-devel@lists.01.org
Cc: ard.biesheu...@linaro.org
Subject: [edk2] [PATCH edk2-platforms 1/3] Platform/ARM: drop unused 
EmbeddedPkg Pcds

A set of mostly Ebl-related Pcds are about to be deleted from
edk2. Delete references to them here to keep platforms building.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 18 --
 1 file changed, 18 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc 
b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index 717f7332c9..b026ce3a42 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -257,20 +257,6 @@ [PcdsFeatureFlag.common]
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE

-  #
-  # Control what commands are supported from the UI
-  # Turn these on and off to add features or save size
-  #
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedHwDebugCmd|TRUE
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedPciDebugCmd|TRUE
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedIoEnable|FALSE
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE
-
-  gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
-
   # Use the Vector Table location in CpuDxe. We will not copy the Vector Table 
at PcdCpuVectorBaseAddress
   gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE

@@ -333,10 +319,6 @@ [PcdsFixedAtBuild.common]

   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07

-  gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07
-  gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x1
-
   #
   # Optional feature to help prevent EFI memory map fragments
   # Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob
--
2.11.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms] Silicon/SynQuacer/DeviceTree: remove SCPI/MHU nodes

2018-02-08 Thread Ard Biesheuvel
On our SynQuacer based platform, power state handling and other
low-level duties are handled by the secure firmware, not by the
OS, so remove the various MHU/SCPI related nodes from the device
tree.

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

diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi 
b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
index 3db3c5ed1c50..a113780c2ab8 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi
@@ -388,36 +388,6 @@
 method = "smc";
 };
 
-mailbox: mhu@4500 {
-compatible = "arm,mhu", "arm,primecell";
-reg = <0x0 0x4500 0x0 0x1000>;
-interrupts = ,
- ; /* Non-Sec */
-interrupt-names = "mhu_lpri_rx", "mhu_hpri_rx";
-#mbox-cells = <1>;
-clocks = <_apb>;
-clock-names = "apb_pclk";
-};
-
-sram: sram@4520 {
-compatible = "mmio-sram";
-reg = <0x0 0x4520 0x0 0x200>;
-
-#address-cells = <1>;
-#size-cells = <1>;
-ranges = <0 0x0 0x4520 0x200>;
-
-cpu_scp_hpri: scp-shmem@0 {
-  reg = <0x0 0x200>;
-};
-};
-
-scpi {
-compatible = "arm,scpi";
-mboxes = < 1>;
-shmem = <_scp_hpri>;
-};
-
 clk_uart: refclk62500khz {
 compatible = "fixed-clock";
 #clock-cells = <0>;
-- 
2.11.0

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


[edk2] [PATCH] BaseTools: Update Expression.py for string comparison and MACRO replace issue

2018-02-08 Thread Yonghong Zhu
From: Yunhua Feng 

1. Fix string comparison incorrect issue, we expected "ABC" is greater than
"AAD" since the second char 'B' is greater than 'A'.
2. fix MACRO not replace issue.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/Common/Expression.py   | 41 ++
 BaseTools/Source/Python/Workspace/DscBuildData.py  |  2 +-
 .../Source/Python/Workspace/MetaFileParser.py  |  1 +
 3 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py 
b/BaseTools/Source/Python/Common/Expression.py
index 6a1103df2c..a19f35d991 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -155,23 +155,13 @@ class ValueExpression(object):
 
 @staticmethod
 def Eval(Operator, Oprand1, Oprand2 = None):
 WrnExp = None
 
-if Operator not in ["in", "not in"] and (type(Oprand1) == type('') or 
type(Oprand2) == type('')):
-if type(Oprand1) == type(''):
-if Oprand1[0] in ['"', "'"] or Oprand1.startswith('L"') or 
Oprand1.startswith("L'")or Oprand1.startswith('UINT'):
-Oprand1, Size = ParseFieldValue(Oprand1)
-else:
-Oprand1,Size = ParseFieldValue('"' + Oprand1 + '"')
-if type(Oprand2) == type(''):
-if Oprand2[0] in ['"', "'"] or Oprand2.startswith('L"') or 
Oprand2.startswith("L'") or Oprand2.startswith('UINT'):
-Oprand2, Size = ParseFieldValue(Oprand2)
-else:
-Oprand2, Size = ParseFieldValue('"' + Oprand2 + '"')
-if type(Oprand1) == type('') or type(Oprand2) == type(''):
-raise BadExpression(ERR_STRING_EXPR % Operator)
+if Operator not in ["==", "!=", ">=", "<=", ">", "<", "in", "not in"] 
and \
+(type(Oprand1) == type('') or type(Oprand2) == type('')):
+raise BadExpression(ERR_STRING_EXPR % Operator)
 if Operator in ['in', 'not in']:
 if type(Oprand1) != type(''):
 Oprand1 = IntToStr(Oprand1)
 if type(Oprand2) != type(''):
 Oprand2 = IntToStr(Oprand2)
@@ -294,12 +284,10 @@ class ValueExpression(object):
 try:
 Token = self._GetToken()
 except BadExpression:
 pass
 if type(Token) == type('') and Token.startswith('{') and 
Token.endswith('}') and self._Idx >= self._Len:
-if len(Token) != len(self._Expr.replace(' ', '')):
-raise BadExpression
 return self._Expr
 
 self._Idx = 0
 self._Token = ''
 
@@ -457,19 +445,17 @@ class ValueExpression(object):
 Flag = 0
 for Index in range(len(self._Token)):
 if self._Token[Index] in ['"']:
 Flag += 1
 if Flag == 2 and self._Token.endswith('"'):
-self._Token = ParseFieldValue(self._Token)[0]
 return True
 if self._Token.startswith("'") or self._Token.startswith("L'"):
 Flag = 0
 for Index in range(len(self._Token)):
 if self._Token[Index] in ["'"]:
 Flag += 1
 if Flag == 2 and self._Token.endswith("'"):
-self._Token = ParseFieldValue(self._Token)[0]
 return True
 try:
 self._Token = int(self._Token, Radix)
 return True
 except ValueError:
@@ -620,28 +606,20 @@ class ValueExpression(object):
 if Expr.startswith('L"'):
 # Skip L
 self._Idx += 1
 UStr = self.__GetString()
 self._Token = 'L"' + UStr + '"'
-self._Token, Size = ParseFieldValue(self._Token)
 return self._Token
 elif Expr.startswith("L'"):
 # Skip L
 self._Idx += 1
 UStr = self.__GetString()
 self._Token = "L'" + UStr + "'"
-self._Token, Size = ParseFieldValue(self._Token)
-return self._Token
-elif Expr.startswith('"'):
-UStr = self.__GetString()
-self._Token = '"' + UStr + '"'
-self._Token, Size = ParseFieldValue(self._Token)
 return self._Token
 elif Expr.startswith("'"):
 UStr = self.__GetString()
 self._Token = "'" + UStr + "'"
-self._Token, Size = ParseFieldValue(self._Token)
 return self._Token
 elif Expr.startswith('UINT'):
 Re = re.compile('(?:UINT8|UINT16|UINT32|UINT64)\((.+)\)')
 try:
 RetValue = Re.search(Expr).group(1)
@@ -749,11 +727,11 @@ class ValueExpressionEx(ValueExpression):
 

[edk2] [patch] MdeModulePkg/DriverSampleDxe: Make bit fields aligned in C structure

2018-02-08 Thread Dandan Bi
For a structure with a series of bit fields and used as a storage
in vfr file, and if the bit fields do not add up to the size of
the defined type.In the C code use sizeof() to get size of the
structure, the results may vary form the compiler(VS,GCC...).
But the size of the storage calculated by VfrCompiler is fixed
(calculate with alignment).To avoid the issue cased by above case,
we need to make the total width of the bit fields in the structure
aligned with the size of the defined type for these bit fields.

Cc: Eric Dong 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h 
b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
index 40fb3d0..af3d4bc 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
+++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
@@ -33,10 +33,18 @@ Revision History:
 #define CONFIGURATION_VARSTORE_ID0x1234
 #define BITS_VARSTORE_ID 0x2345
 
 #pragma pack(1)
 
+//
+// !!! For a structure with a series of bit fields and used as a storage in 
vfr file, and if the bit fields do not add up to the size of the defined type.
+// In the C code use sizeof() to get the size the strucure, the results may 
vary form the compiler(VS,GCC...).
+// But the size of the storage calculated by VfrCompiler is fixed (calculate 
with alignment).
+// To avoid above case, we need to make the total bit width in the structure 
aligned with the size of the defined type for these bit fields. We can:
+// 1. Add bit field (with/without name) with remianing with for padding.
+// 2. Add unnamed bit field with 0 for padding, the amount of padding is 
determined by the alignment characteristics of the members of the structure.
+//
 typedef struct {
   UINT16   NestByteField;
   UINT8: 1;  // unamed field can be used for padding
   UINT8NestBitCheckbox : 1;
   UINT8NestBitOneof: 2;
@@ -82,11 +90,13 @@ typedef struct {
   EFI_HII_TIME  Time;
   UINT8   RefreshGuidCount;
   UINT8   Match2;
   UINT8   GetDefaultValueFromCallBackForOrderedList[3];
   UINT8   BitCheckbox : 1;
+  UINT8   ReservedBits: 7;  // Reserved bit fields for padding.
   UINT16  BitOneof: 6;
+  UINT16  : 0;  // Width 0 used to force alignment.
   UINT16  BitNumeric  : 12;
   MY_BITS_DATA  MyBitData;
   MY_EFI_UNION_DATA MyUnionData;
 } DRIVER_SAMPLE_CONFIGURATION;
 
@@ -107,10 +117,11 @@ typedef struct {
   MY_BITS_DATA  BitsData;
   UINT32   EfiBitGrayoutTest : 5;
   UINT32   EfiBitNumeric : 4;
   UINT32   EfiBitOneof   : 10;
   UINT32   EfiBitCheckbox: 1;
+  UINT32 : 0;  // Width 0 used to force alignment.
 } MY_EFI_BITS_VARSTORE_DATA;
 
 //
 // Labels definition
 //
-- 
1.9.5.msysgit.1

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


[edk2] [Patch] BaseTools: Add the missing basic definition in C BaseType.h

2018-02-08 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
---
 BaseTools/Source/C/Include/Common/BaseTypes.h | 25 +
 1 file changed, 25 insertions(+)

diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h 
b/BaseTools/Source/C/Include/Common/BaseTypes.h
index 08b60ba..39c5408 100644
--- a/BaseTools/Source/C/Include/Common/BaseTypes.h
+++ b/BaseTools/Source/C/Include/Common/BaseTypes.h
@@ -122,6 +122,31 @@
 
 #endif
 
+///
+/// 128 bit buffer containing a unique identifier value.
+/// Unless otherwise specified, aligned on a 64 bit boundary.
+///
+typedef struct {
+  UINT32  Data1;
+  UINT16  Data2;
+  UINT16  Data3;
+  UINT8   Data4[8];
+} GUID;
+
+///
+/// 4-byte buffer. An IPv4 internet protocol address.
+///
+typedef struct {
+  UINT8 Addr[4];
+} IPv4_ADDRESS;
+
+///
+/// 16-byte buffer. An IPv6 internet protocol address.
+///
+typedef struct {
+  UINT8 Addr[16];
+} IPv6_ADDRESS;
+
 //
 // Macro that returns the byte offset of a field in a data structure. 
 //
-- 
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 PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Gao, Liming
They are reported in different phase. The first message is print before load 
image. The second message is print after load image successfully. If load image 
failure, only first message is print. So, I don't think we can combine them. 

>-Original Message-
>From: Zeng, Star
>Sent: Thursday, February 08, 2018 6:31 PM
>To: Gao, Liming ; edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: RE: [Patch] MdeModulePkg PeiCore: Add error message to describe
>PEIM load failure
>
>How about combining it to one for DXE?
>Either print FFS GUID or file name from PDB path, or both.
>
>Thanks,
>Star
>-Original Message-
>From: Gao, Liming
>Sent: Thursday, February 8, 2018 6:25 PM
>To: Zeng, Star ; edk2-devel@lists.01.org
>Subject: RE: [Patch] MdeModulePkg PeiCore: Add error message to describe
>PEIM load failure
>
>Star:
>  This change is to align Loading Driver in DXE phase. You can find below
>message in DXE boot.
>
>Loading driver 80CF7257-87AB-47F9-A3FE-D50B76D89541
>InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 88014240
>Loading driver at 0x00087FE6000 EntryPoint=0x00087FE70B4 PcdDxe.efi
>
>Thanks
>Liming
>>-Original Message-
>>From: Zeng, Star
>>Sent: Thursday, February 08, 2018 6:12 PM
>>To: Gao, Liming ; edk2-devel@lists.01.org
>>Cc: Zeng, Star 
>>Subject: RE: [Patch] MdeModulePkg PeiCore: Add error message to describe
>>PEIM load failure
>>
>>Hi Liming,
>>
>>Because of new added "+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n",
>>FileHandle));", the debug message will have two "Loading PEIM XXX" for one
>>PEIM, that is very confusing.
>>Loading PEIM 9B3ADA4F-AE56-4C24-8DEA-F03B7558AE50
>>Loading PEIM at 0x2353000 EntryPoint=0x03C10C5 PcdPeim.efi
>>
>>How about like below change?
>>1. Also print FFS GUID when section alignment error.
>>2. Print FFS GUID when PDB not found.
>>
>>
>>fb0030045fe4ae561177d9cff01f32088ae9975e
>> MdeModulePkg/Core/Pei/Image/Image.c | 10 +-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>>diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>>b/MdeModulePkg/Core/Pei/Image/Image.c
>>index 198541128512..179c77ef2194 100644
>>--- a/MdeModulePkg/Core/Pei/Image/Image.c
>>+++ b/MdeModulePkg/Core/Pei/Image/Image.c
>>@@ -1,7 +1,7 @@
>> /** @file
>>   Pei Core Load Image Support
>>
>>-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>>+Copyright (c) 2006 - 2018, 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
>>@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>>   //
>>   Status = PeCoffLoaderLoadImage ();
>>   if (EFI_ERROR (Status)) {
>>+if (ImageContext.ImageError ==
>>IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>>+  DEBUG ((DEBUG_ERROR, "PEIM(%g) Image Address 0x%11p doesn't
>>meet with section alignment 0x%x.\n", FileHandle,
>>(VOID*)(UINTN)ImageContext.ImageAddress,
>>ImageContext.SectionAlignment));
>>+}
>> return Status;
>>   }
>>   //
>>@@ -707,6 +710,11 @@ PeiLoadImageLoadImage (
>>   }
>>
>>   DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName));
>>+} else {
>>+  //
>>+  // Print FFS GUID when PDB not found.
>>+  //
>>+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%g", FileHandle));
>> }
>>
>>   DEBUG_CODE_END ();
>>
>>
>>Thanks,
>>Star
>>-Original Message-
>>From: Gao, Liming
>>Sent: Thursday, February 8, 2018 4:19 PM
>>To: edk2-devel@lists.01.org
>>Cc: Zeng, Star 
>>Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe
>>PEIM load failure
>>
>>If PEIM image address doesn't meet with its section alignment, it will load 
>>fail.
>>PeiCore adds more debug message to report it.
>>
>>Contributed-under: TianoCore Contribution Agreement 1.1
>>Signed-off-by: Liming Gao 
>>Cc: Star Zeng 
>>---
>> MdeModulePkg/Core/Pei/Image/Image.c | 7 ++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>>diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>>b/MdeModulePkg/Core/Pei/Image/Image.c
>>index 1985411..f41d3ac 100644
>>--- a/MdeModulePkg/Core/Pei/Image/Image.c
>>+++ b/MdeModulePkg/Core/Pei/Image/Image.c
>>@@ -1,7 +1,7 @@
>> /** @file
>>   Pei Core Load Image Support
>>
>>-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>>+Copyright (c) 2006 - 2018, 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
>>@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>>   //
>>   Status = PeCoffLoaderLoadImage ();
>>   if (EFI_ERROR (Status)) {
>>+if (ImageContext.ImageError ==

Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Laszlo Ersek
On 02/08/18 11:24, Gao, Liming wrote:
> Laszlo:
>   11p address is big to cover most real address. It can align and save the 
> message length. 

Good point, it can go up to 2^44 - 1, covering 16 TB of RAM.

Thanks
Laszlo

> Thanks
> Liming
>> -Original Message-
>> From: Laszlo Ersek [mailto:ler...@redhat.com]
>> Sent: Thursday, February 08, 2018 5:31 PM
>> To: Gao, Liming ; edk2-devel@lists.01.org
>> Cc: Zeng, Star 
>> Subject: Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to
>> describe PEIM load failure
>>
>> On 02/08/18 09:18, Liming Gao wrote:
>>> If PEIM image address doesn't meet with its section alignment, it will
>>> load fail. PeiCore adds more debug message to report it.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Liming Gao 
>>> Cc: Star Zeng 
>>> ---
>>>  MdeModulePkg/Core/Pei/Image/Image.c | 7 ++-
>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>> b/MdeModulePkg/Core/Pei/Image/Image.c
>>> index 1985411..f41d3ac 100644
>>> --- a/MdeModulePkg/Core/Pei/Image/Image.c
>>> +++ b/MdeModulePkg/Core/Pei/Image/Image.c
>>> @@ -1,7 +1,7 @@
>>>  /** @file
>>>Pei Core Load Image Support
>>>
>>> -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>>> +Copyright (c) 2006 - 2018, 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
>>> @@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>>>//
>>>Status = PeCoffLoaderLoadImage ();
>>>if (EFI_ERROR (Status)) {
>>> +if (ImageContext.ImageError ==
>> IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>>> +  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet
>> with section alignment 0x%x.\n",
>> (VOID*)(UINTN)ImageContext.ImageAddress,
>> ImageContext.SectionAlignment));
>>> +}
>>
>> Just curious, is there any particular reason for the 11 chars field
>> width? Personally I would print ImageContext.ImageAddress (which has
>> type PHYSICAL_ADDRESS, i.e. UINT64), without any type conversion, and
>> with the following format string:
>>
>>  0x%Lx
>>
>> or maybe
>>
>>  0x%16Lx
>>
>> ... There's no need to resubmit the patch because of my question; I'm
>> just curious if I'm missing something.
>>
>> Thanks!
>> Laszlo
>>
>>
>>>  return Status;
>>>}
>>>//
>>> @@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
>>>  }
>>>}
>>>
>>> +  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
>>> +
>>>//
>>>// If memory is installed, perform the shadow operations
>>>//
>>>
>>
>> I'

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


Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Zeng, Star
How about combining it to one for DXE?
Either print FFS GUID or file name from PDB path, or both.

Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Thursday, February 8, 2018 6:25 PM
To: Zeng, Star ; edk2-devel@lists.01.org
Subject: RE: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM 
load failure

Star:
  This change is to align Loading Driver in DXE phase. You can find below 
message in DXE boot. 

Loading driver 80CF7257-87AB-47F9-A3FE-D50B76D89541
InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 88014240
Loading driver at 0x00087FE6000 EntryPoint=0x00087FE70B4 PcdDxe.efi

Thanks
Liming
>-Original Message-
>From: Zeng, Star
>Sent: Thursday, February 08, 2018 6:12 PM
>To: Gao, Liming ; edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: RE: [Patch] MdeModulePkg PeiCore: Add error message to describe
>PEIM load failure
>
>Hi Liming,
>
>Because of new added "+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n",
>FileHandle));", the debug message will have two "Loading PEIM XXX" for one
>PEIM, that is very confusing.
>Loading PEIM 9B3ADA4F-AE56-4C24-8DEA-F03B7558AE50
>Loading PEIM at 0x2353000 EntryPoint=0x03C10C5 PcdPeim.efi
>
>How about like below change?
>1. Also print FFS GUID when section alignment error.
>2. Print FFS GUID when PDB not found.
>
>
>fb0030045fe4ae561177d9cff01f32088ae9975e
> MdeModulePkg/Core/Pei/Image/Image.c | 10 +-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>b/MdeModulePkg/Core/Pei/Image/Image.c
>index 198541128512..179c77ef2194 100644
>--- a/MdeModulePkg/Core/Pei/Image/Image.c
>+++ b/MdeModulePkg/Core/Pei/Image/Image.c
>@@ -1,7 +1,7 @@
> /** @file
>   Pei Core Load Image Support
>
>-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2018, 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
>@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>   //
>   Status = PeCoffLoaderLoadImage ();
>   if (EFI_ERROR (Status)) {
>+if (ImageContext.ImageError ==
>IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>+  DEBUG ((DEBUG_ERROR, "PEIM(%g) Image Address 0x%11p doesn't
>meet with section alignment 0x%x.\n", FileHandle,
>(VOID*)(UINTN)ImageContext.ImageAddress,
>ImageContext.SectionAlignment));
>+}
> return Status;
>   }
>   //
>@@ -707,6 +710,11 @@ PeiLoadImageLoadImage (
>   }
>
>   DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName));
>+} else {
>+  //
>+  // Print FFS GUID when PDB not found.
>+  //
>+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%g", FileHandle));
> }
>
>   DEBUG_CODE_END ();
>
>
>Thanks,
>Star
>-Original Message-
>From: Gao, Liming
>Sent: Thursday, February 8, 2018 4:19 PM
>To: edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe
>PEIM load failure
>
>If PEIM image address doesn't meet with its section alignment, it will load 
>fail.
>PeiCore adds more debug message to report it.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Liming Gao 
>Cc: Star Zeng 
>---
> MdeModulePkg/Core/Pei/Image/Image.c | 7 ++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>b/MdeModulePkg/Core/Pei/Image/Image.c
>index 1985411..f41d3ac 100644
>--- a/MdeModulePkg/Core/Pei/Image/Image.c
>+++ b/MdeModulePkg/Core/Pei/Image/Image.c
>@@ -1,7 +1,7 @@
> /** @file
>   Pei Core Load Image Support
>
>-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2018, 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
>@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>   //
>   Status = PeCoffLoaderLoadImage ();
>   if (EFI_ERROR (Status)) {
>+if (ImageContext.ImageError ==
>IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>+  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet
>with section alignment 0x%x.\n",
>(VOID*)(UINTN)ImageContext.ImageAddress,
>ImageContext.SectionAlignment));
>+}
> return Status;
>   }
>   //
>@@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
> }
>   }
>
>+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
>+
>   //
>   // If memory is installed, perform the shadow operations
>   //
>--
>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 edk2-platforms] Silicon/SynQuacer/PlatformDxe: disable eMMC DDR50 support

2018-02-08 Thread Ard Biesheuvel
On 8 February 2018 at 10:21, Leif Lindholm  wrote:
> On Thu, Feb 08, 2018 at 10:18:12AM +, Ard Biesheuvel wrote:
>> We already disable SDR104 support on the SynQuacer eMMC controller to
>> work around the need for a special tuning quirk that is difficult to
>> implement without modifying the generic driver, even in the presence
>> of a SD/MMC override protocol designed to carry such quirks.
>>
>> Unfortunately, as it turns out, DDR50 does not work either with the
>> particular 8 GB Kingston part that has been fitted on the rev0.2/0.3
>> 96board samples. Since the mode UEFI drives the eMMC in is independent
>> from what the OS chooses, and the fact that you would not use eMMC in
>> the first place if performance was a major concern, let's just disable
>> DDR50 as well, and fall back to SDR50 mode.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel 
>
> Reviewed-by: Leif Lindholm 
>

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


Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Gao, Liming
Star:
  This change is to align Loading Driver in DXE phase. You can find below 
message in DXE boot. 

Loading driver 80CF7257-87AB-47F9-A3FE-D50B76D89541
InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 88014240
Loading driver at 0x00087FE6000 EntryPoint=0x00087FE70B4 PcdDxe.efi

Thanks
Liming
>-Original Message-
>From: Zeng, Star
>Sent: Thursday, February 08, 2018 6:12 PM
>To: Gao, Liming ; edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: RE: [Patch] MdeModulePkg PeiCore: Add error message to describe
>PEIM load failure
>
>Hi Liming,
>
>Because of new added "+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n",
>FileHandle));", the debug message will have two "Loading PEIM XXX" for one
>PEIM, that is very confusing.
>Loading PEIM 9B3ADA4F-AE56-4C24-8DEA-F03B7558AE50
>Loading PEIM at 0x2353000 EntryPoint=0x03C10C5 PcdPeim.efi
>
>How about like below change?
>1. Also print FFS GUID when section alignment error.
>2. Print FFS GUID when PDB not found.
>
>
>fb0030045fe4ae561177d9cff01f32088ae9975e
> MdeModulePkg/Core/Pei/Image/Image.c | 10 +-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>b/MdeModulePkg/Core/Pei/Image/Image.c
>index 198541128512..179c77ef2194 100644
>--- a/MdeModulePkg/Core/Pei/Image/Image.c
>+++ b/MdeModulePkg/Core/Pei/Image/Image.c
>@@ -1,7 +1,7 @@
> /** @file
>   Pei Core Load Image Support
>
>-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2018, 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
>@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>   //
>   Status = PeCoffLoaderLoadImage ();
>   if (EFI_ERROR (Status)) {
>+if (ImageContext.ImageError ==
>IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>+  DEBUG ((DEBUG_ERROR, "PEIM(%g) Image Address 0x%11p doesn't
>meet with section alignment 0x%x.\n", FileHandle,
>(VOID*)(UINTN)ImageContext.ImageAddress,
>ImageContext.SectionAlignment));
>+}
> return Status;
>   }
>   //
>@@ -707,6 +710,11 @@ PeiLoadImageLoadImage (
>   }
>
>   DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName));
>+} else {
>+  //
>+  // Print FFS GUID when PDB not found.
>+  //
>+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%g", FileHandle));
> }
>
>   DEBUG_CODE_END ();
>
>
>Thanks,
>Star
>-Original Message-
>From: Gao, Liming
>Sent: Thursday, February 8, 2018 4:19 PM
>To: edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe
>PEIM load failure
>
>If PEIM image address doesn't meet with its section alignment, it will load 
>fail.
>PeiCore adds more debug message to report it.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Liming Gao 
>Cc: Star Zeng 
>---
> MdeModulePkg/Core/Pei/Image/Image.c | 7 ++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>b/MdeModulePkg/Core/Pei/Image/Image.c
>index 1985411..f41d3ac 100644
>--- a/MdeModulePkg/Core/Pei/Image/Image.c
>+++ b/MdeModulePkg/Core/Pei/Image/Image.c
>@@ -1,7 +1,7 @@
> /** @file
>   Pei Core Load Image Support
>
>-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2018, 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
>@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>   //
>   Status = PeCoffLoaderLoadImage ();
>   if (EFI_ERROR (Status)) {
>+if (ImageContext.ImageError ==
>IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>+  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet
>with section alignment 0x%x.\n",
>(VOID*)(UINTN)ImageContext.ImageAddress,
>ImageContext.SectionAlignment));
>+}
> return Status;
>   }
>   //
>@@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
> }
>   }
>
>+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
>+
>   //
>   // If memory is installed, perform the shadow operations
>   //
>--
>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 PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Gao, Liming
Laszlo:
  11p address is big to cover most real address. It can align and save the 
message length. 

Thanks
Liming
>-Original Message-
>From: Laszlo Ersek [mailto:ler...@redhat.com]
>Sent: Thursday, February 08, 2018 5:31 PM
>To: Gao, Liming ; edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to
>describe PEIM load failure
>
>On 02/08/18 09:18, Liming Gao wrote:
>> If PEIM image address doesn't meet with its section alignment, it will
>> load fail. PeiCore adds more debug message to report it.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Liming Gao 
>> Cc: Star Zeng 
>> ---
>>  MdeModulePkg/Core/Pei/Image/Image.c | 7 ++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/MdeModulePkg/Core/Pei/Image/Image.c
>b/MdeModulePkg/Core/Pei/Image/Image.c
>> index 1985411..f41d3ac 100644
>> --- a/MdeModulePkg/Core/Pei/Image/Image.c
>> +++ b/MdeModulePkg/Core/Pei/Image/Image.c
>> @@ -1,7 +1,7 @@
>>  /** @file
>>Pei Core Load Image Support
>>
>> -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
>> +Copyright (c) 2006 - 2018, 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
>> @@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>>//
>>Status = PeCoffLoaderLoadImage ();
>>if (EFI_ERROR (Status)) {
>> +if (ImageContext.ImageError ==
>IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
>> +  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet
>with section alignment 0x%x.\n",
>(VOID*)(UINTN)ImageContext.ImageAddress,
>ImageContext.SectionAlignment));
>> +}
>
>Just curious, is there any particular reason for the 11 chars field
>width? Personally I would print ImageContext.ImageAddress (which has
>type PHYSICAL_ADDRESS, i.e. UINT64), without any type conversion, and
>with the following format string:
>
>  0x%Lx
>
>or maybe
>
>  0x%16Lx
>
>... There's no need to resubmit the patch because of my question; I'm
>just curious if I'm missing something.
>
>Thanks!
>Laszlo
>
>
>>  return Status;
>>}
>>//
>> @@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
>>  }
>>}
>>
>> +  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
>> +
>>//
>>// If memory is installed, perform the shadow operations
>>//
>>
>
>I'
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms] Silicon/SynQuacer/PlatformDxe: disable eMMC DDR50 support

2018-02-08 Thread Leif Lindholm
On Thu, Feb 08, 2018 at 10:18:12AM +, Ard Biesheuvel wrote:
> We already disable SDR104 support on the SynQuacer eMMC controller to
> work around the need for a special tuning quirk that is difficult to
> implement without modifying the generic driver, even in the presence
> of a SD/MMC override protocol designed to carry such quirks.
> 
> Unfortunately, as it turns out, DDR50 does not work either with the
> particular 8 GB Kingston part that has been fitted on the rev0.2/0.3
> 96board samples. Since the mode UEFI drives the eMMC in is independent
> from what the OS chooses, and the fact that you would not use eMMC in
> the first place if performance was a major concern, let's just disable
> DDR50 as well, and fall back to SDR50 mode.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 

Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c 
> b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c
> index c40b30929d5d..6875dfe6b319 100644
> --- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c
> +++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/Emmc.c
> @@ -52,6 +52,7 @@
>  #define SYNQUACER_CLOCK_CTRL_VAL  0xBC01
>  
>  #define SD_HC_CAP_SDR104  BIT33
> +#define SD_HC_CAP_DDR50   BIT34
>  
>  #define ESD_CONTROL_RESET_DELAY   (20 * 1000)
>  #define IO_CONTROL2_SETTLE_US 3000
> @@ -95,7 +96,7 @@ SynQuacerSdMmcCapability (
>// quirk that is difficult to support using the generic driver.
>//
>Capability = ReadUnaligned64 (SdMmcHcSlotCapability);
> -  Capability &= ~(UINT64)SD_HC_CAP_SDR104;
> +  Capability &= ~(UINT64)(SD_HC_CAP_SDR104 | SD_HC_CAP_DDR50);
>WriteUnaligned64 (SdMmcHcSlotCapability, Capability);
>  
>return EFI_SUCCESS;
> -- 
> 2.11.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Zeng, Star
Hi Liming,

Because of new added "+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", 
FileHandle));", the debug message will have two "Loading PEIM XXX" for one 
PEIM, that is very confusing.
Loading PEIM 9B3ADA4F-AE56-4C24-8DEA-F03B7558AE50
Loading PEIM at 0x2353000 EntryPoint=0x03C10C5 PcdPeim.efi

How about like below change?
1. Also print FFS GUID when section alignment error.
2. Print FFS GUID when PDB not found.


fb0030045fe4ae561177d9cff01f32088ae9975e
 MdeModulePkg/Core/Pei/Image/Image.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c 
b/MdeModulePkg/Core/Pei/Image/Image.c
index 198541128512..179c77ef2194 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Load Image Support
 
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, 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
@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
   //
   Status = PeCoffLoaderLoadImage ();
   if (EFI_ERROR (Status)) {
+if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
+  DEBUG ((DEBUG_ERROR, "PEIM(%g) Image Address 0x%11p doesn't meet with 
section alignment 0x%x.\n", FileHandle, 
(VOID*)(UINTN)ImageContext.ImageAddress, ImageContext.SectionAlignment));
+}
 return Status;
   }
   //
@@ -707,6 +710,11 @@ PeiLoadImageLoadImage (
   }
 
   DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName));
+} else {
+  //
+  // Print FFS GUID when PDB not found.
+  //
+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%g", FileHandle));
 }
 
   DEBUG_CODE_END ();


Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Thursday, February 8, 2018 4:19 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load 
failure

If PEIM image address doesn't meet with its section alignment, it will load 
fail. PeiCore adds more debug message to report it.

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

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c 
b/MdeModulePkg/Core/Pei/Image/Image.c
index 1985411..f41d3ac 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Load Image Support
 
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, 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 @@ -506,6 +506,9 @@ 
LoadAndRelocatePeCoffImage (
   //
   Status = PeCoffLoaderLoadImage ();
   if (EFI_ERROR (Status)) {
+if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
+  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with 
section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, 
ImageContext.SectionAlignment));
+}
 return Status;
   }
   //
@@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
 }
   }
 
+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
+
   //
   // If memory is installed, perform the shadow operations
   //
--
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 05/10] OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files

2018-02-08 Thread Laszlo Ersek
On 02/08/18 10:32, Ard Biesheuvel wrote:
> On 8 February 2018 at 09:25, Laszlo Ersek  wrote:
>> On 02/08/18 09:32, Jordan Justen wrote:
>>
>>> Given the wording from the contribution agreement, it appears that it
>>> would also be fine to just use Mike's Signed-off-by if he is
>>> authorized to contribute the code even though he didn't author it.
>>
>> So basically just
>>
>>   """
>>   Contributed-under: TianoCore Contribution Agreement 1.1
>>   Signed-off-by: Michael D Kinney 
>>   """
>>
>> implies Mike saying, "trust me guys, I got Microsoft's authorization (or
>> whoever the original authors were) to contribute their code under the
>> 2-clause BSDL". Is that right?
>>
>> Dunno why but this concept is hard for me to accept. :) "whoever the
>> original authors were" is super vague to me. Let's say I want to verify
>> that authorization myself: whom do I contact? Are the
>> "https://github.com/Microsoft/MS_UEFI/...; references considered
>> sufficient origin information?
>>
> 
> This is exactly the reason: if someone contributes code under a
> suitable license, they should take full responsibility that the code
> in question is actually covered by that license.

OK. If that works, then patches #5 and #10 are

Reviewed-by: Laszlo Ersek 

as they are in this series.

(This keeps boggling my mind -- I honestly wonder whether responsibility
*can* stop at the submitter, as opposed to "catching up" with the whole
project --, so I'm pretty sure I'll forget about this interpretation
again, and you'll have to remind me again. Please bear with me. :( )

> I refuse any responsibility for verifying the origin of code that
> others contribute, and I'm sure your workload doesn't allow it either.

It's definitely not that I'd take any responsibility for origin
verification; I just figured that contributors could (or should)
semi-formally support such efforts, *should* someone in the future feel
like verifying the origin.

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


Re: [edk2] [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Laszlo Ersek
On 02/08/18 09:18, Liming Gao wrote:
> If PEIM image address doesn't meet with its section alignment, it will
> load fail. PeiCore adds more debug message to report it.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao 
> Cc: Star Zeng 
> ---
>  MdeModulePkg/Core/Pei/Image/Image.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Core/Pei/Image/Image.c 
> b/MdeModulePkg/Core/Pei/Image/Image.c
> index 1985411..f41d3ac 100644
> --- a/MdeModulePkg/Core/Pei/Image/Image.c
> +++ b/MdeModulePkg/Core/Pei/Image/Image.c
> @@ -1,7 +1,7 @@
>  /** @file
>Pei Core Load Image Support
>  
> -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2018, 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
> @@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
>//
>Status = PeCoffLoaderLoadImage ();
>if (EFI_ERROR (Status)) {
> +if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
> +  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with 
> section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, 
> ImageContext.SectionAlignment));
> +}

Just curious, is there any particular reason for the 11 chars field
width? Personally I would print ImageContext.ImageAddress (which has
type PHYSICAL_ADDRESS, i.e. UINT64), without any type conversion, and
with the following format string:

  0x%Lx

or maybe

  0x%16Lx

... There's no need to resubmit the patch because of my question; I'm
just curious if I'm missing something.

Thanks!
Laszlo


>  return Status;
>}
>//
> @@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
>  }
>}
>  
> +  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
> +
>//
>// If memory is installed, perform the shadow operations
>//
> 

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


Re: [edk2] [Patch 05/10] OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files

2018-02-08 Thread Laszlo Ersek
On 02/08/18 09:32, Jordan Justen wrote:

> Given the wording from the contribution agreement, it appears that it
> would also be fine to just use Mike's Signed-off-by if he is
> authorized to contribute the code even though he didn't author it.

So basically just

  """
  Contributed-under: TianoCore Contribution Agreement 1.1
  Signed-off-by: Michael D Kinney 
  """

implies Mike saying, "trust me guys, I got Microsoft's authorization (or
whoever the original authors were) to contribute their code under the
2-clause BSDL". Is that right?

Dunno why but this concept is hard for me to accept. :) "whoever the
original authors were" is super vague to me. Let's say I want to verify
that authorization myself: whom do I contact? Are the
"https://github.com/Microsoft/MS_UEFI/...; references considered
sufficient origin information?

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


Re: [edk2] [Patch 05/10] OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files

2018-02-08 Thread Laszlo Ersek
On 02/08/18 08:43, Ard Biesheuvel wrote:
> On 8 February 2018 at 01:35, Laszlo Ersek  wrote:
>> On 02/08/18 00:48, Kinney, Michael D wrote:
>>> Laszlo,
>>>
>>> The BmpSupportLib content was from contributions from
>>> a capsule related branch.  However, the BmpSupportLib
>>> can be used for UX capsules as well as other places that
>>> conversions between BMP and GOP BLT buffers are needed,
>>> so it is a more generic feature.  The SafeIntLib was also
>>> based on content from the same capsule related branch but
>>> also has uses other than capsules.
>>>
>>> Yes.  I need to add Signed-off-by for Sean.
> 
> I will note once again that our signed off by deviates from other
> usage in the industry.
> 
> Usually, a sign off is not an assertion of authorship. It means that
> the submitter is able to submit the code under the license that covers
> it.

I think a license is not really interpretable unless the identity of the
licensor can be established. I'd just like something in the commit
message and/or the git metadata to spell out the shared authorship
between Microsoft and Intel.

> In our case, it means authorship, which is why we as
> reviewers/maintainers add 'reviewed-by' not 'signed-off-by' like we do
> in the linux kernel.
> 
> So what if I want to merge code that is available under a suitable
> license, but the author is not available to give his sign off, or
> there are many (hundreds) of authors etc etc? The whole point of open
> source licensing is that we don't *need* the explicit sign off of the
> authors, because the license tells us what we can and cannot do with
> the code.

We may not need an explicit sign-off from the original author, agreed,
but we need *something* that states that it was the original author that
put the original work under the license in question.

Patch #5 starts with:

"From: Michael D Kinney "

which means the git meta-datum for authorship will not credit Microsoft.
Then, we also don't see a @microsoft.com email address anywhere at the
end of the commit message. Finally, the code changes themselves don't
add a Microsoft (C) to the DSC files. So we have a patch that is derived
from original Microsoft work (at this point it is shared work between
Intel and Microsoft), with none of the common attribution methods
mentioning Microsoft.

I don't insist on either form specifically, but *something* needs to be
added, in my opinion.

> I guess this is also related to the DCO vs contributed-under tags, but
> in general, I think adding the sign off of people who are not involved
> in the actual upstreaming of the code is wrong, and it is perfectly
> fine for the author not to be in a s-o-b line.

Fine by me; but please let us find another semi-formal method then that
states that the original (non-upstreamimg) author has put the patch
under the license that actually *permits* upstreaming now, without the
original author's active participation.

I thought the best method for this would be:

"""
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sean Brogan 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney 
"""

I may well be wrong about the specifics, but I feel that *something*
should spell out Microsoft's co-authorship on this patch.

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


[edk2] [PATCH] SourceLevelDebugPkg DebugUsb3: Fix GCC build failures

2018-02-08 Thread Star Zeng
Fix GCC build failures below.
variable 'EvtTrb' set but not used [-Werror=unused-but-set-variable]
variable 'Index' set but not used [-Werror=unused-but-set-variable]

The build failure could only be caught with -D SOURCE_DEBUG_USE_USB3
build flag.

Cc: Ruiyu Ni 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 .../DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c   | 2 --
 .../DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c | 4 +---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git 
a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c
 
b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c
index 87fb0265489b..c577df7dea97 100644
--- 
a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c
+++ 
b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c
@@ -906,7 +906,6 @@ DebugPortWriteBuffer (
   USB3_DEBUG_PORT_HANDLE*UsbDebugPortHandle;
   UINTN Sent;
   UINTN Total;
-  UINTN Index;
 
   if (NumberOfBytes == 0 || Buffer == NULL) {
 return 0;
@@ -934,7 +933,6 @@ DebugPortWriteBuffer (
   //
   DebugPortPollBuffer (UsbDebugPortHandle);
 
-  Index = 0;
   while ((Total < NumberOfBytes)) {
 if (NumberOfBytes - Total > USB3_DEBUG_PORT_WRITE_MAX_PACKET_SIZE) {
   Sent = USB3_DEBUG_PORT_WRITE_MAX_PACKET_SIZE;
diff --git 
a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c
 
b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c
index dbff49362407..1b6645bd1c6d 100644
--- 
a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c
+++ 
b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c
@@ -1,7 +1,7 @@
 /** @file
   Debug Port Library implementation based on usb3 debug port.
 
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2018, 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
@@ -145,11 +145,9 @@ XhcCheckNewEvent (
   )
 {
   EFI_STATUS  Status;
-  TRB_TEMPLATE*EvtTrb;
 
   ASSERT (EvtRing != NULL);
 
-  EvtTrb = (TRB_TEMPLATE *)(UINTN) EvtRing->EventRingDequeue;
   *NewEvtTrb = (TRB_TEMPLATE *)(UINTN) EvtRing->EventRingDequeue;
 
   if (EvtRing->EventRingDequeue == EvtRing->EventRingEnqueue) {
-- 
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 09/10] EmulatorPkg: Add SafeIntLib and BmpSupportLib to DSC files

2018-02-08 Thread Jordan Justen
Reviewed-by: Jordan Justen 

On 2018-02-07 14:58:21, Kinney, Michael D wrote:
> From: Michael D Kinney 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=800
> 
> Based on content from the following branch/commits:
> https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
> https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
> https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
> https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b
> 
> Add BmpSupportLib and SafeIntLib mappings that are required
> by GenericBdsLib.
> 
> Cc: Sean Brogan 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Andrew Fish 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Michael D Kinney 
> ---
>  EmulatorPkg/EmulatorPkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
> index 818691ce3a..1c274cb723 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -83,6 +83,8 @@
>DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
>
> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
>
> GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
> +  BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
> +  SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
>
> CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
>
> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
>
> TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
> -- 
> 2.14.2.windows.3
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 05/10] OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files

2018-02-08 Thread Jordan Justen
On 2018-02-07 23:43:44, Ard Biesheuvel wrote:
> On 8 February 2018 at 01:35, Laszlo Ersek  wrote:
> > On 02/08/18 00:48, Kinney, Michael D wrote:
> >> Laszlo,
> >>
> >> The BmpSupportLib content was from contributions from
> >> a capsule related branch.  However, the BmpSupportLib
> >> can be used for UX capsules as well as other places that
> >> conversions between BMP and GOP BLT buffers are needed,
> >> so it is a more generic feature.  The SafeIntLib was also
> >> based on content from the same capsule related branch but
> >> also has uses other than capsules.
> >>
> >> Yes.  I need to add Signed-off-by for Sean.
> 
> I will note once again that our signed off by deviates from other
> usage in the industry.
> 
> Usually, a sign off is not an assertion of authorship. It means that
> the submitter is able to submit the code under the license that covers
> it.
> 
> In our case, it means authorship,

>From "TianoCore Contribution Agreement 1.1":

  "You" or "Contributor" shall mean the copyright owner or legal
  entity authorized by the copyright owner that is making a
  Contribution hereunder.

For reference, the kernel DCO:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1

Maybe the kernel does make it clearer in some ways, but I don't think
it has to be the actual author for EDK II.

One argument for following the kernel process might be that more
people that work on open source are familiar with it.

> which is why we as
> reviewers/maintainers add 'reviewed-by' not 'signed-off-by' like we do
> in the linux kernel.

Maybe this is more about the fact that sub-systems don't do pull
requests in EDK II, but just push the changes directly?

> So what if I want to merge code that is available under a suitable
> license, but the author is not available to give his sign off, or
> there are many (hundreds) of authors etc etc? The whole point of open
> source licensing is that we don't *need* the explicit sign off of the
> authors, because the license tells us what we can and cannot do with
> the code.
> 
> I guess this is also related to the DCO vs contributed-under tags, but
> in general, I think adding the sign off of people who are not involved
> in the actual upstreaming of the code is wrong, and it is perfectly
> fine for the author not to be in a s-o-b line.

It does seem like it would be preferable (or simpler?) for the author
to publicly note that they wrote it and give their Signed-off-by under
the contribution agreement.

Given the wording from the contribution agreement, it appears that it
would also be fine to just use Mike's Signed-off-by if he is
authorized to contribute the code even though he didn't author it.

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


[edk2] [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

2018-02-08 Thread Liming Gao
If PEIM image address doesn't meet with its section alignment, it will
load fail. PeiCore adds more debug message to report it.

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

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c 
b/MdeModulePkg/Core/Pei/Image/Image.c
index 1985411..f41d3ac 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Load Image Support
 
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, 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
@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
   //
   Status = PeCoffLoaderLoadImage ();
   if (EFI_ERROR (Status)) {
+if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
+  DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with 
section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, 
ImageContext.SectionAlignment));
+}
 return Status;
   }
   //
@@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
 }
   }
 
+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
+
   //
   // If memory is installed, perform the shadow operations
   //
-- 
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 v2] UefiCpuPkg/S3Resume: Add more perf entry for S3 phase

2018-02-08 Thread Laszlo Ersek
On 02/08/18 07:19, Dandan Bi wrote:
> V2: Just update the commit message.
> 
> Add more perf entry to hook BootScriptDonePpi/EndOfPeiPpi/
> EndOfS3Resume.
> 
> Add the new perf entry with Identifier
> PERF_INMODULE_START_ID/PERF_INMODULE_END_ID which are defined
> in new performance infrastructure (edk2 trunk commit hash value:
> SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
> SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4).
> PERF_INMODULE_START_ID/PERF_INMODULE_END_ID are general Identifier
> which are used within a module.
> 
> Cc: Eric Dong 
> Cc: Laszlo Ersek 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi 
> ---
>  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 15 ++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

Thanks for the commit mesage update.

Acked-by: Laszlo Ersek 

Laszlo

> diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c 
> b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> index b597ac7..d7d2a4d 100644
> --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> @@ -2,11 +2,11 @@
>This module produces the EFI_PEI_S3_RESUME2_PPI.
>This module works with StandAloneBootScriptExecutor to S3 resume to OS.
>This module will execute the boot script saved during last boot and after 
> that,
>control is passed to OS waking up handler.
>  
> -  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> +  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>Copyright (c) 2017, AMD Incorporated. 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
> @@ -21,10 +21,11 @@
>  #include 
>  
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
> @@ -551,13 +552,17 @@ S3ResumeBootOs (
>PERF_END (NULL, "ScriptExec", NULL, 0);
>  
>//
>// Install BootScriptDonePpi
>//
> +  PERF_START_EX (NULL, "BootScriptDonePpi", NULL, 0, PERF_INMODULE_START_ID);
> +
>Status = PeiServicesInstallPpi ();
>ASSERT_EFI_ERROR (Status);
>  
> +  PERF_END_EX (NULL, "BootScriptDonePpi", NULL, 0, PERF_INMODULE_END_ID);
> +
>//
>// Get ACPI Table Address
>//
>Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) 
> (AcpiS3Context->AcpiFacsTable));
>  
> @@ -576,18 +581,26 @@ S3ResumeBootOs (
>}
>  
>//
>// Install EndOfPeiPpi
>//
> +  PERF_START_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_START_ID);
> +
>Status = PeiServicesInstallPpi ();
>ASSERT_EFI_ERROR (Status);
>  
> +  PERF_END_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_END_ID);
> +
>//
>// Signal EndOfS3Resume event.
>//
> +  PERF_START_EX (NULL, "EndOfS3Resume", NULL, 0, PERF_INMODULE_START_ID);
> +
>SignalEndOfS3Resume ();
>  
> +  PERF_END_EX (NULL, "EndOfS3Resume", NULL, 0, PERF_INMODULE_END_ID);
> +
>//
>// report status code on S3 resume
>//
>REPORT_STATUS_CODE (EFI_PROGRESS_CODE, EFI_SOFTWARE_PEI_MODULE | 
> EFI_SW_PEI_PC_OS_WAKE);
>  
> 

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