Re: [edk2-devel] Casting i128 into f64 in UEFI Rust pagefaults

2022-07-25 Thread Ayush Singh
Hi Andrew. Thanks for all your work. The more I look at this, the more 
it feels like it might be a problem on the LLVM side instead of Rust. I 
also found some more tests (all related to numbers btw) which can cause 
different types of exceptions, so I think I will try filing bugs upstream.


Yours Sincerely,

Ayush Singh


On 7/26/22 00:24, Andrew Fish wrote:
I guess I could at least dump to the end (req)…. Going backwards is a 
bit painful in x86.


(lldb) dis -s 0x000140001B60 -b -c 30

hello_world_std.efi[0x140001b60]: 48 8b 09                       movq 
  (%rcx), %rcx


hello_world_std.efi[0x140001b63]: 48 01 c1                       addq 
  %rax, %rcx


hello_world_std.efi[0x140001b66]: 4c 89 c2                       movq 
  %r8, %rdx


hello_world_std.efi[0x140001b69]: 48 11 c2                       adcq 
  %rax, %rdx


hello_world_std.efi[0x140001b6c]: 48 31 c1                       xorq 
  %rax, %rcx


hello_world_std.efi[0x140001b6f]: 48 31 c2                       xorq 
  %rax, %rdx


hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80  
movabsq $-0x8000, %rsi ; imm = 0x8000


hello_world_std.efi[0x140001b7c]: 4c 21 c6                       andq 
  %r8, %rsi


hello_world_std.efi[0x140001b7f]: e8 5c 55 00 00                 
callq  0x1400070e0


hello_world_std.efi[0x140001b84]: 48 09 f0                       orq  
  %rsi, %rax


hello_world_std.efi[0x140001b87]: 48 83 c4 20                    addq 
  $0x20, %rsp


hello_world_std.efi[0x140001b8b]: 5e                             popq 
  %rsi


hello_world_std.efi[0x140001b8c]: c3                             retq

hello_world_std.efi[0x140001b8d]: cc                             int3

hello_world_std.efi[0x140001b8e]: cc                             int3

hello_world_std.efi[0x140001b8f]: cc                             int3

hello_world_std.efi[0x140001b90]: e9 db 55 00 00                 jmp  
  0x140007170


hello_world_std.efi[0x140001b95]: cc                             int3

…

Then we can guess based on how functions get aligned to find the start….

hello_world_std.efi[0x140001b50]: 56                                   
pushq  %rsi


hello_world_std.efi[0x140001b51]: 48 83 ec 20                          
subq   $0x20, %rsp


hello_world_std.efi[0x140001b55]: 4c 8b 41 08                          
movq   0x8(%rcx), %r8


hello_world_std.efi[0x140001b59]: 4c 89 c0                             
movq   %r8, %rax


hello_world_std.efi[0x140001b5c]: 48 c1 f8 3f                          
sarq   $0x3f, %rax


hello_world_std.efi[0x140001b60]: 48 8b 09                             
movq   (%rcx), %rcx


hello_world_std.efi[0x140001b63]: 48 01 c1                             
addq   %rax, %rcx


hello_world_std.efi[0x140001b66]: 4c 89 c2                             
movq   %r8, %rdx


hello_world_std.efi[0x140001b69]: 48 11 c2                             
adcq   %rax, %rdx


hello_world_std.efi[0x140001b6c]: 48 31 c1                             
xorq   %rax, %rcx


hello_world_std.efi[0x140001b6f]: 48 31 c2                             
xorq   %rax, %rdx


hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80        
movabsq $-0x8000, %rsi ; imm = 0x8000


hello_world_std.efi[0x140001b7c]: 4c 21 c6                             
andq   %r8, %rsi


hello_world_std.efi[0x140001b7f]: e8 5c 55 00 00                       
callq  0x1400070e0


hello_world_std.efi[0x140001b84]: 48 09 f0                             
orq    %rsi, %rax


hello_world_std.efi[0x140001b87]: 48 83 c4 20                          
addq   $0x20, %rsp


hello_world_std.efi[0x140001b8b]: 5e                                   
popq   %rsi


hello_world_std.efi[0x140001b8c]: c3                                   
retq



So the faulting function is getting passed a bad pointer as its 1st arg.

Thanks,

Andrew Fish


On Jul 25, 2022, at 11:45 AM, Andrew Fish  wrote:

Ops… Looks like your PE/COFF is linked at 0x00014000, 
so 0x140001b60 is the interesting bit.


(lldb) dis -s 0x000140001B60 -b
hello_world_std.efi[0x140001b60]: 48 8b 09                       movq 
  (%rcx), %rcx
hello_world_std.efi[0x140001b63]: 48 01 c1                       addq 
  %rax, %rcx
hello_world_std.efi[0x140001b66]: 4c 89 c2                       movq 
  %r8, %rdx
hello_world_std.efi[0x140001b69]: 48 11 c2                       adcq 
  %rax, %rdx
hello_world_std.efi[0x140001b6c]: 48 31 c1                       xorq 
  %rax, %rcx
hello_world_std.efi[0x140001b6f]: 48 31 c2                       xorq 
  %rax, %rdx
hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80  
movabsq $-0x8000, %rsi ; imm = 0x8000
hello_world_std.efi[0x140001b7c]: 4c 21 c6                       andq 
  %r8, %rsi


 RCX - 

So yea that looks like the fault.

I don’t see that pattern in your .s file….

Can you figure out what function is @ 0x140001b60 in the PE/COFF 
image. Do you have a map file from the linker?



Re: [edk2-devel] [edk2-staging][PATCH v2 05/15] edk2-staging/RedfishClientPkg: Introduce resource identify library

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Comment in-line. You can search [Chang, Abner] for the comment.

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Yang, Atom
> ; Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 05/15] edk2-staging/RedfishClientPkg:
> Introduce resource identify library
> 
> [CAUTION: External Email]
> 
> Introduce resource identify library which works with resource config protocol 
> to
> identify Redfish resource. This library provides the flexibility for platform 
> to
> implement its own policy and identify resource. Two library implementation are
> provided as demonstration code. NULL version of library accepts all Redfish
> resource and another implementation to computer system resource uses UUID
> to identify Redfish resource.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  .../Library/RedfishResourceIdentifyLib.h  |  29 
>  .../RedfishResourceIdentifyLibComuterSystem.c | 164
> ++  ...edfishResourceIdentifyLibComuterSystem.inf |  42
> +
>  .../RedfishResourceIdentifyLibNull.c  |  37 
>  .../RedfishResourceIdentifyLibNull.inf|  37 
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   2 +-
>  RedfishClientPkg/RedfishClientPkg.dec |   1 +
>  7 files changed, 311 insertions(+), 1 deletion(-)  create mode 100644
> RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h
>  create mode 100644
> RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0/Re
> dfishResourceIdentifyLibComuterSystem.c
>  create mode 100644
> RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0/Re
> dfishResourceIdentifyLibComuterSystem.inf
>  create mode 100644
> RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResourceIdenti
> fyLibNull.c
>  create mode 100644
> RedfishClientPkg/Library/RedfishResourceIdentifyLibNull/RedfishResourceIdenti
> fyLibNull.inf
> 
> diff --git a/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h
> b/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h
> new file mode 100644
> index 00..91d01b7d68
> --- /dev/null
> +++ b/RedfishClientPkg/Include/Library/RedfishResourceIdentifyLib.h
> @@ -0,0 +1,29 @@
> +/** @file
> +  This file defines the Redfish resource identify Library interface.
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef REDFISH_RESOURCE_IDENTIFY_LIB_H_ #define
> +REDFISH_RESOURCE_IDENTIFY_LIB_H_
> +
> +/**
> +  Identify resource from given URI and context in JSON format
> +
> +  @param[in]   UriURI of given Redfish resource
> +  @param[in]   Json   Context in JSON format of give Redfish resource
> +
> +  @retval TRUEThis is the Redfish resource that we have to handle.
> +  @retval FALSE   We don't handle this Redfish resource.
> +
> +**/
> +BOOLEAN
> +RedfishIdentifyResource (
> +  IN EFI_STRING Uri,
> +  IN CHAR8  *Json
> +  );
> +
> +#endif
> diff --git
> a/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0/
> RedfishResourceIdentifyLibComuterSystem.c
> b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v1_5_0/
> RedfishResourceIdentifyLibComuterSystem.c
> new file mode 100644
> index 00..e5699f194c
> --- /dev/null
> +++ b/RedfishClientPkg/Library/RedfishResourceIdentifyLibComuterSystem/v
> +++ 1_5_0/RedfishResourceIdentifyLibComuterSystem.c
> @@ -0,0 +1,164 @@
> +/** @file
> +  Redfish resource identify library implementation for computer system
> +version 1.5.0
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include
> + >
> +
> +EFI_REST_JSON_STRUCTURE_PROTOCOL  *mJsonStructProtocol = NULL;
> +
> +/**
> +  Identify resource from given URI and context in JSON format
> +
> +  @param[in]   UriURI of given Redfish resource
> +  @param[in]   Json   Context in JSON format of give Redfish resource
> +
> +  @retval TRUEThis is the Redfish resource that we have to handle.
> +  @retval FALSE   We don't handle this Redfish resource.
> +
> +**/
> +BOOLEAN
> +RedfishIdentifyResource (
> +  IN EFI_STRING Uri,
> +  IN CHAR8  *Json
> +  )
> +{
> +  EFI_STATUSStatus;
> +  EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystem;
> +  EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS  *ComputerSystemCs;
> +  EFI_GUID  SystemUuid;
> +  EFI_GUID  ResourceUuid;
> +
> +  if (IS_EMPTY_STRING (Uri) || IS_EMPTY_STRING (Json)) {
> +return FALSE;
> +  }
> +
> +  if (mJsonStructProtocol == NULL) {
> +return FALSE;
> +  }
> +
> +  

Re: [edk2-devel] [edk2-staging][PATCH v2 04/15] edk2-staging/RedfishClientPkg: Introduce Redfish resource config library

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Comment in line.

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Yang, Atom
> ; Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 04/15] edk2-staging/RedfishClientPkg:
> Introduce Redfish resource config library
> 
> [CAUTION: External Email]
> 
> Add EdkIIRedfishResourceConfigLib in order to work with Redfish Config
> Protocol and do the communication between each feature drivers. Also
> introduce Redfish interchange data protocol to exchange data efficiently.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  .../Library/EdkIIRedfishResourceConfigLib.h   | 163 +
>  .../Protocol/EdkIIRedfishInterchangeData.h|  52 ++
>  .../EdkIIRedfishResourceConfigLib.c   | 593 ++
>  .../EdkIIRedfishResourceConfigLib.inf |  49 ++
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   1 +
>  RedfishClientPkg/RedfishClientPkg.dec |   5 +-
>  6 files changed, 862 insertions(+), 1 deletion(-)  create mode 100644
> RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
>  create mode 100644
> RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h
>  create mode 100644
> RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceC
> onfigLib.c
>  create mode 100644
> RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceC
> onfigLib.inf
> 
> diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> new file mode 100644
> index 00..1e843ec551
> --- /dev/null
> +++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> @@ -0,0 +1,163 @@
> +/** @file
> +  This file defines the EDKII resource config Library interface.
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EDKII_REDFISH_RESOURCE_CONFIG_LIB_H_
> +#define EDKII_REDFISH_RESOURCE_CONFIG_LIB_H_
> +
> +#include 
> +#include 
> +#include 
> +#include  #include
> +
> +#include 
> +/**
> +  Provising redfish resource by given URI.
> +
> +  @param[in]   Schema  Redfish schema information.
> +  @param[in]   Uri Target URI to create resource.
> +  @param[in]   InformationExchange Pointer to
> RESOURCE_INFORMATION_EXCHANGE.
> +  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST
> method is used.
> +   FALSE if the resource exist but some of 
> properties are
> missing,
> +   HTTP PUT method is used.
> +
> +  @retval EFI_SUCCESS  Value is returned successfully.
> +  @retval Others   Some error happened.
> +
> +**/
> +EFI_STATUS
> +EdkIIRedfishResourceConfigProvisionging (
> +  IN REDFISH_SCHEMA_INFO *Schema,
> +  IN EFI_STRING  Uri,
> +  IN RESOURCE_INFORMATION_EXCHANGE   *InformationExchange,
> +  IN BOOLEAN HttpPostMode
> +  );
> +
> +/**
> +  Consume resource from given URI.
> +
> +  @param[in]   Schema  Redfish schema information.
> +  @param[in]   Uri The target URI to consume.
> +
> +  @retval EFI_SUCCESS  Value is returned successfully.
> +  @retval Others   Some error happened.
> +
> +**/
> +EFI_STATUS
> +EdkIIRedfishResourceConfigConsume (
> +  IN REDFISH_SCHEMA_INFO  *Schema,
> +  IN EFI_STRING   Uri
> +  );
> +
> +
> +/**
> +  Update resource to given URI.
> +
> +  @param[in]   Schema  Redfish schema information.
> +  @param[in]   Uri The target URI to consume.
> +
> +  @retval EFI_SUCCESS  Value is returned successfully.
> +  @retval Others   Some error happened.
> +
> +**/
> +EFI_STATUS
> +EdkIIRedfishResourceConfigUpdate (
> +  IN REDFISH_SCHEMA_INFO  *Schema,
> +  IN EFI_STRING   Uri
> +  );
> +
> +
> +/**
> +  Check resource on given URI.
> +
> +  @param[in]   Uri The target URI to consume.
> +
> +  @retval EFI_SUCCESS  Value is returned successfully.
> +  @retval Others   Some error happened.
> +
> +**/
> +EFI_STATUS
> +EdkIIRedfishResourceConfigCheck (
> +  IN REDFISH_SCHEMA_INFO  *Schema,
> +  IN EFI_STRING   Uri
> +  );
> +
> +/**
> +  Identify resource on given URI.
> +
> +  @param[in]   Schema  Redfish schema information.
> +  @param[in]   Uri The target URI to consume.
> +  @param[in]   InformationExchange Pointer to
> RESOURCE_INFORMATION_EXCHANGE.
> +
> +  @retval EFI_SUCCESS  This is target resource which we want to 
> handle.
> +  @retval EFI_UNSUPPORTED  This is not the target resource.
> +  @retval Others  

Re: [edk2-devel] [edk2-staging][PATCH v2 03/15] edk2-staging/RedfishClientPkg: Update Redfish Resource Config Protocol

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Yang, Atom
> ; Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 03/15] edk2-staging/RedfishClientPkg: Update
> Redfish Resource Config Protocol
> 
> [CAUTION: External Email]
> 
> Update Redfish resource config protocol to support Identify action in order to
> identify remote resource and see if this is resource belongs to current owner 
> or
> not. Use unicode string instead of ASCII string for all interfaces to align 
> with
> HTTP interface.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  .../EdkIIRedfishResourceConfigProtocol.h  | 29 +++
>  1 file changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtocol.h
> b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtocol.h
> index d6c41dda52..574c82c442 100644
> --- a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtocol.h
> +++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfigProtoc
> +++ ol.h
> @@ -1,7 +1,7 @@
>  /** @file
>This file defines the EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL interface.
> 
> -  (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -29,7 +29,7 @@ typedef
>  EFI_STATUS
>  (EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_PROVISIONING) (
>IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL  *This,
> -  IN CHAR8   *Uri,
> +  IN EFI_STRING  Uri,
>IN BOOLEAN HttpPostMode
>);
> 
> @@ -47,7 +47,7 @@ typedef
>  EFI_STATUS
>  (EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CONSUME) (
>IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL  *This,
> -  IN CHAR8   *Uri
> +  IN EFI_STRING  Uri
>);
> 
> 
> @@ -65,7 +65,7 @@ typedef
>  EFI_STATUS
>  (EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_UPDATE) (
>IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL  *This,
> -  IN CHAR8   *Uri
> +  IN EFI_STRING  Uri
>);
> 
> 
> @@ -83,7 +83,25 @@ typedef
>  EFI_STATUS
>  (EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CHECK) (
>IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL  *This,
> -  IN CHAR8   *Uri
> +  IN EFI_STRING  Uri
> +  );
> +
> +/**
> +  Identify resource on given URI.
> +
> +  @param[in]   ThisPointer to
> EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance.
> +  @param[in]   Uri The target URI to consume.
> +
> +  @retval EFI_SUCCESS  This is target resource which we want to 
> handle.
> +  @retval EFI_UNSUPPORTED  This is not the target resource.
> +  @retval Others   Some error happened.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_IDENTIFY) (
> +  IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL  *This,
> +  IN EFI_STRING  Uri
>);
> 
>  //
> @@ -121,6 +139,7 @@ struct
> _EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL {
>EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CONSUME  Consume;
>EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_UPDATE   Update;
>EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_CHECKCheck;
> +  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_IDENTIFY Identify;
>EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL_GET_INFO GetInfo;
>  };
> 
> --
> 2.32.0.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91830): https://edk2.groups.io/g/devel/message/91830
Mute This Topic: https://groups.io/mt/92596783/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-staging][PATCH v2 02/15] edk2-staging/RedfishClientPkg: Introduce Redfish version library

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Yang, Atom
> ; Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 02/15] edk2-staging/RedfishClientPkg:
> Introduce Redfish version library
> 
> [CAUTION: External Email]
> 
> Add RedfishVersionLib in order to get Redfish version hosted at BMC.
> When there is trouble to get Redfish support version, the default version is
> retrieved from pre-defined PCD value.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  .../Include/Library/RedfishVersionLib.h   |  30 +++
>  RedfishClientPkg/Include/RedfishBase.h|  21 ++
>  .../RedfishVersionLib/RedfishVersionLib.c | 203 ++
>  .../RedfishVersionLib/RedfishVersionLib.inf   |  50 +
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   1 +
>  RedfishClientPkg/RedfishClientPkg.dec |   4 +-
>  6 files changed, 308 insertions(+), 1 deletion(-)  create mode 100644
> RedfishClientPkg/Include/Library/RedfishVersionLib.h
>  create mode 100644 RedfishClientPkg/Include/RedfishBase.h
>  create mode 100644
> RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
>  create mode 100644
> RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
> 
> diff --git a/RedfishClientPkg/Include/Library/RedfishVersionLib.h
> b/RedfishClientPkg/Include/Library/RedfishVersionLib.h
> new file mode 100644
> index 00..319f22bd37
> --- /dev/null
> +++ b/RedfishClientPkg/Include/Library/RedfishVersionLib.h
> @@ -0,0 +1,30 @@
> +/** @file
> +  This file defines the Redfish version Library interface.
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef REDFISH_VERSION_LIB_H_
> +#define REDFISH_VERSION_LIB_H_
> +
> +/**
> +  Query HTTP request to BMC with given redfish service and return
> +redfish
> +  version information. If there is troulbe to get Redfish version on
> +BMC,
> +  The value of PcdDefaultRedfishVersion is returned.
> +
> +  It's call responsibility to release returned buffer.
> +
> +  @param[in]   Service  Redfish service instance
> +
> +  @retval EFI_STRING  Redfish version string. NULL while error occurs.
> +
> +**/
> +EFI_STRING
> +RedfishGetVersion (
> +  IN REDFISH_SERVICE  *Service
> +  );
> +
> +#endif
> diff --git a/RedfishClientPkg/Include/RedfishBase.h
> b/RedfishClientPkg/Include/RedfishBase.h
> new file mode 100644
> index 00..cf320bb0eb
> --- /dev/null
> +++ b/RedfishClientPkg/Include/RedfishBase.h
> @@ -0,0 +1,21 @@
> +/** @file
> +  Redfish base header file.
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EFI_REDFISH_BASE_H_
> +#define EFI_REDFISH_BASE_H_
> +
> +#define IS_EMPTY_STRING(a)((a) == NULL || (a)[0] == '\0')
> +#define REDFISH_DEBUG_TRACE   DEBUG_INFO
> +
> +///
> +/// This GUID is used for an EFI Variable that stores the Redfish data.
> +///
> +EFI_GUID mRedfishVariableGuid = {0x91c46a3d, 0xed1a, 0x477b, {0xa5,
> +0x33, 0x87, 0x2d, 0xcd, 0xb0, 0xfc, 0xc1}};
> +
> +#endif
> diff --git a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
> b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
> new file mode 100644
> index 00..0a2ace7726
> --- /dev/null
> +++ b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
> @@ -0,0 +1,203 @@
> +/** @file
> +  Redfish version library implementation
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include  #include
> +
> +
> +#define REDFISH_VERSION_DEFAULT_STRING L"v1"
> +#define REDFISH_ROOT_URI   "/redfish"
> +
> +REDFISH_SERVICE *mCacheService;
> +EFI_STRING  mVersionCache;
> +UINTN   mVersionStringSize;
> +
> +/**
> +  Cache the redfish service version for later use so we don't have to
> +query
> +  HTTP request everytime.
> +
> +  @param[in]   Service  Redfish service instance
> +  @param[in]   Version  Version string to cache
> +
> +  @retval EFI_SUCCESS   Version is saved in cache successfully.
> +  @retval Others
> +
> +**/
> +EFI_STATUS
> +CacheVersion (
> +  IN REDFISH_SERVICE  *Service,
> +  IN EFI_STRING   Version
> +  )
> +{
> +  if (Service == NULL || IS_EMPTY_STRING (Version)) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  if (mCacheService == Service) {
> +return EFI_ALREADY_STARTED;
> +  }
> +
> +  mCacheService = Service;
> +  if (mVersionCache != NULL) {
> +FreePool (mVersionCache);
> +  }
> +
> +  mVersionStringSize = StrSize (Version);  mVersionCache =
> + AllocateCopyPool (mVersionStringSize, Version);  if (mVersionCache 

Re: [edk2-devel] [edk2-staging][PATCH v2 01/15] edk2-staging/RedfishClientPkg: Introduce Redfish event library

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Yang, Atom
> ; Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 01/15] edk2-staging/RedfishClientPkg:
> Introduce Redfish event library
> 
> [CAUTION: External Email]
> 
> Add RedfishEventLib to handle Redfish event. There are two events defined in
> this library. One is the event before feature driver provisioning and the 
> other one
> is the event after all provisioning is finished.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  .../Include/Guid/RedfishClientEventGroup.h|  27 
>  .../Include/Library/RedfishEventLib.h |  77 ++
>  .../Library/RedfishEventLib/RedfishEventLib.c | 139 ++
>  .../RedfishEventLib/RedfishEventLib.inf   |  42 ++
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   1 +
>  RedfishClientPkg/RedfishClientPkg.dec |   5 +
>  6 files changed, 291 insertions(+)
>  create mode 100644 RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
>  create mode 100644 RedfishClientPkg/Include/Library/RedfishEventLib.h
>  create mode 100644
> RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
>  create mode 100644
> RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
> 
> diff --git a/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
> b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
> new file mode 100644
> index 00..0d88dd4726
> --- /dev/null
> +++ b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
> @@ -0,0 +1,27 @@
> +/** @file
> +  GUID for Redfish Client Event Group GUID
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef REDFISH_CLIENT_EVENT_GROUP_GUID_H_
> +#define REDFISH_CLIENT_EVENT_GROUP_GUID_H_
> +
> +#define REDFISH_CLIENT_FEATURE_READY_TO_PROVISIONING_GUID \
> +  { \
> +0x77E4FC1C, 0x2428, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D,
> +0x4E, 0xF0 } \
> +  }
> +
> +extern EFI_GUID gEfiRedfishClientFeatureReadyToProvisioningGuid;
> +
> +#define REDFISH_CLIENT_FEATURE_AFTER_PROVISIONING_GUID \
> +  { \
> +0xE547CB6F, 0x306F, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1,
> +0x2E, 0xD0 } \
> +  }
> +
> +extern EFI_GUID gEfiRedfishClientFeatureAfterProvisioningGuid;
> +
> +#endif
> diff --git a/RedfishClientPkg/Include/Library/RedfishEventLib.h
> b/RedfishClientPkg/Include/Library/RedfishEventLib.h
> new file mode 100644
> index 00..1f3d0acf19
> --- /dev/null
> +++ b/RedfishClientPkg/Include/Library/RedfishEventLib.h
> @@ -0,0 +1,77 @@
> +/** @file
> +  This file defines the Redfish event library interface.
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef REDFISH_EVENT_LIB_H_
> +#define REDFISH_EVENT_LIB_H_
> +
> +#include 
> +
> +/**
> +  Create an EFI event before Redfish provisioning start.
> +
> +  @param  NotifyFunctionThe notification function to call when 
> the
> event is signaled.
> +  @param  NotifyContext The content to pass to NotifyFunction 
> when
> the event is signaled.
> +  @param  ReadyToProvisioningEvent  Returns the EFI event returned from
> gBS->CreateEvent(Ex).
> +
> +  @retval EFI_SUCCESS   Event was created.
> +  @retval Other Event was not created.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +CreateReadyToProvisioningEvent (
> +  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL
> +  IN  VOID  *NotifyContext,  OPTIONAL
> +  OUT EFI_EVENT *ReadyToProvisioningEvent
> +  );
> +
> +/**
> +  Create an EFI event after Redfish provisioning finished.
> +
> +  @param  NotifyFunctionThe notification function to call when 
> the
> event is signaled.
> +  @param  NotifyContext The content to pass to NotifyFunction 
> when
> the event is signaled.
> +  @param  ReadyToProvisioningEvent  Returns the EFI event returned from
> gBS->CreateEvent(Ex).
> +
> +  @retval EFI_SUCCESS   Event was created.
> +  @retval Other Event was not created.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +CreateAfterProvisioningEvent (
> +  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL
> +  IN  VOID  *NotifyContext,  OPTIONAL
> +  OUT EFI_EVENT *ReadyToProvisioningEvent
> +  );
> +
> +/**
> +  Signal ready to provisioning event.
> +
> +  @retval EFI_SUCCESS   Event was created.
> +  @retval Other Event was not created.
> +
> +**/
> +EFI_STATUS
> +SignalReadyToProvisioningEvent (
> +  IN VOID
> +  );
> +
> +/**
> +  Signal after provisioning event.
> +
> +  @retval EFI_SUCCESS   Event was created.
> +  @retval Other Event was not created.
> +
> +**/
> +EFI_STATUS
> +SignalAfterProvisioningEvent (
> +  IN VOID

[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - 07/26/2022 #cal-reminder

2022-07-25 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
07/26/2022
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

*Organizer:* Liming Gao gaolim...@byosoft.com.cn ( 
gaolim...@byosoft.com.cn?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO
 )

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1262377 )

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d
 )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions ( 
https://conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=test_call
 )

*Or call in (audio only)*

+1 916-245-6934,,77463821# ( tel:+19162456934,,77463821# ) United States, 
Sacramento

Phone Conference ID: 774 638 21#

Find a local number ( 
https://dialin.teams.microsoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821
 ) | Reset PIN ( https://mysettings.lync.com/pstnconferencing )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US
 )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91827): https://edk2.groups.io/g/devel/message/91827
Mute This Topic: https://groups.io/mt/92619167/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v4 05/21] MdePkg/TrngLib: Definition for TRNG library class interface

2022-07-25 Thread Yao, Jiewen
Hi
Please allow me to clarify the position of this library class.

In this library header file, there are 4 references:

  - [1] Arm True Random Number Generator Firmware, Interface 1.0,
Platform Design Document.
(https://developer.arm.com/documentation/den0098/latest/)
  - [2] NIST Special Publication 800-90A Revision 1, June 2015, Recommendation
for Random Number Generation Using Deterministic Random Bit Generators.
(https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final)
  - [3] NIST Special Publication 800-90B, Recommendation for the Entropy
Sources Used for Random Bit Generation.
(https://csrc.nist.gov/publications/detail/sp/800-90b/final)
  - [4] (Second Draft) NIST Special Publication 800-90C, Recommendation for
Random Bit Generator (RBG) Constructions.
(https://csrc.nist.gov/publications/detail/sp/800-90c/draft)

To me, the API definition only seems align with [1] with some adjustment. 
But I am not clear how that is related to [2], [3], and [4].

Question: Is this library class only for ARM TRNG firmware? Or is this generic 
to follow [2], [3], [4]?

Assuming this is for ARM TRNG only, I suggest to remove [2], [3], [4], in the 
library *class* definition.
You can still put [2], [3], [4] in library *instance*, as the implementation 
reference.

More specific, this is *TRNG* class, I think only [3] is related.
I am not clear how [2] and [4] are involved. If you can explain a little bit, 
that would be good.


Thank you
Yao, Jiewen


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> PierreGondois
> Sent: Friday, July 22, 2022 10:32 PM
> To: devel@edk2.groups.io
> Cc: Sami Mujawar ; Leif Lindholm
> ; Ard Biesheuvel ;
> Rebecca Cran ; Kinney, Michael D
> ; Gao, Liming ; Yao,
> Jiewen ; Wang, Jian J ; Pierre
> Gondois 
> Subject: [edk2-devel] [PATCH v4 05/21] MdePkg/TrngLib: Definition for TRNG
> library class interface
> 
> From: Sami Mujawar 
> 
> Bugzilla: 3668 (https://bugzilla.tianocore.org/show_bug.cgi?id=3668)
> 
> The NIST Special Publications 800-90A, 800-90B and 800-90C
> provide recommendations for random number generation. The
> NIST 800-90C, Recommendation for Random Bit Generator (RBG)
> Constructions, defines the GetEntropy() interface that is
> used to access the entropy source. The GetEntropy() interface
> is further used by Deterministic Random Bit Generators (DRBG)
> to generate random numbers.
> 
> The True Random Number Generator (TRNG) library defines an
> interface to access the entropy source on a platform. Some
> platforms/architectures may provide access to the entropy
> using a firmware interface. In such cases the TRNG library
> shall be used to provide an abstraction.
> 
> Signed-off-by: Sami Mujawar 
> ---
>  MdePkg/Include/Library/TrngLib.h | 121 +++
>  MdePkg/MdePkg.dec|   5 ++
>  2 files changed, 126 insertions(+)
>  create mode 100644 MdePkg/Include/Library/TrngLib.h
> 
> diff --git a/MdePkg/Include/Library/TrngLib.h
> b/MdePkg/Include/Library/TrngLib.h
> new file mode 100644
> index ..a6f165b1f918
> --- /dev/null
> +++ b/MdePkg/Include/Library/TrngLib.h
> @@ -0,0 +1,121 @@
> +/** @file
> +  TRNG interface library definitions.
> +
> +  Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +  @par Reference(s):
> +  - [1] Arm True Random Number Generator Firmware, Interface 1.0,
> +Platform Design Document.
> +(https://developer.arm.com/documentation/den0098/latest/)
> +  - [2] NIST Special Publication 800-90A Revision 1, June 2015,
> Recommendation
> +for Random Number Generation Using Deterministic Random Bit
> Generators.
> +(https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final)
> +  - [3] NIST Special Publication 800-90B, Recommendation for the Entropy
> +Sources Used for Random Bit Generation.
> +(https://csrc.nist.gov/publications/detail/sp/800-90b/final)
> +  - [4] (Second Draft) NIST Special Publication 800-90C, Recommendation for
> +Random Bit Generator (RBG) Constructions.
> +(https://csrc.nist.gov/publications/detail/sp/800-90c/draft)
> +
> +  @par Glossary:
> +- TRNG - True Random Number Generator
> +**/
> +
> +#ifndef TRNG_LIB_H_
> +#define TRNG_LIB_H_
> +
> +/** Get the version of the TRNG backend.
> +
> +  A TRNG may be implemented by the system firmware, in which case this
> +  function shall return the version of the TRNG backend.
> +  The implementation must return NOT_SUPPORTED if a Back end is not present.
> +
> +  @param [out]  MajorRevision Major revision.
> +  @param [out]  MinorRevision Minor revision.
> +
> +  @retval  RETURN_SUCCESSThe function completed successfully.
> +  @retval  RETURN_INVALID_PARAMETER  Invalid parameter.
> +  @retval  RETURN_UNSUPPORTEDBackend not present.
> +**/
> +RETURN_STATUS
> +EFIAPI
> 

[edk2-devel] Now: Tools, CI, Code base construction meeting series - 07/25/2022 #cal-notice

2022-07-25 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
07/25/2022
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1542977 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91825): https://edk2.groups.io/g/devel/message/91825
Mute This Topic: https://groups.io/mt/92617369/21656
Mute #cal-notice:https://edk2.groups.io/g/devel/mutehashtag/cal-notice
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to support selection of CryptoDxe driver

2022-07-25 Thread Hsieh, PaytonX
PR create : https://github.com/tianocore/edk2/pull/3138

-Original Message-
From: Dong, Guo  
Sent: Monday, July 25, 2022 11:29 PM
To: Hsieh, PaytonX ; devel@edk2.groups.io
Cc: Ni, Ray ; Lu, James ; Guo, Gua 

Subject: RE: [PATCH] UefiPayloadPkg: Add macro to support selection of 
CryptoDxe driver


Reviewed-by: Guo Dong 

-Original Message-
From: Hsieh, PaytonX  
Sent: Friday, July 22, 2022 12:02 AM
To: devel@edk2.groups.io
Cc: Hsieh, PaytonX ; Dong, Guo ; 
Ni, Ray ; Lu, James ; Guo, Gua 

Subject: [PATCH] UefiPayloadPkg: Add macro to support selection of CryptoDxe 
driver

From: PaytonX Hsieh 

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

Add CRYPTO_PROTOCOL_SUPPORT to decide CryptoDxe built into UPL.efi If 
CRYPTO_PROTOCOL_SUPPORT is true, BIOS will use crypto protocol instead of 
building OpensslLib into drivers.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: PaytonX Hsieh 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 10 ++  
UefiPayloadPkg/UefiPayloadPkg.fdf |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 5e947526b7..862d440b16 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -39,6 +39,7 @@
   DEFINE ATA_ENABLE   = TRUE   DEFINE SD_ENABLE
= TRUE   DEFINE PS2_MOUSE_ENABLE = TRUE+  DEFINE 
CRYPTO_PROTOCOL_SUPPORT  = FALSE   DEFINE SD_MMC_TIMEOUT   = 
100#@@ -189,8 +190,13 @@
   
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf   
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf+!if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf   
TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf+!else+  
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf+  
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf+!endif   
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf   
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf   
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf@@ -421,6 +427,7 @@
   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)   
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|180 +!if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family 
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY@@ -443,6 +450,7 @@
   gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY+!endif  
[PcdsPatchableInModule.X64]   
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)@@ 
-764,11 +772,13 @@
   #   # Misc   #+!if $(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
CryptoPkg/Driver/CryptoDxe.inf {
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf   }+!endif
#--   #  Build the shelldiff --git 
a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 5c055e61b3..afdd6447a7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -99,7 +99,9 @@ INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 INF 
MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
 INF 
MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
 +!if $(CRYPTO_PROTOCOL_SUPPORT) == TRUE INF 
CryptoPkg/Driver/CryptoDxe.inf+!endif !if $(SECURITY_STUB_ENABLE) == TRUE INF 
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif--
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91824): https://edk2.groups.io/g/devel/message/91824
Mute This Topic: https://groups.io/mt/92558123/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch v3 3/3] Maintainers.txt: Remove reviewer Harry Han

2022-07-25 Thread Andrew Fish via groups.io
Reviewed-by: Andrew Fish 

> On Jul 21, 2022, at 2:07 PM, Michael D Kinney  
> wrote:
> 
> Cc: Harry Han 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Signed-off-by: Michael D Kinney 
> Reviewed-by: Harry Han 
> ---
> Maintainers.txt | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index bc7caa12d8d9..0ea6b4041654 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -372,7 +372,6 @@ F: MdeModulePkg/Core/Pei/
> R: Dandan Bi  [dandanbi]
> R: Liming Gao  [lgao4]
> R: Debkumar De  [dde01]
> -R: Harry Han 
> R: Catharine West  [catharine-intl]
> 
> MdeModulePkg: Reset modules
> @@ -603,7 +602,6 @@ UefiCpuPkg: Sec related modules
> F: UefiCpuPkg/SecCore/
> F: UefiCpuPkg/ResetVector/
> R: Debkumar De  [dde01]
> -R: Harry Han 
> R: Catharine West  [catharine-intl]
> 
> UefiPayloadPkg
> -- 
> 2.32.0.windows.1
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91823): https://edk2.groups.io/g/devel/message/91823
Mute This Topic: https://groups.io/mt/92535867/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch v3 0/3] Update Maintainers.txt

2022-07-25 Thread Andrew Fish via groups.io
Reviewed-by: Andrew Fish 

> On Jul 21, 2022, at 2:07 PM, Michael D Kinney  
> wrote:
> 
> Cc: Anthony Perard 
> Cc: Julien Grall 
> Cc: Daniel Schaefer 
> Cc: Sean Rhodes 
> Cc: Debkumar De 
> Cc: Erdem Aktas 
> Cc: Harry Han 
> Cc: Gary Lin 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Signed-off-by: Michael D Kinney 
> 
> Michael D Kinney (3):
>  Maintainers.txt: Remove OvmfPkg/XenTimerDxe reference
>  Maintainers.txt: Add missing github ids
>  Maintainers.txt: Remove reviewer Harry Han
> 
> Maintainers.txt | 19 ---
> 1 file changed, 8 insertions(+), 11 deletions(-)
> 
> -- 
> 2.32.0.windows.1
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91822): https://edk2.groups.io/g/devel/message/91822
Mute This Topic: https://groups.io/mt/92535864/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Casting i128 into f64 in UEFI Rust pagefaults

2022-07-25 Thread Andrew Fish via groups.io
I guess I could at least dump to the end (req)…. Going backwards is a bit 
painful in x86. 

(lldb) dis -s 0x000140001B60 -b -c 30
hello_world_std.efi[0x140001b60]: 48 8b 09   movq   (%rcx), 
%rcx
hello_world_std.efi[0x140001b63]: 48 01 c1   addq   %rax, 
%rcx
hello_world_std.efi[0x140001b66]: 4c 89 c2   movq   %r8, 
%rdx
hello_world_std.efi[0x140001b69]: 48 11 c2   adcq   %rax, 
%rdx
hello_world_std.efi[0x140001b6c]: 48 31 c1   xorq   %rax, 
%rcx
hello_world_std.efi[0x140001b6f]: 48 31 c2   xorq   %rax, 
%rdx
hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80  movabsq 
$-0x8000, %rsi ; imm = 0x8000 
hello_world_std.efi[0x140001b7c]: 4c 21 c6   andq   %r8, 
%rsi
hello_world_std.efi[0x140001b7f]: e8 5c 55 00 00 callq  
0x1400070e0
hello_world_std.efi[0x140001b84]: 48 09 f0   orq%rsi, 
%rax
hello_world_std.efi[0x140001b87]: 48 83 c4 20addq   $0x20, 
%rsp
hello_world_std.efi[0x140001b8b]: 5e popq   %rsi
hello_world_std.efi[0x140001b8c]: c3 retq   
hello_world_std.efi[0x140001b8d]: cc int3   
hello_world_std.efi[0x140001b8e]: cc int3   
hello_world_std.efi[0x140001b8f]: cc int3   
hello_world_std.efi[0x140001b90]: e9 db 55 00 00 jmp
0x140007170
hello_world_std.efi[0x140001b95]: cc int3   
…

Then we can guess based on how functions get aligned to find the start….

hello_world_std.efi[0x140001b50]: 56   pushq  
%rsi
hello_world_std.efi[0x140001b51]: 48 83 ec 20  subq   
$0x20, %rsp
hello_world_std.efi[0x140001b55]: 4c 8b 41 08  movq   
0x8(%rcx), %r8
hello_world_std.efi[0x140001b59]: 4c 89 c0 movq   
%r8, %rax
hello_world_std.efi[0x140001b5c]: 48 c1 f8 3f  sarq   
$0x3f, %rax
hello_world_std.efi[0x140001b60]: 48 8b 09 movq   
(%rcx), %rcx
hello_world_std.efi[0x140001b63]: 48 01 c1 addq   
%rax, %rcx
hello_world_std.efi[0x140001b66]: 4c 89 c2 movq   
%r8, %rdx
hello_world_std.efi[0x140001b69]: 48 11 c2 adcq   
%rax, %rdx
hello_world_std.efi[0x140001b6c]: 48 31 c1 xorq   
%rax, %rcx
hello_world_std.efi[0x140001b6f]: 48 31 c2 xorq   
%rax, %rdx
hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80movabsq 
$-0x8000, %rsi ; imm = 0x8000 
hello_world_std.efi[0x140001b7c]: 4c 21 c6 andq   
%r8, %rsi
hello_world_std.efi[0x140001b7f]: e8 5c 55 00 00   callq  
0x1400070e0
hello_world_std.efi[0x140001b84]: 48 09 f0 orq
%rsi, %rax
hello_world_std.efi[0x140001b87]: 48 83 c4 20  addq   
$0x20, %rsp
hello_world_std.efi[0x140001b8b]: 5e   popq   
%rsi
hello_world_std.efi[0x140001b8c]: c3   retq   

So the faulting function is getting passed a bad pointer as its 1st arg. 

Thanks,

Andrew Fish

> On Jul 25, 2022, at 11:45 AM, Andrew Fish  wrote:
> 
> Ops… Looks like your PE/COFF is linked at 0x00014000, so 0x140001b60 
> is the interesting bit.
> 
> (lldb) dis -s 0x000140001B60 -b
> hello_world_std.efi[0x140001b60]: 48 8b 09   movq   
> (%rcx), %rcx
> hello_world_std.efi[0x140001b63]: 48 01 c1   addq   %rax, 
> %rcx
> hello_world_std.efi[0x140001b66]: 4c 89 c2   movq   %r8, 
> %rdx
> hello_world_std.efi[0x140001b69]: 48 11 c2   adcq   %rax, 
> %rdx
> hello_world_std.efi[0x140001b6c]: 48 31 c1   xorq   %rax, 
> %rcx
> hello_world_std.efi[0x140001b6f]: 48 31 c2   xorq   %rax, 
> %rdx
> hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80  movabsq 
> $-0x8000, %rsi ; imm = 0x8000 
> hello_world_std.efi[0x140001b7c]: 4c 21 c6   andq   %r8, 
> %rsi
> 
>  RCX - 
> 
> So yea that looks like the fault. 
> 
> I don’t see that pattern in your .s file…. 
> 
> Can you figure out what function is @ 0x140001b60 in the PE/COFF image. Do 
> you have a map file from the linker?
> 
> Thanks,
> 
> Andrew Fish
> 
> PS Again sorry I don’t have anything installed to crack PDB files. 
> 
> Thanks,
> 
> Andrew Fish
> 
>> On Jul 25, 2022, at 10:51 AM, Andrew Fish via groups.io 
>>  wrote:
>> 
>> Ayush,
>> 
>> CR2 is the fault address so 0x. Given for EFI Virt == 
>> Physical the fault address looks like a bad 

Re: [edk2-devel] Casting i128 into f64 in UEFI Rust pagefaults

2022-07-25 Thread Andrew Fish via groups.io
Ops… Looks like your PE/COFF is linked at 0x00014000, so 0x140001b60 is 
the interesting bit.

(lldb) dis -s 0x000140001B60 -b
hello_world_std.efi[0x140001b60]: 48 8b 09   movq   (%rcx), 
%rcx
hello_world_std.efi[0x140001b63]: 48 01 c1   addq   %rax, 
%rcx
hello_world_std.efi[0x140001b66]: 4c 89 c2   movq   %r8, 
%rdx
hello_world_std.efi[0x140001b69]: 48 11 c2   adcq   %rax, 
%rdx
hello_world_std.efi[0x140001b6c]: 48 31 c1   xorq   %rax, 
%rcx
hello_world_std.efi[0x140001b6f]: 48 31 c2   xorq   %rax, 
%rdx
hello_world_std.efi[0x140001b72]: 48 be 00 00 00 00 00 00 00 80  movabsq 
$-0x8000, %rsi ; imm = 0x8000 
hello_world_std.efi[0x140001b7c]: 4c 21 c6   andq   %r8, 
%rsi

 RCX - 

So yea that looks like the fault. 

I don’t see that pattern in your .s file…. 

Can you figure out what function is @ 0x140001b60 in the PE/COFF image. Do you 
have a map file from the linker?

Thanks,

Andrew Fish

PS Again sorry I don’t have anything installed to crack PDB files. 

Thanks,

Andrew Fish

> On Jul 25, 2022, at 10:51 AM, Andrew Fish via groups.io 
>  wrote:
> 
> Ayush,
> 
> CR2 is the fault address so 0x. Given for EFI Virt == 
> Physical the fault address looks like a bad pointer. 
> 
> Sorry I’ve not used VC++ in a long time so I don’t know how to debug with 
> VC++, but If I was using clang/lldb I’d look at the source and assembly for 
> the fault address. 
> 
> The image base is: 0x0603C000
> The fault PC/RIP is: 0603DB60
> 
> So the faulting code is at 0x1B60 in the image. Given the images are linked 
> at zero you should be able to load the build product into the debugger and 
> look at what code is at offset 0x1B60. The same should work for any tools 
> that dump the binary. 
> 
> Thanks,
> 
> Andrew Fish
> 
>> On Jul 25, 2022, at 10:33 AM, Ayush Singh  wrote:
>> 
>> Hello everyone.While running Rust tests in UEFI environment, I have come 
>> across a numeric test that causes a pagefault. A simple reproducible example 
>> for this is given below:
>> 
>> ```rust
>> 
>> fn main() {
>> use std::hint::black_box as b;
>> 
>> let z: i128 = b(1);
>> assert!((-z as f64) < 0.0);
>> }
>> 
>> ```
>> 
>> 
>> The exception output is as follows:
>> 
>> ```
>> 
>>  X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID -  
>> ExceptionData -   I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
>> RIP  - 0603DB60, CS  - 0038, RFLAGS - 0246
>> RAX  - , RCX - , RDX - 
>> RBX  - , RSP - 07EDF1D0, RBP - 07EDF4C0
>> RSI  - 07EDF360, RDI - 07EDF3C0
>> R8   - , R9  - 0038, R10 - 
>> R11  - , R12 - 060C6018, R13 - 07EDF520
>> R14  - 07EDF6A8, R15 - 05FA9490
>> DS   - 0030, ES  - 0030, FS  - 0030
>> GS   - 0030, SS  - 0030
>> CR0  - 80010033, CR2 - , CR3 - 07C01000
>> CR4  - 0668, CR8 - 
>> DR0  - , DR1 - , DR2 - 
>> DR3  - , DR6 - 0FF0, DR7 - 0400
>> GDTR - 079DE000 0047, LDTR - 
>> IDTR - 07418018 0FFF,   TR - 
>> FXSAVE_STATE - 07EDEE30
>>  Find image based on IP(0x603DB60) 
>> /var/home/ayush/Documents/Programming/Rust/uefi/hello_world_std/target/x86_64-unknown-uefi/debug/deps/hello_world_std-338028f9369e2d42.pdb
>>  (ImageBase=0603C000, EntryPoint=0603D8C0) 
>> 
>> ```
>> 
>> 
>> From my testing, the exception only occurs when a few conditions are met.
>> 
>> 1. The binary is compiled in Debug mode. No error in Release mode.
>> 
>> 2. `i128` is in a black_box [1]. Does not occur if `black_box` is not 
>> present.
>> 
>> 3. It has to be `i128`. `i64` or something else work fine.
>> 
>> 4. The cast has to be done on `-z`. Doing the same with `+z` is fine.
>> 
>> 
>> I have also been discussing this in the Rust zulipchat [2], so feel free to 
>> chime in there.
>> 
>> 
>> Additionally, here are links for more information about this program:
>> 
>> 1. Assembly: 
>> https://rust-lang.zulipchat.com/user_uploads/4715/od51Y9Dkfjahcg9HHcOud8Fm/hello_world_std-338028f9369e2d42.s
>> 
>> 2. EFI Binary: 
>> https://rust-lang.zulipchat.com/user_uploads/4715/CknqtXLR8SaJZmyOnXctQkpL/hello_world_std.efi
>> 
>> 3. PDB file: 
>> https://rust-lang.zulipchat.com/user_uploads/4715/zV4i6DsjgQXotp_gS1naEsU0/hello_world_std-338028f9369e2d42.pdb
>> 
>> 
>> Yours Sincerely,
>> 
>> Ayush Singh
>> 
>> 
>> [1]: https://doc.rust-lang.org/std/hint/fn.black_box.html
>> 
>> [2]: 
>> 

Re: [edk2-devel] Casting i128 into f64 in UEFI Rust pagefaults

2022-07-25 Thread Andrew Fish via groups.io
Ayush,

CR2 is the fault address so 0x. Given for EFI Virt == Physical 
the fault address looks like a bad pointer. 

Sorry I’ve not used VC++ in a long time so I don’t know how to debug with VC++, 
but If I was using clang/lldb I’d look at the source and assembly for the fault 
address. 

The image base is: 0x0603C000
The fault PC/RIP is: 0603DB60

So the faulting code is at 0x1B60 in the image. Given the images are linked at 
zero you should be able to load the build product into the debugger and look at 
what code is at offset 0x1B60. The same should work for any tools that dump the 
binary. 

Thanks,

Andrew Fish

> On Jul 25, 2022, at 10:33 AM, Ayush Singh  wrote:
> 
> Hello everyone.While running Rust tests in UEFI environment, I have come 
> across a numeric test that causes a pagefault. A simple reproducible example 
> for this is given below:
> 
> ```rust
> 
> fn main() {
> use std::hint::black_box as b;
> 
> let z: i128 = b(1);
> assert!((-z as f64) < 0.0);
> }
> 
> ```
> 
> 
> The exception output is as follows:
> 
> ```
> 
>  X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID -  
> ExceptionData -   I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
> RIP  - 0603DB60, CS  - 0038, RFLAGS - 0246
> RAX  - , RCX - , RDX - 
> RBX  - , RSP - 07EDF1D0, RBP - 07EDF4C0
> RSI  - 07EDF360, RDI - 07EDF3C0
> R8   - , R9  - 0038, R10 - 
> R11  - , R12 - 060C6018, R13 - 07EDF520
> R14  - 07EDF6A8, R15 - 05FA9490
> DS   - 0030, ES  - 0030, FS  - 0030
> GS   - 0030, SS  - 0030
> CR0  - 80010033, CR2 - , CR3 - 07C01000
> CR4  - 0668, CR8 - 
> DR0  - , DR1 - , DR2 - 
> DR3  - , DR6 - 0FF0, DR7 - 0400
> GDTR - 079DE000 0047, LDTR - 
> IDTR - 07418018 0FFF,   TR - 
> FXSAVE_STATE - 07EDEE30
>  Find image based on IP(0x603DB60) 
> /var/home/ayush/Documents/Programming/Rust/uefi/hello_world_std/target/x86_64-unknown-uefi/debug/deps/hello_world_std-338028f9369e2d42.pdb
>  (ImageBase=0603C000, EntryPoint=0603D8C0) 
> 
> ```
> 
> 
> From my testing, the exception only occurs when a few conditions are met.
> 
> 1. The binary is compiled in Debug mode. No error in Release mode.
> 
> 2. `i128` is in a black_box [1]. Does not occur if `black_box` is not present.
> 
> 3. It has to be `i128`. `i64` or something else work fine.
> 
> 4. The cast has to be done on `-z`. Doing the same with `+z` is fine.
> 
> 
> I have also been discussing this in the Rust zulipchat [2], so feel free to 
> chime in there.
> 
> 
> Additionally, here are links for more information about this program:
> 
> 1. Assembly: 
> https://rust-lang.zulipchat.com/user_uploads/4715/od51Y9Dkfjahcg9HHcOud8Fm/hello_world_std-338028f9369e2d42.s
> 
> 2. EFI Binary: 
> https://rust-lang.zulipchat.com/user_uploads/4715/CknqtXLR8SaJZmyOnXctQkpL/hello_world_std.efi
> 
> 3. PDB file: 
> https://rust-lang.zulipchat.com/user_uploads/4715/zV4i6DsjgQXotp_gS1naEsU0/hello_world_std-338028f9369e2d42.pdb
> 
> 
> Yours Sincerely,
> 
> Ayush Singh
> 
> 
> [1]: https://doc.rust-lang.org/std/hint/fn.black_box.html
> 
> [2]: 
> https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Casting.20i128.20to.20f64.20in.20black_box.20causes.20exception.20in.20UEFI
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91819): https://edk2.groups.io/g/devel/message/91819
Mute This Topic: https://groups.io/mt/92610101/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Casting i128 into f64 in UEFI Rust pagefaults

2022-07-25 Thread Ayush Singh
Hello everyone.While running Rust tests in UEFI environment, I have come 
across a numeric test that causes a pagefault. A simple reproducible 
example for this is given below:


```rust

fn main() {
    use std::hint::black_box as b;

    let z: i128 = b(1);
    assert!((-z as f64) < 0.0);
}

```


The exception output is as follows:

```

 X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID -  
ExceptionData -   I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
RIP  - 0603DB60, CS  - 0038, RFLAGS - 0246
RAX  - , RCX - , RDX - 
RBX  - , RSP - 07EDF1D0, RBP - 07EDF4C0
RSI  - 07EDF360, RDI - 07EDF3C0
R8   - , R9  - 0038, R10 - 
R11  - , R12 - 060C6018, R13 - 07EDF520
R14  - 07EDF6A8, R15 - 05FA9490
DS   - 0030, ES  - 0030, FS  - 0030
GS   - 0030, SS  - 0030
CR0  - 80010033, CR2 - , CR3 - 07C01000
CR4  - 0668, CR8 - 
DR0  - , DR1 - , DR2 - 
DR3  - , DR6 - 0FF0, DR7 - 0400
GDTR - 079DE000 0047, LDTR - 
IDTR - 07418018 0FFF,   TR - 
FXSAVE_STATE - 07EDEE30
 Find image based on IP(0x603DB60) 
/var/home/ayush/Documents/Programming/Rust/uefi/hello_world_std/target/x86_64-unknown-uefi/debug/deps/hello_world_std-338028f9369e2d42.pdb 
(ImageBase=0603C000, EntryPoint=0603D8C0) 


```


From my testing, the exception only occurs when a few conditions are met.

1. The binary is compiled in Debug mode. No error in Release mode.

2. `i128` is in a black_box [1]. Does not occur if `black_box` is not 
present.


3. It has to be `i128`. `i64` or something else work fine.

4. The cast has to be done on `-z`. Doing the same with `+z` is fine.


I have also been discussing this in the Rust zulipchat [2], so feel free 
to chime in there.



Additionally, here are links for more information about this program:

1. Assembly: 
https://rust-lang.zulipchat.com/user_uploads/4715/od51Y9Dkfjahcg9HHcOud8Fm/hello_world_std-338028f9369e2d42.s


2. EFI Binary: 
https://rust-lang.zulipchat.com/user_uploads/4715/CknqtXLR8SaJZmyOnXctQkpL/hello_world_std.efi


3. PDB file: 
https://rust-lang.zulipchat.com/user_uploads/4715/zV4i6DsjgQXotp_gS1naEsU0/hello_world_std-338028f9369e2d42.pdb



Yours Sincerely,

Ayush Singh


[1]: https://doc.rust-lang.org/std/hint/fn.black_box.html

[2]: 
https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Casting.20i128.20to.20f64.20in.20black_box.20causes.20exception.20in.20UEFI




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91818): https://edk2.groups.io/g/devel/message/91818
Mute This Topic: https://groups.io/mt/92610101/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 3/3] LogoFeaturePkg,BoardModulePkg: Set existing logo as BGRT

2022-07-25 Thread Benjamin Doron
In MinPlatform, FSP-S displays the logo to the user early. However, this
means that no BGRT is written either. To reduce duplication in the flash
image, a new LogoDxe will set this BMP as the BGRT buffer. The previous
LogoDxe drivers here, along with a BootLogoEnableLogo() patch to BDS
libraries, would begin displaying the Intel logo over the board FDF's
choice - presently, these are the TianoCore logo.

Also begin using BootLogoUpdateProgress().

Tested on KabylakeOpenBoardPkg, the boot logo becomes also a BGRT logo.

A follow-up patch can be considered to set all platforms to use Intel's
logo.

Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Ankit Sinha 
Cc: Eric Dong 
Cc: Dandan Bi 
Cc: Liming Gao 
Signed-off-by: Benjamin Doron 
---
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc  
   |   8 -
 Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
   |   6 +-
 Features/Intel/UserInterface/LogoFeaturePkg/Include/PostMemory.fdf 
   |   6 +-
 Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/JpegLogo.idf   
   |  10 --
 Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/JpegLogoDxe.inf
   |  52 --
 Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/Logo.c 
   | 183 +++-
 Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/Logo.idf   
   |  10 --
 Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/Logo.jpg   
   | Bin 9741 -> 0 bytes
 Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/LogoDxe.inf
   |  24 ++-
 Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec 
   |   2 +-
 Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc 
   |   3 -
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
   |   3 +-
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf  
   |   1 +
 Platform/Intel/BoardModulePkg/Library/BoardBootManagerLib/BoardBootManager.c   
   |  31 
 
Platform/Intel/BoardModulePkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf
 |   5 +
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
   |   1 +
 16 files changed, 120 insertions(+), 225 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
index 5365f0a1b844..da663f5c833f 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
@@ -77,11 +77,3 @@
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable  
|FALSE
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1  
|FALSE
   gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable  
|FALSE
-
-#
-# There seems to be some build parsing odd behavior that requires this PCD to 
be specified even though
-# the *.fdf that consumes it is dependent on the feature flag.
-# This section is to ensure that boards have these PCD instantiated.
-#
-[PcdsFeatureFlag]
-  gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable  
|FALSE
diff --git 
a/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc 
b/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
index 0acce1c7dfaf..3e990a84f8ec 100644
--- a/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
+++ b/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
@@ -47,8 +47,4 @@
 # @todo: Change below line to [Components.$(DXE_ARCH)] after 
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
 #is completed.
 [Components.X64]
-  !if gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable == TRUE
-LogoFeaturePkg/LogoDxe/JpegLogoDxe.inf
-  !else
-LogoFeaturePkg/LogoDxe/LogoDxe.inf
-  !endif
+  LogoFeaturePkg/LogoDxe/LogoDxe.inf
diff --git a/Features/Intel/UserInterface/LogoFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/UserInterface/LogoFeaturePkg/Include/PostMemory.fdf
index fead9f3b0298..f8e368434f72 100644
--- a/Features/Intel/UserInterface/LogoFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/UserInterface/LogoFeaturePkg/Include/PostMemory.fdf
@@ -6,8 +6,4 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
-!if gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable == TRUE
-  INF LogoFeaturePkg/LogoDxe/JpegLogoDxe.inf
-!else
-  INF LogoFeaturePkg/LogoDxe/LogoDxe.inf
-!endif
+INF LogoFeaturePkg/LogoDxe/LogoDxe.inf
diff --git a/Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/JpegLogo.idf 
b/Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/JpegLogo.idf
deleted file mode 100644
index a39500e043e3..
--- a/Features/Intel/UserInterface/LogoFeaturePkg/LogoDxe/JpegLogo.idf
+++ /dev/null
@@ -1,10 +0,0 @@
-// /** @file
-// Platform Logo image definition file.
-//
-// Copyright (c) 2020, 

[edk2-devel] [PATCH v1 2/3] UserAuthFeaturePkg: Included DXE versions are mutually exclusive

2022-07-25 Thread Benjamin Doron
Versions of the DXE module perform nearly identical functions, and are
therefore mutually exclusive. Including both modules results in at least
a duplicate HII package and an "already started" assert.

Therefore, add a new PCD to determine which module will be included.
However, now a second bug can be seen: version 2 does not challenge for
the password. An RSC handler to hook UiApp entry is probably needed, as
in version 1.

Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Ankit Sinha 
Cc: Liming Gao 
Cc: Dandan Bi 
Signed-off-by: Benjamin Doron 
---
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc| 
1 +
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc   | 
1 +
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf  | 
9 ++---
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 
3 +++
 Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec  | 
3 ++-
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc 
b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 908fe4d1f7a9..8924dadcaa18 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -79,6 +79,7 @@
   #
   gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable
|TRUE
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable  
|TRUE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1  
|FALSE
   gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable  
|TRUE
 
 #
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
index d59e3e61b9b9..5365f0a1b844 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
@@ -75,6 +75,7 @@
 
   gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable
|FALSE
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable  
|FALSE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1  
|FALSE
   gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable  
|FALSE
 
 #
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
index 030dcbe763d8..827deb08de7e 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
@@ -7,6 +7,9 @@
 #
 ##
 
-INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
-INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
-INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
+!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 == TRUE
+  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+!else
+  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+!endif
+  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
index 2f39a5580caf..022678d5c852 100644
--- 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
+++ 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
@@ -72,6 +72,9 @@
   UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf
 
   # Add components here that should be included in the package build.
+!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1 == TRUE
   UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+!else
   UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+!endif
   UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
index a9174edd5486..209a0ba6a6c7 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
@@ -38,8 +38,9 @@
   gUserAuthenticationGuid = { 0xee24a7f7, 0x606b, 0x4724, { 0xb3, 0xc9, 0xf5, 
0xae, 0x4a, 0x3b, 0x81, 0x65}}
 
 [PcdsFeatureFlag]
-  ## This PCD specifies whether StatusCode is reported via USB3 Serial port.
+  ## This PCD specifies whether user authentication feature is enabled.
   
gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable|FALSE|BOOLEAN|0xA001
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUseVersion1|FALSE|BOOLEAN|0xA002
 
 

[edk2-devel] [PATCH v1 1/3] AcpiDebugFeaturePkg: Included modules are mutually exclusive

2022-07-25 Thread Benjamin Doron
The DXE and SMM versions of AcpiDebug perform the same task and
are therefore mutually exclusive. Including both modules results in a
duplicate ACPI table, resulting in the feature not working at all.

Therefore, add a new PCD to determine which module will be included.
Now, either version successfully write to the debug buffer.

Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Ankit Sinha 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Benjamin Doron 
---
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc  | 1 +
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 1 +
 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c  | 4 

 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec  | 1 +
 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 3 
+++
 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf   | 7 
+--
 6 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc 
b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 28530b8c674b..908fe4d1f7a9 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -48,6 +48,7 @@
   # Debugging features
   #
   gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable  
|TRUE
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion   
|FALSE
   gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable  
|TRUE
   gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable  
|TRUE
   gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable  
|TRUE
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
index e214175edaf7..d59e3e61b9b9 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
@@ -59,6 +59,7 @@
 #
 [PcdsFeatureFlag]
   gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable  
|FALSE
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion   
|FALSE
   gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable  
|FALSE
   gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable  
|FALSE
   gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable  
|FALSE
diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c
index 4caeffc7dec9..0b28e2f7a6d5 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c
@@ -483,6 +483,10 @@ InitializeAcpiDebugSmm (
   EFI_SMM_BASE2_PROTOCOL*SmmBase2;
   BOOLEAN   InSmm;
 
+  if (!PcdGetBool (PcdAcpiDebugFeatureActive)) {
+return EFI_SUCCESS;
+  }
+
   Status = gBS->LocateProtocol (, NULL, (VOID **) 
);
   ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec
index 915923100731..1a290bab29d9 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec
@@ -28,6 +28,7 @@
 
 [PcdsFeatureFlag]
   
gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|FALSE|BOOLEAN|0xA001
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion|FALSE|BOOLEAN|0xA002
 
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This PCD specifies the ACPI debug message buffer size.
diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
index f5b8bacee039..684549bbdd78 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
@@ -54,5 +54,8 @@
   # in the package build.
 
   # Add components here that should be included in the package build.
+!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdUseSmmVersion == FALSE
   AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf
+!else
   AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf
+!endif
diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
index 855826292cb5..e904a2f8fbf2 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
@@ -7,5 +7,8 @@
 #
 ##
 
-INF 

Re: [edk2-devel] [PATCH v2] BaseTools/VolInfo: Show encapsulation sections

2022-07-25 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: Konstantin Aladyshev  
Sent: Tuesday, July 19, 2022 8:29 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Chen, Christine ; Konstantin Aladyshev 

Subject: [PATCH v2] BaseTools/VolInfo: Show encapsulation sections

Currently there is no labels for start and end of the encapsulation sections. 
Therefore it is not possible to see where the encapsulation section ends and 
another section starts.
Add labels for start and end of encapsulation sections to fix the issue.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c 
b/BaseTools/Source/C/VolInfo/VolInfo.c
index c1f81f2dcb..ce1775f7fd 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1903,7 +1903,9 @@ Returns:
 return EFI_SECTION_ERROR;   } +  printf ("/ 
Encapsulation section start -\\\n");   Status = 
ParseSection (UncompressedBuffer, UncompressedLength);+  printf 
("\\ Encapsulation section end ---/\n");if 
(CompressionType == EFI_STANDARD_COMPRESSION) { //@@ -2022,6 +2024,7 @@ 
Returns:
   return EFI_SECTION_ERROR; } +printf ("/ 
Encapsulation section start -\\\n"); Status = 
ParseSection (   ToolOutputBuffer,   
ToolOutputLength@@ -2030,6 +2033,7 @@ Returns:
   Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", 
NULL);   return EFI_SECTION_ERROR; }+printf 
("\\ Encapsulation section end ---/\n");//  
 // Check for CRC32 sections which we can handle internally if needed.@@ 
-2042,6 +2046,7 @@ Returns:
 // // CRC32 guided section //+printf 
("/ Encapsulation section start -\\\n"); 
Status = ParseSection (   SectionBuffer + DataOffset,   
BufferLength - DataOffset@@ -2050,6 +2055,7 @@ Returns:
   Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL); 
  return EFI_SECTION_ERROR; }+printf ("\\ 
Encapsulation section end ---/\n");   } else { //   
  // We don't know how to parse it now.-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91814): https://edk2.groups.io/g/devel/message/91814
Mute This Topic: https://groups.io/mt/92481203/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] BaseTools/GenFds: Correct file type set for the PIC section

2022-07-25 Thread Konstantin Aladyshev
Corrently the set of file types for the PIC section contains two
duplicate values.
Replace the duplicate value with the correct one to fix the issue.

Signed-off-by: Konstantin Aladyshev 
---
 BaseTools/Source/Python/GenFds/FdfParser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py 
b/BaseTools/Source/Python/GenFds/FdfParser.py
index aa18fef09e..a9a14ca2bb 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -4018,7 +4018,7 @@ class FdfParser:
 if FileType not in {BINARY_FILE_TYPE_PE32, "SEC_PE32"}:
 raise Warning(WarningString % FileType, self.FileName, 
self.CurrentLineNumber)
 elif SectionType == BINARY_FILE_TYPE_PIC:
-if FileType not in {BINARY_FILE_TYPE_PIC, BINARY_FILE_TYPE_PIC}:
+if FileType not in {BINARY_FILE_TYPE_PIC, "SEC_PIC"}:
 raise Warning(WarningString % FileType, self.FileName, 
self.CurrentLineNumber)
 elif SectionType == BINARY_FILE_TYPE_TE:
 if FileType not in {BINARY_FILE_TYPE_TE, "SEC_TE"}:
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91813): https://edk2.groups.io/g/devel/message/91813
Mute This Topic: https://groups.io/mt/92607300/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v4] BaseTools/Capsule: Support signtool input subject name to sign capsule file

2022-07-25 Thread Lin, Jason1
From: Jason1 Lin 

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

Windows-based system using signtool.exe to sign the capsule.
Add the support to using "--subject-name" argument to assign
the subject name used to sign the capsule file.
This argument would pass to signtool.exe as a part of input
argument with "/n" flag.

NOTE: If using signtool.exe to sign capsule at least need to
  choose one of "--pfx-file" and "--subject-name"
  argument to input the value.

Signed-off-by: Jason1 Lin 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Michael D Kinney 
Cc: Dakota Chiang 
---
 BaseTools/Source/Python/Capsule/GenerateCapsule.py | 43 
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py 
b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
index b8039db878..35435946c6 100644
--- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
+++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
@@ -10,7 +10,7 @@
 # keep the tool as simple as possible, it has the following limitations:
 #   * Do not support vendor code bytes in a capsule.
 #
-# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2018 - 2022, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -38,11 +38,11 @@ from Common.Edk2.Capsule.FmpPayloadHeader  import 
FmpPayloadHeaderClass
 # Globals for help information
 #
 __prog__= 'GenerateCapsule'
-__version__ = '0.9'
-__copyright__   = 'Copyright (c) 2018, Intel Corporation. All rights reserved.'
+__version__ = '0.10'
+__copyright__   = 'Copyright (c) 2022, Intel Corporation. All rights reserved.'
 __description__ = 'Generate a capsule.\n'
 
-def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
+def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = 
False):
 #
 # Create a temporary directory
 #
@@ -72,7 +72,10 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose 
= False):
 Command = Command + '"{Path}" '.format (Path = os.path.join (ToolPath, 
'signtool.exe'))
 Command = Command + 'sign /fd sha256 /p7ce DetachedSignedData /p7co 
1.2.840.113549.1.7.2 '
 Command = Command + '/p7 {TempDir} '.format (TempDir = TempDirectoryName)
-Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
+if PfxFile is not None:
+Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
+if SubjectName is not None:
+Command = Command + '/n {SubjectName} '.format (SubjectName = 
SubjectName)
 Command = Command + TempFileName
 if Verbose:
 print (Command)
@@ -105,7 +108,7 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, 
Verbose = False):
 shutil.rmtree (TempDirectoryName)
 return Signature
 
-def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, Verbose = 
False):
+def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, SubjectName, 
Verbose = False):
 print ('signtool verify is not supported.')
 raise ValueError ('GenerateCapsule: error: signtool verify is not 
supported.')
 
@@ -249,6 +252,7 @@ if __name__ == '__main__':
 HardwareInstance = ConvertJsonValue (Config, 
'HardwareInstance', ValidateUnsignedInteger, Required = False, Default = 0)
 MonotonicCount   = ConvertJsonValue (Config, 
'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
 SignToolPfxFile  = ConvertJsonValue (Config, 
'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = 
True)
+SignToolSubjectName  = ConvertJsonValue (Config, 
'SignToolSubjectName', os.path.expandvars, Required = False, Default = None, 
Open = True)
 OpenSslSignerPrivateCertFile = ConvertJsonValue (Config, 
'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)
 OpenSslOtherPublicCertFile   = ConvertJsonValue (Config, 
'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)
 OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 
'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)
@@ -264,6 +268,7 @@ if __name__ == '__main__':
 HardwareInstance,
 UpdateImageIndex,
 SignToolPfxFile,
+SignToolSubjectName,
 OpenSslSignerPrivateCertFile,
 OpenSslOtherPublicCertFile,
 OpenSslTrustedPublicCertFile,
@@ -303,6 +308,7 @@ if __name__ == '__main__':
 UpdateImageIndex = ConvertJsonValue (Config, 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to support selection of CryptoDxe driver

2022-07-25 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Hsieh, PaytonX  
Sent: Friday, July 22, 2022 12:02 AM
To: devel@edk2.groups.io
Cc: Hsieh, PaytonX ; Dong, Guo ; 
Ni, Ray ; Lu, James ; Guo, Gua 

Subject: [PATCH] UefiPayloadPkg: Add macro to support selection of CryptoDxe 
driver

From: PaytonX Hsieh 

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

Add CRYPTO_PROTOCOL_SUPPORT to decide CryptoDxe built into UPL.efi If 
CRYPTO_PROTOCOL_SUPPORT is true, BIOS will use crypto protocol instead of 
building OpensslLib into drivers.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: PaytonX Hsieh 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 10 ++  
UefiPayloadPkg/UefiPayloadPkg.fdf |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 5e947526b7..862d440b16 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -39,6 +39,7 @@
   DEFINE ATA_ENABLE   = TRUE   DEFINE SD_ENABLE
= TRUE   DEFINE PS2_MOUSE_ENABLE = TRUE+  DEFINE 
CRYPTO_PROTOCOL_SUPPORT  = FALSE   DEFINE SD_MMC_TIMEOUT   = 
100#@@ -189,8 +190,13 @@
   
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf   
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf+!if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf   
TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf+!else+  
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf+  
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf+!endif   
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf   
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf   
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf@@ -421,6 +427,7 @@
   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)   
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|180 +!if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family 
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY@@ -443,6 +450,7 @@
   gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY+!endif  
[PcdsPatchableInModule.X64]   
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)@@ 
-764,11 +772,13 @@
   #   # Misc   #+!if $(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
CryptoPkg/Driver/CryptoDxe.inf {
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf   }+!endif
#--   #  Build the shelldiff --git 
a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 5c055e61b3..afdd6447a7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -99,7 +99,9 @@ INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 INF 
MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
 INF 
MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
 +!if $(CRYPTO_PROTOCOL_SUPPORT) == TRUE INF 
CryptoPkg/Driver/CryptoDxe.inf+!endif !if $(SECURITY_STUB_ENABLE) == TRUE INF 
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif--
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91811): https://edk2.groups.io/g/devel/message/91811
Mute This Topic: https://groups.io/mt/92558123/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v4] BaseTools/Capsule: Support signtool input subject name to sign capsule file

2022-07-25 Thread Lin, Jason1
From: Jason1 Lin 

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

Windows-based system using signtool.exe to sign the capsule.
Add the support to using "--subject-name" argument to assign
the subject name used to sign the capsule file.
This argument would pass to signtool.exe as a part of input
argument with "/n" flag.

NOTE: If using signtool.exe to sign capsule at least need to
  choose one of "--pfx-file" and "--subject-name"
  argument to input the value.

Signed-off-by: Jason1 Lin 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Michael D Kinney 
Cc: Dakota Chiang 
---
 BaseTools/Source/Python/Capsule/GenerateCapsule.py | 43 
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py 
b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
index b8039db878..35435946c6 100644
--- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
+++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
@@ -10,7 +10,7 @@
 # keep the tool as simple as possible, it has the following limitations:
 #   * Do not support vendor code bytes in a capsule.
 #
-# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2018 - 2022, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -38,11 +38,11 @@ from Common.Edk2.Capsule.FmpPayloadHeader  import 
FmpPayloadHeaderClass
 # Globals for help information
 #
 __prog__= 'GenerateCapsule'
-__version__ = '0.9'
-__copyright__   = 'Copyright (c) 2018, Intel Corporation. All rights reserved.'
+__version__ = '0.10'
+__copyright__   = 'Copyright (c) 2022, Intel Corporation. All rights reserved.'
 __description__ = 'Generate a capsule.\n'
 
-def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
+def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = 
False):
 #
 # Create a temporary directory
 #
@@ -72,7 +72,10 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose 
= False):
 Command = Command + '"{Path}" '.format (Path = os.path.join (ToolPath, 
'signtool.exe'))
 Command = Command + 'sign /fd sha256 /p7ce DetachedSignedData /p7co 
1.2.840.113549.1.7.2 '
 Command = Command + '/p7 {TempDir} '.format (TempDir = TempDirectoryName)
-Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
+if PfxFile is not None:
+Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
+if SubjectName is not None:
+Command = Command + '/n {SubjectName} '.format (SubjectName = 
SubjectName)
 Command = Command + TempFileName
 if Verbose:
 print (Command)
@@ -105,7 +108,7 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, 
Verbose = False):
 shutil.rmtree (TempDirectoryName)
 return Signature
 
-def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, Verbose = 
False):
+def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, SubjectName, 
Verbose = False):
 print ('signtool verify is not supported.')
 raise ValueError ('GenerateCapsule: error: signtool verify is not 
supported.')
 
@@ -249,6 +252,7 @@ if __name__ == '__main__':
 HardwareInstance = ConvertJsonValue (Config, 
'HardwareInstance', ValidateUnsignedInteger, Required = False, Default = 0)
 MonotonicCount   = ConvertJsonValue (Config, 
'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
 SignToolPfxFile  = ConvertJsonValue (Config, 
'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = 
True)
+SignToolSubjectName  = ConvertJsonValue (Config, 
'SignToolSubjectName', os.path.expandvars, Required = False, Default = None, 
Open = True)
 OpenSslSignerPrivateCertFile = ConvertJsonValue (Config, 
'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)
 OpenSslOtherPublicCertFile   = ConvertJsonValue (Config, 
'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)
 OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 
'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = 
None, Open = True)
@@ -264,6 +268,7 @@ if __name__ == '__main__':
 HardwareInstance,
 UpdateImageIndex,
 SignToolPfxFile,
+SignToolSubjectName,
 OpenSslSignerPrivateCertFile,
 OpenSslOtherPublicCertFile,
 OpenSslTrustedPublicCertFile,
@@ -303,6 +308,7 @@ if __name__ == '__main__':
 UpdateImageIndex = ConvertJsonValue (Config, 

Re: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for signtool to input subject name to sign capsule file

2022-07-25 Thread Bob Feng
Created the PR for merge. https://github.com/tianocore/edk2/pull/3137

-Original Message-
From: gaoliming  
Sent: Monday, July 25, 2022 12:27 PM
To: devel@edk2.groups.io; Lin, Jason1 
Cc: Feng, Bob C ; Chen, Christine ; 
Kinney, Michael D ; Chiang, Dakota 

Subject: 回复: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for 
signtool to input subject name to sign capsule file

Jason:
  Thanks for you to add the detail usage model in BZ 3928. I have no other 
comments. Reviewed-by: Liming Gao 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Lin, Jason1
> 发送时间: 2022年7月8日 19:42
> 收件人: devel@edk2.groups.io
> 抄送: Jason1 Lin ; Bob Feng 
> ; Liming Gao ; Yuwei 
> Chen ; Michael D Kinney 
> ; Dakota Chiang 
> 主题: [edk2-devel] [PATCH v3] BaseTools/Capsule: Add support for 
> signtool
to
> input subject name to sign capsule file
> 
> From: Jason1 Lin 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3928
> 
> Windows-based system using signtool.exe to sign the capsule.
> Add the support to using "--subject-name" argument to assign the 
> subject name used to sign the capsule file.
> This argument would pass to signtool.exe as a part of input argument 
> with "/n" flag.
> 
> NOTE: If using signtool.exe to sign capsule at least need to
>   choose one of "--pfx-file" and "--subject-name"
>   argument to input the value.
> 
> Signed-off-by: Jason1 Lin 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Michael D Kinney 
> Cc: Dakota Chiang 
> ---
>  BaseTools/Source/Python/Capsule/GenerateCapsule.py | 43
> 
>  1 file changed, 34 insertions(+), 9 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> index b8039db878..35435946c6 100644
> --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
> @@ -10,7 +10,7 @@
>  # keep the tool as simple as possible, it has the following limitations:
> 
>  #   * Do not support vendor code bytes in a capsule.
> 
>  #
> 
> -# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
> reserved.
> 
> +# Copyright (c) 2018 - 2022, Intel Corporation. All rights 
> +reserved.
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
> 
> 
> @@ -38,11 +38,11 @@ from Common.Edk2.Capsule.FmpPayloadHeader
> import FmpPayloadHeaderClass
>  # Globals for help information
> 
>  #
> 
>  __prog__= 'GenerateCapsule'
> 
> -__version__ = '0.9'
> 
> -__copyright__   = 'Copyright (c) 2018, Intel Corporation. All rights
reserved.'
> 
> +__version__ = '0.10'
> 
> +__copyright__   = 'Copyright (c) 2022, Intel Corporation. All rights
> reserved.'
> 
>  __description__ = 'Generate a capsule.\n'
> 
> 
> 
> -def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
> 
> +def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, 
> +Verbose
=
> False):
> 
>  #
> 
>  # Create a temporary directory
> 
>  #
> 
> @@ -72,7 +72,10 @@ def SignPayloadSignTool (Payload, ToolPath, 
> PfxFile, Verbose = False):
>  Command = Command + '"{Path}" '.format (Path = os.path.join
(ToolPath,
> 'signtool.exe'))
> 
>  Command = Command + 'sign /fd sha256 /p7ce DetachedSignedData 
> /p7co 1.2.840.113549.1.7.2 '
> 
>  Command = Command + '/p7 {TempDir} '.format (TempDir =
> TempDirectoryName)
> 
> -Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
> 
> +if PfxFile is not None:
> 
> +Command = Command + '/f {PfxFile} '.format (PfxFile = 
> + PfxFile)
> 
> +if SubjectName is not None:
> 
> +Command = Command + '/n {SubjectName} '.format
> (SubjectName = SubjectName)
> 
>  Command = Command + TempFileName
> 
>  if Verbose:
> 
>  print (Command)
> 
> @@ -105,7 +108,7 @@ def SignPayloadSignTool (Payload, ToolPath, 
> PfxFile, Verbose = False):
>  shutil.rmtree (TempDirectoryName)
> 
>  return Signature
> 
> 
> 
> -def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, 
> Verbose
=
> False):
> 
> +def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile,
SubjectName,
> Verbose = False):
> 
>  print ('signtool verify is not supported.')
> 
>  raise ValueError ('GenerateCapsule: error: signtool verify is not
> supported.')
> 
> 
> 
> @@ -249,6 +252,7 @@ if __name__ == '__main__':
>  HardwareInstance = ConvertJsonValue
> (Config, 'HardwareInstance', ValidateUnsignedInteger, Required = 
> False, Default = 0)
> 
>  MonotonicCount   = ConvertJsonValue
> (Config, 'MonotonicCount', ValidateUnsignedInteger, Required = False,
Default
> = 0)
> 
>  SignToolPfxFile  = ConvertJsonValue (Config,
> 'SignToolPfxFile', os.path.expandvars, Required = False, Default = 
> None,
Open
> = True)
> 
> +SignToolSubjectName  = ConvertJsonValue (Config,
> 'SignToolSubjectName', os.path.expandvars, Required = 

Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller to SSDT

2022-07-25 Thread Rohit Mathew
Hi Sami/Thanu,

Please find my response inline -

On Mon, Jul 25, 2022 at 02:54 PM, Thanu Rangarajan  
wrote:

> 
> 
> 
> Hi Rohit,
> 
> 
> 
> The decision to use the SBSA defined HID for the Generic UART was taken
> after extensive discussions within the Arm ecosystem. And as Sami points
> out, now that formal Linux driver support for this HID is available, it
> would be good if it is used by other components in the stack as well.
> 
> 
> 
> 
> 
> 
> 
> + Samer for any additional comments/clarifications.
> 
> 
> 
> 
> 
> 
> 
> Regards,
> 
> 
> 
> Thanu
> 
> 
> 
> *From:* Sami Mujawar 
> *Date:* Monday, 25 July 2022 at 16:12
> *To:* Rohit Mathew , "devel@edk2.groups.io"
> 
> *Cc:* Thanu Rangarajan , nd 
> *Subject:* Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug
> controller to SSDT
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Hi Rohit,
> 
> 
> 
> Please find my response inline marked [SAMI].
> 
> 
> 
> Regards,
> 
> 
> 
> Sami Mujawar
> 
> 
> 
> On 22/07/2022 01:46 pm, Rohit Mathew wrote:
> 
> 
> 
>> 
>> 
>> Hi Sami,
>> 
>> Thank you for the review.
>> Regarding the use of Dynamic Tables Framework, there are no short term
>> plans to migrate to it. Please find my response for your comment inline -
>> 
>> On Thu, Jul 21, 2022 at 01:42 PM, Sami Mujawar wrote:
>> 
>> 
>>> 
>>> 
>>> Hi Rohit,
>>> 
>>> Have you considered moving to use Dynamic Tables Framework? There is
>>> just too much repetition in this series which can be easily avoided. It
>>> will also make the code more maintainable.
>>> 
>>> Apart from this I have a comment marked inline as [SAMI].
>>> 
>>> Regards,
>>> 
>>> Sami Mujawar
>>> 
>>> On 04/07/2022 05:59 pm, Rohit Mathew wrote:
>>> 
>>> 
 
 
 Add a new device entry in the SSDT ACPI table to describe the serial
 port used as the debug port. On the Neoverse reference design platforms,
 the UART0 port of the SoC is used as the debug port.
 
 Signed-off-by: Rohit Mathew  ( rohit.mat...@arm.com )
 
 ---
 Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 1 +
 Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl | 15 +++
 9 files changed, 23 insertions(+)
 
 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
 b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
 index d2935f1e73e1..d46ae0274d90 100644
 --- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
 +++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
 @@ -39,6 +39,7 @@ [Packages]
 [FixedPcd]
 gArmPlatformTokenSpaceGuid.PcdCoreCount
 gArmPlatformTokenSpaceGuid.PcdClusterCount
 + gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
 gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
 gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
 b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
 index 73f47ece7718..4bf681d3bc2e 100644
 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
 +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
 @@ -39,6 +39,7 @@ [Packages]
 [FixedPcd]
 gArmPlatformTokenSpaceGuid.PcdCoreCount
 gArmPlatformTokenSpaceGuid.PcdClusterCount
 + gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
 gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
 gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
 b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
 index da14120bde69..89f532217ceb 100644
 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
 +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
 @@ -41,6 +41,7 @@ [Packages]
 [FixedPcd]
 gArmPlatformTokenSpaceGuid.PcdCoreCount
 gArmPlatformTokenSpaceGuid.PcdClusterCount
 + gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
 gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
 gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
 b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
 index 90976250445e..66d5422df36b 100644
 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
 +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
 @@ -37,6 +37,7 @@ [Packages]
 Platform/ARM/SgiPkg/SgiPlatform.dec
 
 [FixedPcd]
 + gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
 gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
 

Re: [edk2-devel] [edk2-staging][PATCH v2 2/2] edk2-staging/EmulatorPkg: Introduce Hii2RedfishBiosDxe driver

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Ray Ni ; Chang,
> Abner ; Yang, Atom ;
> Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 2/2] edk2-staging/EmulatorPkg: Introduce
> Hii2RedfishBiosDxe driver
> 
> [CAUTION: External Email]
> 
> Add Hii2RedfishBiosDxe driver with configure language defined in UNI file in
> order to demonstrate the use of Redfish Platform Config Protocol. Feature
> drivers under RedfishClientPkg will work with this driver and provide the
> REST data to Redfish service.
> 
> Signed-off-by: Nickle Wang 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  EmulatorPkg/EmulatorPkg.dec   |   1 +
>  EmulatorPkg/EmulatorPkg.dsc   |   1 +
>  EmulatorPkg/EmulatorPkg.fdf   |   1 +
>  .../Hii2RedfishBiosDxe/Hii2RedfishBiosData.h  |  46 +++
>  .../Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c   | 291 ++
>  .../Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h   |  44 +++
>  .../Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf |  55 
>  .../Hii2RedfishBiosDxeMap.uni |  20 ++
>  .../Hii2RedfishBiosDxeStrings.uni |  30 ++
>  .../Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr |  67 
>  10 files changed, 556 insertions(+)
>  create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h
>  create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.c
>  create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.h
>  create mode 100644
> EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf
>  create mode 100644
> EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeMap.uni
>  create mode 100644
> EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxeStrings.uni
>  create mode 100644 EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosVfr.vfr
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec
> index 52a62c09c9..e782b15266 100644
> --- a/EmulatorPkg/EmulatorPkg.dec
> +++ b/EmulatorPkg/EmulatorPkg.dec
> @@ -49,6 +49,7 @@
>gEmuRedfishServiceGuid = { 0x3fb208ac, 0x2185, 0x498c, { 0xbf, 0x46,
> 0xdc, 0x23, 0xda, 0x58, 0x7b, 0x55 } }
>gHii2RedfishMemoryFormsetGuid  = { 0xC2BE579E, 0x3C57, 0x499C, { 0xA9,
> 0xDF, 0xE6, 0x23, 0x8A, 0x49, 0x64, 0xF8 }}
>gHii2RedfishBootFormsetGuid  = { 0x8399a787, 0x108e, 0x4e53, { 0x9e, 0xde,
> 0x4b, 0x18, 0xcc, 0x9e, 0xab, 0x3b }}
> +  gHii2RedfishBiosFormsetGuid  = { 0xC2724AD1, 0x4049, 0x2404, { 0xF8,
> + 0xCE, 0x01, 0xA7, 0x9C, 0xEC, 0x16, 0xF6 }}
> 
>  [PcdsFeatureFlag]
>## If TRUE, if symbols only load on breakpoints and gdb entry diff --git
> a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index
> 1d59b4a1dd..dd1d9ef9ec 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -491,6 +491,7 @@
>  !if $(REDFISH_ENABLE) == TRUE
>EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf
>EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf
> +  EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf
>  !endif
>  !include RedfishPkg/Redfish.dsc.inc
>  !include RedfishClientPkg/RedfishClient.dsc.inc
> diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
> index f9ff4320d9..9e594533d8 100644
> --- a/EmulatorPkg/EmulatorPkg.fdf
> +++ b/EmulatorPkg/EmulatorPkg.fdf
> @@ -215,6 +215,7 @@ INF  EmulatorPkg/EmuSnpDxe/EmuSnpDxe.inf
>  !if $(REDFISH_ENABLE) == TRUE
>INF EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf
>INF EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf
> +  INF EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosDxe.inf
>  !endif
>  !include RedfishPkg/Redfish.fdf.inc
>  !include RedfishClientPkg/RedfishClient.fdf.inc
> diff --git a/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h
> b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h
> new file mode 100644
> index 00..1b27dfd168
> --- /dev/null
> +++ b/EmulatorPkg/Hii2RedfishBiosDxe/Hii2RedfishBiosData.h
> @@ -0,0 +1,46 @@
> +/** @file
> +  The header file of HII-to-Redfish BIOS example driver.
> +
> +  (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef HII_2_REDFISH_BIOS_DATA_H_
> +#define HII_2_REDFISH_BIOS_DATA_H_
> +
> +#include 
> +#include 
> +
> +#define HII_2_REDFISH_BIOS_FORMSET_GUID \
> +  { \
> +0xC2724AD1, 0x4049, 0x2404, { 0xF8, 0xCE, 0x01, 0xA7, 0x9C, 0xEC, 0x16,
> 0xF6 } \
> +}
> +
> +extern EFI_GUID gHii2RedfishBiosFormsetGuid;
> +
> +#define FORM_ID 0x001
> +#define FROM_ID_BIOS_OPTION_1   0x002
> +#define FROM_ID_BIOS_OPTION_2   0x003
> +#define FROM_ID_BIOS_OPTION_3   0x004
> +#define FROM_ID_BIOS_OPTION_4   0x005
> +
> +#define ID_STRING_MIN   

Re: [edk2-devel] [edk2-staging][PATCH v2 1/2] edk2-staging/EmulatorPkg: Introduce Hii2RedfishBootDxe driver

2022-07-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, July 25, 2022 9:36 AM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Ray Ni ; Chang,
> Abner ; Yang, Atom ;
> Nick Ramirez 
> Subject: [edk2-staging][PATCH v2 1/2] edk2-staging/EmulatorPkg: Introduce
> Hii2RedfishBootDxe driver
> 
> [CAUTION: External Email]
> 
> Add Hii2RedfishBootDxe driver with configure language defined in UNI file in
> order to demonstrate the use of Redfish Platform Config Protocol. Feature
> drivers under RedfishClientPkg will work with this driver and provide the
> REST data to Redfish service.
> 
> Signed-off-by: Nickle Wang 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Yang Atom 
> Cc: Nick Ramirez 
> ---
>  EmulatorPkg/EmulatorPkg.dec   |   5 +-
>  EmulatorPkg/EmulatorPkg.dsc   |   3 +-
>  EmulatorPkg/EmulatorPkg.fdf   |   3 +-
>  .../Hii2RedfishBootDxe/Hii2RedfishBootData.h  |  60 ++
>  .../Hii2RedfishBootDxe/Hii2RedfishBootDxe.c   | 702 ++
>  .../Hii2RedfishBootDxe/Hii2RedfishBootDxe.h   |  53 ++
>  .../Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf |  60 ++
>  .../Hii2RedfishBootDxeMap.uni |  28 +
>  .../Hii2RedfishBootDxeStrings.uni |  41 +
>  .../Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr |  83 +++
>  10 files changed, 1034 insertions(+), 4 deletions(-)  create mode 100644
> EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootData.h
>  create mode 100644 EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.c
>  create mode 100644
> EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.h
>  create mode 100644
> EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf
>  create mode 100644
> EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeMap.uni
>  create mode 100644
> EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeStrings.uni
>  create mode 100644
> EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec
> index 9e87b50afc..52a62c09c9 100644
> --- a/EmulatorPkg/EmulatorPkg.dec
> +++ b/EmulatorPkg/EmulatorPkg.dec
> @@ -4,7 +4,7 @@
>  #
>  # Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.  #
> Portions copyright (c) 2011, Apple Inc. All rights reserved.
> -# (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
> +# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
>  #
>  #SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -47,7 +47,8 @@
>gEmuVirtualDisksGuid   = { 0xf2ba331a, 0x8985, 0x11db, { 0xa4, 0x06, 
> 0x00,
> 0x40, 0xd0, 0x2b, 0x18, 0x35 } }
>gEmuPhysicalDisksGuid  = { 0xf2bdcc96, 0x8985, 0x11db, { 0x87, 0x19, 
> 0x00,
> 0x40, 0xd0, 0x2b, 0x18, 0x35 } }
>gEmuRedfishServiceGuid = { 0x3fb208ac, 0x2185, 0x498c, { 0xbf, 0x46,
> 0xdc, 0x23, 0xda, 0x58, 0x7b, 0x55 } }
> -  gHii2RedfishMemoryFormsetGuid  = { 0XC2BE579E, 0X3C57, 0X499C, { 0XA9,
> 0XDF, 0XE6, 0X23, 0X8A, 0X49, 0X64, 0XF8 }}
> +  gHii2RedfishMemoryFormsetGuid  = { 0xC2BE579E, 0x3C57, 0x499C, {
> + 0xA9, 0xDF, 0xE6, 0x23, 0x8A, 0x49, 0x64, 0xF8 }}
> + gHii2RedfishBootFormsetGuid  = { 0x8399a787, 0x108e, 0x4e53, { 0x9e,
> + 0xde, 0x4b, 0x18, 0xcc, 0x9e, 0xab, 0x3b }}
> 
>  [PcdsFeatureFlag]
>## If TRUE, if symbols only load on breakpoints and gdb entry diff --git
> a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index
> e5cb3c3d8d..1d59b4a1dd 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -7,7 +7,7 @@
>  # Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.  #
> Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.  #
> Copyright (c) Microsoft Corporation.
> -# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -490,6 +490,7 @@
> 
>  !if $(REDFISH_ENABLE) == TRUE
>EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf
> +  EmulatorPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf
>  !endif
>  !include RedfishPkg/Redfish.dsc.inc
>  !include RedfishClientPkg/RedfishClient.dsc.inc
> diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
> index 5e770af186..f9ff4320d9 100644
> --- a/EmulatorPkg/EmulatorPkg.fdf
> +++ b/EmulatorPkg/EmulatorPkg.fdf
> @@ -3,7 +3,7 @@
>  #
>  # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.  #
> Portions copyright (c) 2009 - 2011, Apple Inc. All rights reserved. -# (C)
> Copyright 2021 Hewlett Packard Enterprise Development LP
> +# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -214,6 +214,7 @@
> INF  EmulatorPkg/EmuSnpDxe/EmuSnpDxe.inf
>  #
>  !if $(REDFISH_ENABLE) == TRUE
>INF EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf
> +  INF 

Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller to SSDT

2022-07-25 Thread Thanu Rangarajan
Hi Rohit,
The decision to use the SBSA defined HID for the Generic UART was taken after 
extensive discussions within the Arm ecosystem. And as Sami points out, now 
that formal Linux driver support for this HID is available, it would be good if 
it is used by other components in the stack as well.

+ Samer for any additional comments/clarifications.

Regards,
Thanu
From: Sami Mujawar 
Date: Monday, 25 July 2022 at 16:12
To: Rohit Mathew , "devel@edk2.groups.io" 

Cc: Thanu Rangarajan , nd 
Subject: Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller 
to SSDT


Hi Rohit,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar
On 22/07/2022 01:46 pm, Rohit Mathew wrote:
Hi Sami,

Thank you for the review.
Regarding the use of Dynamic Tables Framework, there are no short term plans to 
migrate to it. Please find my response for your comment inline -

On Thu, Jul 21, 2022 at 01:42 PM, Sami Mujawar wrote:
Hi Rohit,

Have you considered moving to use Dynamic Tables Framework? There is
just too much repetition in this series which can be easily avoided. It
will also make the code more maintainable.

Apart from this I have a comment marked inline as [SAMI].

Regards,

Sami Mujawar

On 04/07/2022 05:59 pm, Rohit Mathew wrote:
Add a new device entry in the SSDT ACPI table to describe the serial
port used as the debug port. On the Neoverse reference design platforms,
the UART0 port of the SoC is used as the debug port.

Signed-off-by: Rohit Mathew 
---
Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl | 15 +++
9 files changed, 23 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index d2935f1e73e1..d46ae0274d90 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -39,6 +39,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index 73f47ece7718..4bf681d3bc2e 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -39,6 +39,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index da14120bde69..89f532217ceb 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -41,6 +41,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index 90976250445e..66d5422df36b 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
@@ -37,6 +37,7 @@ [Packages]
Platform/ARM/SgiPkg/SgiPlatform.dec

[FixedPcd]
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
index 95fb446c105d..742734ab7348 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
@@ -37,6 +37,7 @@ [Packages]
Platform/ARM/SgiPkg/SgiPlatform.dec

[FixedPcd]
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
index 

Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Enhance bus scan for all root bridge instances

2022-07-25 Thread Nong, Foster
Hi Mike,

Yes. With this chance, each root bridge will have the bus resource size except 
the one which
Meet the bus shortage case. Then the Bus Rebalance handle of 
EfiPciHostBridgeEndBusAllocation on
 platform BIOS will Have a chance to adjust the bus resource assignment for 
each root bridges 
which meet the Bus shortage case.

Best Regards
Foster Nong
EXT: 021-61164849

-Original Message-
From: Kinney, Michael D  
Sent: Saturday, July 23, 2022 7:49 AM
To: devel@edk2.groups.io; Nong, Foster ; Ni, Ray 
; Kinney, Michael D 
Subject: RE: [edk2-devel] [PATCH 1/1] MdeModulePkg: Enhance bus scan for all 
root bridge instances

Hi Foster,

Does this change provide the resource size requirements for each root bridge so 
a rebalance or larger resource allocation can be performed?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Foster 
> Nong
> Sent: Friday, July 22, 2022 2:10 AM
> To: devel@edk2.groups.io
> Cc: Nong, Foster 
> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: Enhance bus scan for 
> all root bridge instances
> 
> Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=4000
> 
> Change flow to bus scan all root bridge instances even when any one 
> root bridge meet bus resource OUT_OF_RESOURCE case.
> thus platform handler  of "EfiPciHostBridgeEndBusAllocation" has an 
> chance to do relative pci bus rebalance to handle this case.
> 
> Signed-off-by: Foster Nong 
> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c 
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> index 63d149b3b8c0..a89f912de85b 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> @@ -1528,6 +1528,7 @@ PciHostBridgeEnumerator (
>UINT8  StartBusNumber;
>LIST_ENTRY RootBridgeList;
>LIST_ENTRY *Link;
> +  EFI_STATUS RootBridgeEnumerationStatus;
> 
>if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
>  InitializeHotPlugSupport ();
> @@ -1546,6 +1547,7 @@ PciHostBridgeEnumerator (
> 
>DEBUG ((DEBUG_INFO, "PCI Bus First Scanning\n"));
>RootBridgeHandle = NULL;
> +  RootBridgeEnumerationStatus = EFI_SUCCESS;
>while (PciResAlloc->GetNextRootBridge (PciResAlloc, ) == 
> EFI_SUCCESS) {
>  //
>  // if a root bridge instance is found, create root bridge device 
> for it @@ -1572,7 +1574,7 @@ PciHostBridgeEnumerator (
>  }
> 
>  if (EFI_ERROR (Status)) {
> -  return Status;
> +  RootBridgeEnumerationStatus = Status;
>  }
>}
> 
> @@ -1581,6 +1583,10 @@ PciHostBridgeEnumerator (
>//
>NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);
> 
> +  if (EFI_ERROR (RootBridgeEnumerationStatus)) {
> +  return RootBridgeEnumerationStatus;  }
> +
>if ((gPciHotPlugInit != NULL) && FeaturePcdGet 
> (PcdPciBusHotplugDeviceSupport)) {
>  //
>  // Reset all assigned PCI bus number in all PPB @@ -1659,7 
> +1665,7 @@ PciHostBridgeEnumerator (
> 
>DestroyRootBridge (RootBridgeDev);
>if (EFI_ERROR (Status)) {
> -return Status;
> +RootBridgeEnumerationStatus = Status;
>}
>  }
> 
> @@ -1667,6 +1673,10 @@ PciHostBridgeEnumerator (
>  // Notify the bus allocation phase is to end for the 2nd time
>  //
>  NotifyPhase (PciResAlloc, EfiPciHostBridgeEndBusAllocation);
> +
> +if (EFI_ERROR (RootBridgeEnumerationStatus)) {
> +  return RootBridgeEnumerationStatus;
> +}
>}
> 
>//
> --
> 2.26.2.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91804): https://edk2.groups.io/g/devel/message/91804
Mute This Topic: https://groups.io/mt/92558124/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot

2022-07-25 Thread Sami Mujawar

Hi Rebecca,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 21/07/2022 05:23 pm, Sami Mujawar via groups.io wrote:
Hi Rebecca, Ard,

On Tue, May 3, 2022 at 12:43 AM, Ard Biesheuvel wrote:
// Data Cache enabled on Primary core when MMU is enabled.
ArmDisableDataCache ();
// Invalidate instruction cache
@@ -90,6 +95,18 @@ CEntryPoint (

// If not primary Jump to Secondary Main
if (ArmPlatformIsPrimaryCore (MpId)) {
+ // Initialize the Serial Port
+ SerialPortInitialize ();
+ CharCount = AsciiSPrint (
+ Buffer,
+ sizeof (Buffer),
+ "UEFI firmware (version %s built at %a on %a)\n\r",
+ (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
Given that this runs before any library constructors are called, I'd
be inclined to use FixedPcdGetPtr() here (and [FixedPcd] in the .INFs
below), to ensure that we don't dereference garbage.

I also wonder whether we need a call to
ProcessLibraryConstructorList() somewhere.
[SAMI] There is a patch at https://edk2.groups.io/g/devel/message/91113 which 
aims to call ProcessLibraryConstructorList(). The idea being that the DebugLib 
constructor would be called which initializes the serial port.
So, maybe these patches need adjustment so that we avoid calling 
SerialPortInitialize () twice.
[/SAMI]

[/SAMI] I had a look at the SerialPortInitialize() implementation for PL011 and 
16550 UARTs and it appears that both check the current settings before 
programming the UART. Therefore, please ignore my comment above.

[/SAMI]

regards,

Sami Mujawar

+ __TIME__,
+ __DATE__
+ );
+ SerialPortWrite ((UINT8 *)Buffer, CharCount);

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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91803): https://edk2.groups.io/g/devel/message/91803
Mute This Topic: https://groups.io/mt/90452782/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2][PATCH V4 1/1] ArmPlatformPkg/PrePeiCore: Invoke constructors for SEC phase

2022-07-25 Thread Sami Mujawar

Hi Rohit,

This patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 22/07/2022 06:02 pm, Rohit Mathew wrote:

On platforms that do not have the serial console port pre-initialized
prior to the SEC phase and due to the absence of a call to
"SerialPortInitialize", this results in missing debug logs. So, call
the auto-generated "ProcessLibraryConstructorList" function from SEC
phase to have all the dependent library constructors called
(this includes a call to "SerialPortInitialize").

Signed-off-by: Rohit Mathew 
---
  ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 12 +++-
  ArmPlatformPkg/PrePeiCore/PrePeiCore.c |  6 +-
  2 files changed, 16 insertions(+), 2 deletions(-)

Changes since V1:
- Rebased on top of latest master branch.
- Addressed comments from Ard.

Changes since V2:
- Rebased on top of latest master branch.

Changes since V3:
- Addressed comments from Sami.

Link to github branch for the patch -
https://github.com/rohit-arm/edk2/tree/sec_constructor_issue

diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h 
b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
index 0345dd7bdd2a..c1e13e23e11e 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h
@@ -1,7 +1,7 @@
  /** @file
Main file supporting the transition to PEI Core in Normal World for 
Versatile Express
  
-  Copyright (c) 2011, ARM Limited. All rights reserved.

+  Copyright (c) 2011 - 2022, ARM Limited. All rights reserved.
  
SPDX-License-Identifier: BSD-2-Clause-Patent
  
@@ -73,4 +73,14 @@ PeiCommonExceptionEntry (

IN UINTN   LR
);
  
+/*

+ * Autogenerated function that calls the library constructors for all of the
+ * module's dependent libraries.
+ */
+VOID
+EFIAPI
+ProcessLibraryConstructorList (
+  VOID
+  );
+
  #endif
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c 
b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
index 6dd9bcdea24f..9c4b25df953d 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
@@ -1,7 +1,7 @@
  /** @file
Main file supporting the transition to PEI Core in Normal World for 
Versatile Express
  
-  Copyright (c) 2011-2014, ARM Limited. All rights reserved.

+  Copyright (c) 2011 - 2022, ARM Limited. All rights reserved.
  
SPDX-License-Identifier: BSD-2-Clause-Patent
  
@@ -90,6 +90,10 @@ CEntryPoint (
  
// If not primary Jump to Secondary Main

if (ArmPlatformIsPrimaryCore (MpId)) {
+// Invoke "ProcessLibraryConstructorList" to have all library constructors
+// called.
+ProcessLibraryConstructorList ();
+
  // Initialize the Debug Agent for Source Level Debugging
  InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
  SaveAndSetDebugTimerInterrupt (TRUE);



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91802): https://edk2.groups.io/g/devel/message/91802
Mute This Topic: https://groups.io/mt/92552068/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller to SSDT

2022-07-25 Thread Sami Mujawar

Hi Rohit,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 22/07/2022 01:46 pm, Rohit Mathew wrote:

Hi Sami,

Thank you for the review.
Regarding the use of Dynamic Tables Framework, there are no short term 
plans to migrate to it. Please find my response for your comment inline -


On Thu, Jul 21, 2022 at 01:42 PM, Sami Mujawar wrote:

Hi Rohit,

Have you considered moving to use Dynamic Tables Framework? There is
just too much repetition in this series which can be easily
avoided. It
will also make the code more maintainable.

Apart from this I have a comment marked inline as [SAMI].

Regards,

Sami Mujawar

On 04/07/2022 05:59 pm, Rohit Mathew wrote:

Add a new device entry in the SSDT ACPI table to describe the
serial
port used as the debug port. On the Neoverse reference design
platforms,
the UART0 port of the SoC is used as the debug port.

Signed-off-by: Rohit Mathew 
---
Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl | 15 +++
9 files changed, 23 insertions(+)

diff --git
a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index d2935f1e73e1..d46ae0274d90 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -39,6 +39,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git
a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index 73f47ece7718..4bf681d3bc2e 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -39,6 +39,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git
a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index da14120bde69..89f532217ceb 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -41,6 +41,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index 90976250445e..66d5422df36b 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
@@ -37,6 +37,7 @@ [Packages]
Platform/ARM/SgiPkg/SgiPlatform.dec

[FixedPcd]
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git
a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
index 95fb446c105d..742734ab7348 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
@@ -37,6 +37,7 @@ [Packages]
Platform/ARM/SgiPkg/SgiPlatform.dec

[FixedPcd]
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf