Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to support selective driver in UPL

2022-07-03 Thread Ni, Ray
> 
> +!if $(GENERIC_MEMORY_TEST_ENABLE) == TRUE
> 
> +
> MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/Generic
> MemoryTestDxe.inf
> 
> +!endif
> 
> +!if $(NULL_MEMORY_TEST_ENABLE) == TRUE
> 
> 
> MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryT
> estDxe.inf
> 
> +!endif

1. Is there a configuration that both GENERIC and NULL memory test is FALSE?
If no, can we add a macro like "MEMORY_TEST" and its value could be
"GENERIC" or "NULL"?



> +!if $(ATA_ENABLE) == TRUE
> 
>MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
>MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
> 
>MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf

2. AtaAtapiPassThru also produces "gEfiExtScsiPassThruProtocolGuid" which is 
used by ScsiBusDxe.
So, maybe we need to always include AtaAtapiPassThru driver. 
> 
>#
> 
># Usb Support
> 
> @@ -671,7 +685,9 @@
>  !if $(PS2_KEYBOARD_ENABLE) == TRUE
> 
>MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  !endif
> 
> +!if $(PS2_MOUSE_ENABLE) == TRUE
> 
>MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
> 
> +!endif
> 
> 
> 
>#
> 
># Console Support
> 
> @@ -742,12 +758,14 @@
>#  This should be FALSE for compiling the dynamic command.
> 
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> 
>}
> 
> +!if $(PERFORMANCE_MEASUREMENT_ENABLE) == TRUE

3. Thanks for catching that.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91023): https://edk2.groups.io/g/devel/message/91023
Mute This Topic: https://groups.io/mt/92047211/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] [edk2-platforms] Silicon/Intel/FitGen: Support Startup ACM entries (Type 2) 0x200 Version

2022-07-03 Thread Yuwei Chen
Reviewed-by: Yuwei Chen

> -Original Message-
> From: Lin, Jason1 
> Sent: Friday, July 1, 2022 11:10 PM
> To: devel@edk2.groups.io
> Cc: Lin, Jason1 ; Feng, Bob C ;
> Gao, Liming ; Chen, Christine
> ; Oram, Isaac W ;
> Chaganty, Rangasai V ; Chiang, Dakota
> 
> Subject: [PATCH v3 3/3] [edk2-platforms] Silicon/Intel/FitGen: Support
> Startup ACM entries (Type 2) 0x200 Version
> 
> From: Jason1 Lin 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3959
> 
> As per FIT BIOS Specification 1.2 Rules, the size bytes (3 bytes) / reserved
> byte (1 byte) / CheckSum byte (1 byte) in type 2 are must-be-zero (MBZ).
> These bytes could be override for the other usages.
> This change is used to support the Type 02 (ACM) Ver. 0x200.
> 
> Command:
> [-S |] [-I
> ] [-V ]
> 
> Signed-off-by: Jason1 Lin 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Isaac W Oram 
> Cc: Rangasai V Chaganty 
> Cc: Dakota Chiang 
> ---
>  Silicon/Intel/Tools/FitGen/FitGen.c | 183 ++--
>  Silicon/Intel/Tools/FitGen/FitGen.h |   2 +-
>  2 files changed, 165 insertions(+), 20 deletions(-)
> 
> diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c
> b/Silicon/Intel/Tools/FitGen/FitGen.c
> index 01b4f82518..577ce48b10 100644
> --- a/Silicon/Intel/Tools/FitGen/FitGen.c
> +++ b/Silicon/Intel/Tools/FitGen/FitGen.c
> @@ -55,6 +55,7 @@ typedef struct {
>  #define ACM_MODULE_FLAG_PREPRODUCTION   0x4000 #define
> ACM_MODULE_FLAG_DEBUG_SIGN  0x8000 +#define
> NIBBLES_TO_BYTE(A, B)  (UINT8)(((A & (0x0F)) << 4) | (B & 0x0F))  typedef
> struct {   UINT16 ModuleType;@@ -149,6 +150,20 @@ typedef struct {
>ACM_PROCESSOR_ID ProcessorID[1]; } PROCESSOR_ID_LIST; +typedef
> union {+  struct {+UINT32  Stepping  : 4;+UINT32  Model : 
> 4;+
> UINT32  Family: 4;+UINT32  Type  : 2;+UINT32  
> Reserved1 : 2;+
> UINT32  ExtendedModel : 4;+UINT32  ExtendedFamily: 8;+UINT32
> Reserved2 : 4;+  } Bits;+  UINT32  Uint32;+} PROCESSOR_ID;+ #pragma pack
> ()  @@ -210,6 +225,7 @@ typedef struct {
>   #define DEFAULT_FIT_TABLE_POINTER_OFFSET  0x40 #define
> DEFAULT_FIT_ENTRY_VERSION 0x0100+#define
> STARTUP_ACM_FIT_ENTRY_200_VERSION 0x0200  #define
> TOP_FLASH_ADDRESS  (gFitTableContext.TopFlashAddressRemapValue) @@
> -247,6 +263,8 @@ typedef struct {
>UINT8   *Buffer; // Used by OptionalModule only   UINT32  Size;   UINT32
> Version; // Used by OptionalModule and PortModule only+  UINT32  FMS;
> // Used by Entry Type 02 (ACM) Ver. 0x200 only+  UINT32  FMSMask; // Used
> by Entry Type 02 (ACM) Ver. 0x200 only } FIT_TABLE_CONTEXT_ENTRY;
> typedef struct {@@ -262,7 +280,7 @@ typedef struct {
>UINT32 GlobalVersion;   UINT32 
> FitHeaderVersion;
> FIT_TABLE_CONTEXT_ENTRYStartupAcm[MAX_STARTUP_ACM_ENTRY];-
> UINT32 StartupAcmVersion;+  UINT32
> StartupAcmVersion[MAX_STARTUP_ACM_ENTRY];
> FIT_TABLE_CONTEXT_ENTRYDiagnstAcm;   UINT32
> DiagnstAcmVersion;   FIT_TABLE_CONTEXT_ENTRY
> BiosModule[MAX_BIOS_MODULE_ENTRY];@@ -341,7 +359,7 @@ Returns:
>"\t[-L  ]\n"   "\t[-LF
> ]\n"   "\t[-I ]\n"-  "\t[-S
> |] [-V
> ]\n"+  "\t[-S  StartupAcmSize>|] [-I  StartupAcmFMSMask>] [-V ]\n"   "\t[-U
> |]\n"   "\t[-B
> ] [-B ...] [-V ]\n"
> "\t[-M ] [-M ...]|[-U  MicrocodeBase>| MicrocodeRegionSize>|] [-V ]\n"@@ -
> 356,8 +374,11 @@ Returns:
>printf ("\tFitTablePointerOffset  - FIT table pointer offset. 0x%x as 
> default.
> 0x18 for current soon to be obsoleted CPUs. User can set both.\n",
> DEFAULT_FIT_TABLE_POINTER_OFFSET);   printf ("\tBiosInfoGuid   - Guid
> of BiosInfo Module. If this module exists, StartupAcm/Bios/Microcode can be
> optional.\n");   printf ("\tStartupAcmAddress  - Address of
> StartupAcm.\n");-  printf ("\tStartupAcmSize - Size of 
> StartupAcm.\n");+
> printf ("\tStartupAcmSize - The maximum size value that could place 
> the
> StartupAcm in.\n");   printf ("\tStartupAcmGuid - Guid of StartupAcm
> Module, if StartupAcm is in a BiosModule, it will be excluded form that.\n");+
> printf ("\tStartupAcmFMS  - Value of PROCESSOR ID
> (Family/Model/Stepping value called \"FMS\") - see detail on FIT spec
> (1.3).\n");+  printf ("\tStartupAcmFMSMask  - Value use for uCode (if it
> recognizes 0x200 Type2 entry) to do bitmask logic operation with CPU
> processor ID.\n");+  printf ("\t If the result match 
> to
> StartupAcmFMS, corresponding ACM will be loaded - see detail on FIT spec
> (1.3).\n");   printf ("\tDiagnstAcmAddress  - Address of DiagnstAcm.\n");
> printf ("\tDiagnstAcmGuid - Guid of DiagnstAcm Module, if DiagnstAcm
> is in a BiosModule, it will be excluded from that.\n");   printf
> ("\tBiosModuleAddress  - Address of BiosModule. User should ensure
> there is no overlap.\n");@@ -1155,6 +1176,9 @@ Returns:
>   

Re: [edk2-devel] [PATCH v3 2/3] [edk2-platforms] Silicon/Intel/FitGen: Reduce the typecasting and pointer usage

2022-07-03 Thread Yuwei Chen
Reviewed-by: Yuwei Chen

> -Original Message-
> From: Lin, Jason1 
> Sent: Friday, July 1, 2022 11:10 PM
> To: devel@edk2.groups.io
> Cc: Lin, Jason1 ; Feng, Bob C ;
> Gao, Liming ; Chen, Christine
> ; Oram, Isaac W ;
> Chaganty, Rangasai V ; Chiang, Dakota
> 
> Subject: [PATCH v3 2/3] [edk2-platforms] Silicon/Intel/FitGen: Reduce the
> typecasting and pointer usage
> 
> From: Jason1 Lin 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3958
> 
> FitGen tool exists lots of typecasting and pointer usage.
> This code change is used to reduce these in FillFitTable () and 
> GetFitEntryInfo
> ().
> To make code more clearly and easy to read.
> 
> Signed-off-by: Jason1 Lin 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Isaac W Oram 
> Cc: Rangasai V Chaganty 
> Cc: Dakota Chiang 
> ---
>  Silicon/Intel/Tools/FitGen/FitGen.c | 125 
>  1 file changed, 78 insertions(+), 47 deletions(-)
> 
> diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c
> b/Silicon/Intel/Tools/FitGen/FitGen.c
> index eac8fa8715..01b4f82518 100644
> --- a/Silicon/Intel/Tools/FitGen/FitGen.c
> +++ b/Silicon/Intel/Tools/FitGen/FitGen.c
> @@ -2768,6 +2768,7 @@ Returns:
>  {   FIRMWARE_INTERFACE_TABLE_ENTRY *FitEntry;   UINT32
> FitIndex;+  UINT32  FitEntrySizeValue;   UINT32
> Index;   UINT8   Checksum;   UINTN
>SubIndex;@@
> -2788,27 +2789,35 @@ Returns:
>//   // 2. FitHeader   //-  FitEntry[FitIndex].Address = 
> *(UINT64
> *)"_FIT_   ";-  *(UINT32 *)&FitEntry[FitIndex].Size[0] =
> gFitTableContext.FitEntryNumber;-  FitEntry[FitIndex].Version =
> (UINT16)gFitTableContext.FitHeaderVersion;-  FitEntry[FitIndex].Type
> = FIT_TABLE_TYPE_HEADER;-  FitEntry[FitIndex].C_V = 1;+
> FitEntrySizeValue   = gFitTableContext.FitEntryNumber;+
> FitEntry[FitIndex].Address  = *(UINT64 *)"_FIT_   ";+  
> FitEntry[FitIndex].Size[0]
> = (UINT8)FitEntrySizeValue;+  FitEntry[FitIndex].Size[1]  =
> (UINT8)(FitEntrySizeValue >> 8);+  FitEntry[FitIndex].Size[2]  =
> (UINT8)(FitEntrySizeValue >> 16);+  FitEntry[FitIndex].Rsvd = 0;+
> FitEntry[FitIndex].Version  = (UINT16)gFitTableContext.FitHeaderVersion;+
> FitEntry[FitIndex].Type = FIT_TABLE_TYPE_HEADER;+
> FitEntry[FitIndex].C_V  = 1;   //   // Checksum will be updated later...  
>  //-
> FitEntry[FitIndex].Checksum= 0;+  FitEntry[FitIndex].Checksum = 
> 0;//
> // 3. Microcode   //   FitIndex++;   for (Index = 0; Index <
> gFitTableContext.MicrocodeNumber; Index++) {-FitEntry[FitIndex].Address
> = gFitTableContext.Microcode[Index].Address;-*(UINT32
> *)&FitEntry[FitIndex].Size[0] = 0; //gFitTableContext.Microcode[Index].Size /
> 16;-FitEntry[FitIndex].Version =
> (UINT16)gFitTableContext.MicrocodeVersion;-FitEntry[FitIndex].Type
> = FIT_TABLE_TYPE_MICROCODE;-FitEntry[FitIndex].C_V = 0;-
> FitEntry[FitIndex].Checksum= 0;+FitEntrySizeValue   = 
> 0; //
> gFitTableContext.Microcode[Index].Size / 16+FitEntry[FitIndex].Address  =
> gFitTableContext.Microcode[Index].Address;+FitEntry[FitIndex].Size[0]  =
> (UINT8)FitEntrySizeValue;+FitEntry[FitIndex].Size[1]  =
> (UINT8)(FitEntrySizeValue >> 8);+FitEntry[FitIndex].Size[2]  =
> (UINT8)(FitEntrySizeValue >> 16);+FitEntry[FitIndex].Rsvd = 0;+
> FitEntry[FitIndex].Version  = (UINT16)gFitTableContext.MicrocodeVersion;+
> FitEntry[FitIndex].Type = FIT_TABLE_TYPE_MICROCODE;+
> FitEntry[FitIndex].C_V  = 0;+FitEntry[FitIndex].Checksum = 0;
> FitIndex++;   } @@ -2816,12 +2825,16 @@ Returns:
>// 4. StartupAcm   //   for (Index = 0; Index <
> gFitTableContext.StartupAcmNumber; Index++) {-
> FitEntry[FitIndex].Address =
> gFitTableContext.StartupAcm[Index].Address;-*(UINT32
> *)&FitEntry[FitIndex].Size[0] = 0; //gFitTableContext.StartupAcm.Size / 16;-
> FitEntry[FitIndex].Version =
> (UINT16)gFitTableContext.StartupAcmVersion;-FitEntry[FitIndex].Type
> = FIT_TABLE_TYPE_STARTUP_ACM;-FitEntry[FitIndex].C_V = 0;-
> FitEntry[FitIndex].Checksum= 0;+FitEntrySizeValue   = 
> 0; //
> gFitTableContext.StartupAcm.Size / 16+FitEntry[FitIndex].Address  =
> gFitTableContext.StartupAcm[Index].Address;+FitEntry[FitIndex].Size[0]  =
> (UINT8)FitEntrySizeValue;+FitEntry[FitIndex].Size[1]  =
> (UINT8)(FitEntrySizeValue >> 8);+FitEntry[FitIndex].Size[2]  =
> (UINT8)(FitEntrySizeValue >> 16);+FitEntry[FitIndex].Rsvd = 0;+
> FitEntry[FitIndex].Version  = (UINT16)gFitTableContext.StartupAcmVersion;+
> FitEntry[FitIndex].Type = FIT_TABLE_TYPE_STARTUP_ACM;+
> FitEntry[FitIndex].C_V  = 0;+FitEntry[FitIndex].Checksum = 0;
> FitIndex++;   } @@ -2829,19 +2842,23 @@ Returns:
>// 4.5. DiagnosticAcm   //   if (gFitTableContext.DiagnstAcm.Address != 0) 
> {-
> FitEntry[FitIndex].Address  

Re: [edk2-devel] [PATCH v3 1/3] [edk2-platforms] Silicon/Intel/FitGen: Support multiple Startup ACM Type 2 entries in FitGen tool

2022-07-03 Thread Yuwei Chen
Reviewed-by: Yuwei Chen

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Lin,
> Jason1
> Sent: Friday, July 1, 2022 11:10 PM
> To: devel@edk2.groups.io
> Cc: Lin, Jason1 ; Feng, Bob C ;
> Gao, Liming ; Chen, Christine
> ; Oram, Isaac W ;
> Chaganty, Rangasai V ; Chiang, Dakota
> 
> Subject: [edk2-devel] [PATCH v3 1/3] [edk2-platforms] Silicon/Intel/FitGen:
> Support multiple Startup ACM Type 2 entries in FitGen tool
> 
> From: Jason1 Lin 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3958
> 
> Within current FitGen tool there had limitation only allow one S-ACM to
> generate the Type 2 entry.
> This code change is used to support multiple type 2 entries up to 0x20.
> 
> Signed-off-by: Jason1 Lin 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Isaac W Oram 
> Cc: Rangasai V Chaganty 
> Cc: Dakota Chiang 
> ---
>  Silicon/Intel/Tools/FitGen/FitGen.c | 89 +++-
> Silicon/Intel/Tools/FitGen/FitGen.h |  4 +-
>  2 files changed, 50 insertions(+), 43 deletions(-)
> 
> diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c
> b/Silicon/Intel/Tools/FitGen/FitGen.c
> index 4de72ea422..eac8fa8715 100644
> --- a/Silicon/Intel/Tools/FitGen/FitGen.c
> +++ b/Silicon/Intel/Tools/FitGen/FitGen.c
> @@ -2,7 +2,7 @@
>  This utility is part of build process for IA32/X64 FD. It generates FIT 
> table. -
> Copyright (c) 2010-2021, Intel Corporation. All rights
> reserved.+Copyright (c) 2010-2022, Intel Corporation. All rights
> reserved. SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -204,6
> +204,7 @@ typedef struct {
>   #define MAX_BIOS_MODULE_ENTRY  0x20 #define
> MAX_MICROCODE_ENTRY0x20+#define MAX_STARTUP_ACM_ENTRY  0x20
> #define MAX_OPTIONAL_ENTRY 0x20 #define MAX_PORT_ENTRY 0x20
> @@ -255,11 +256,12 @@ typedef struct {
>UINT32 FitEntryNumber;   UINT32
> BiosModuleNumber;   UINT32 MicrocodeNumber;+  UINT32
> StartupAcmNumber;   UINT32 OptionalModuleNumber;   UINT32
> PortModuleNumber;   UINT32 GlobalVersion;   UINT32
> FitHeaderVersion;-  FIT_TABLE_CONTEXT_ENTRYStartupAcm;+
> FIT_TABLE_CONTEXT_ENTRYStartupAcm[MAX_STARTUP_ACM_ENTRY];
> UINT32 StartupAcmVersion;   FIT_TABLE_CONTEXT_ENTRY
> DiagnstAcm;   UINT32 DiagnstAcmVersion;@@ -1149,14 
> +1151,15
> @@ Returns:
>Error (NULL, 0, 0, "-I Parameter incorrect, Header Type 
> unsupported!",
> NULL);   return 0; case FIT_TABLE_TYPE_STARTUP_ACM:-  
> if
> (gFitTableContext.StartupAcm.Type != 0) {-Error (NULL, 0, 0, "-I
> Parameter incorrect, Duplicated StartupAcm!", NULL);+  if
> (gFitTableContext.StartupAcmNumber >= MAX_STARTUP_ACM_ENTRY) {+
> Error (NULL, 0, 0, "-I Parameter incorrect, too many StartupAcm!", NULL);
> return 0;   }-  gFitTableContext.StartupAcm.Type=
> FIT_TABLE_TYPE_STARTUP_ACM;-
> gFitTableContext.StartupAcm.Address =
> (UINT32)BiosInfoStruct[BiosInfoIndex].Address;-
> gFitTableContext.StartupAcm.Size=
> (UINT32)BiosInfoStruct[BiosInfoIndex].Size;-
> gFitTableContext.StartupAcmVersion  =
> BiosInfoStruct[BiosInfoIndex].Version;+
> gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Type=
> FIT_TABLE_TYPE_STARTUP_ACM;+
> gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Address
> = (UINT32)BiosInfoStruct[BiosInfoIndex].Address;+
> gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Size=
> (UINT32)BiosInfoStruct[BiosInfoIndex].Size;+
> gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Version
> = BiosInfoStruct[BiosInfoIndex].Version;+
> gFitTableContext.StartupAcmNumber ++;
> gFitTableContext.FitEntryNumber ++;   break; case
> FIT_TABLE_TYPE_DIAGNST_ACM:@@ -1351,16 +1354,15 @@ Returns:
>//   // 1. StartupAcm   //-  do {+  while (TRUE) { if ((Index + 1 >= 
> argc) ||
> ((strcmp (argv[Index], "-S") != 0) &&  (strcmp (argv[Index], "-s") != 
> 0)) ) {-
> if (BiosInfoExist && (gFitTableContext.StartupAcm.Type ==
> FIT_TABLE_TYPE_STARTUP_ACM)) {-break;+  if
> (gFitTableContext.StartupAcmNumber == 0) {+printf ("-S not found.
> WARNING!\n");   } //  Error (NULL, 0, 0, "-S Parameter incorrect, 
> expect -
> S!", NULL); //  return 0;-  printf ("-S not found. WARNING!\n");
> break; } if (IsGuidData (argv[Index + 1], &Guid)) {@@ -1381,14 
> +1383,13
> @@ Returns:
>FileSize = xtoi (argv[Index + 2]);   Index += 3; }-if
> (gFitTableContext.StartupAcm.Type != 0) {-  Error (NULL, 0, 0, "-S 
> Parameter
> incorrect, Duplicated StartupAcm!", NULL);+if
> (gFitTableContext.StartupAcmNumber >= MAX_STARTUP_ACM_ENTRY) {+
> Error (NULL, 0, 0, "-S Parameter incorrect, too many StartupAcm!", NULL);
> return 0; }-gFitTableContext.StartupAcm.Type =
> FIT_TABLE_TYPE_STARTUP_ACM;-gFitTableContext.StartupAcm.Address =
> (UINT32) (UINTN) F

[edk2-devel] [PATCH v1 1/1] SecurityPkg : Sync PcdTpm2HashMask to the active PCR banks in the TPM

2022-07-03 Thread Snehal Kangralkar
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3923
According to definition of PcdTpm2HashMask, the mask reflects the PCR
banks which need to be extended.
In the Tcg2Pei SyncPcrAllocationsAndPcrMask function, we are setting
PcdTpm2HashMask to match the active PCR banks, but this will only occur
if the mask was originally set to 0.
Always syncing the PcdTpm2HashMask to the active PCR banks in the TPM.
Only then we do see the computed hashes are limited to those PCRs
which are active.

Cc: Jiewen Yao 
Cc: Qi Zhang 
Signed-off-by: Snehal Kangralkar 
---
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c 
b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 26bb5282a58b..a77d8c0a083c 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -279,15 +279,10 @@ SyncPcrAllocationsAndPcrMask (
   DEBUG ((DEBUG_INFO, "Tpm2GetCapabilitySupportedAndActivePcrs - 
TpmActivePcrBanks 0x%08x\n", TpmActivePcrBanks));
 
   Tpm2PcrMask = PcdGet32 (PcdTpm2HashMask);
-  if (Tpm2PcrMask == 0) {
-//
-// If PcdTpm2HashMask is zero, use ActivePcr setting.
-// Only when PcdTpm2HashMask is initialized to 0, will it be updated to 
current Active Pcrs.
-//
-PcdSet32S (PcdTpm2HashMask, TpmActivePcrBanks);
-Tpm2PcrMask = TpmActivePcrBanks;
-  }
 
+  // Sync the PcdTpm2HashMask to the active PCR banks.
+  PcdSet32S (PcdTpm2HashMask, TpmActivePcrBanks);
+  Tpm2PcrMask = TpmActivePcrBanks;
   DEBUG ((DEBUG_INFO, "Tpm2PcrMask 0x%08x\n", Tpm2PcrMask));
 
   //
-- 
2.36.1.windows.1



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




Re: [edk2-devel] [PATCH] ArmPkg/Drivers: ArmGicIsInterruptEnabled returns incorrect value

2022-07-03 Thread Robbie King
Thanks Ard, this was due to an actual failure that was a bit of a challenge to 
debug.

A test in the ARM SBSA test suite installs the ISR first (which enables the 
interrupt) and then calls in to UEFI
to change the interrupt type (EDGE vs LEVEL) as specified in the ACPI table.  
The UEFI code calls this failing
routine to determine if it needs to disable the interrupt before changing the 
interrupt type.  Since it received a bad
result, it did not disable the interrupt before changing the type.  The GICV3 
says the behavior is
undefined if you do this, and the GIC ignored changing the type, and the test 
would fail due to the
interrupt not firing.  

Had our TF-A code set the interrupt type to the correct value, or if the test 
had changed type first and then installed
the ISR, we would not have found it.

Hope this makes sense.

-Original Message-
From: Ard Biesheuvel  
Sent: Friday, July 1, 2022 11:16 AM
To: Robbie King 
Cc: edk2-devel-groups-io ; Leif Lindholm 
; Sami Mujawar 
Subject: Re: [PATCH] ArmPkg/Drivers: ArmGicIsInterruptEnabled returns incorrect 
value

On Fri, 1 Jul 2022 at 17:07, Robbie King  wrote:
>
> The issue appears to have been introduced by:
>
> 41fb5d46 : ArmPkg/ArmGic: Use the GIC Redistributor instead of GIC 
> Distributor for GICv3
>
> The changes to ArmGicIsInterruptEnabled() introduced the error where 
> the Boolean result is assigned to Interrupts, but then the bit 
> position check is performed again (against the computed Boolean result 
> instead of the interrupt mask) during the return statement.
>
> Fix removes erroneous test and relies on boolean test made at return.
>
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Signed-off-by: Robbie King 

Nice find! How did you spot this? Through inspection? Or due to an actual 
failure?

Reviewed-by: Ard Biesheuvel 

I'll go and queue this up, thanks.

> ---
>  ArmPkg/Drivers/ArmGic/ArmGicLib.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c 
> b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> index 58ab45f812..dd3670c7cc 100644
> --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> @@ -366,10 +366,9 @@ ArmGicIsInterruptEnabled (
>FeaturePcdGet (PcdArmGicV3WithV2Legacy) ||
>SourceIsSpi (Source))
>{
> -Interrupts = ((MmioRead32 (
> - GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
> - )
> -   & (1 << RegShift)) != 0);
> +Interrupts = MmioRead32 (
> +   GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
> +   );
>} else {
>  GicCpuRedistributorBase = GicGetCpuRedistributorBase (
>  GicRedistributorBase,
> --
> 2.17.1
>


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




[edk2-devel] [PATCH v1 0/1] Sync the PcdTpm2HashMask to the active PCR banks

2022-07-03 Thread Snehal Kangralkar
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3923
According to definition of PcdTpm2HashMask, the mask reflects the PCR
banks which need to be extended.
In the Tcg2Pei SyncPcrAllocationsAndPcrMask function, we are setting
PcdTpm2HashMask to match the active PCR banks, but this will only occur
if the mask was originally set to 0.
Always syncing the PcdTpm2HashMask to the active PCR banks in the TPM.
Only then we do see the computed hashes are limited to those PCRs
which are active.

Cc: Jiewen Yao 
Cc: Qi Zhang 
Signed-off-by: Snehal Kangralkar 

Snehal Kangralkar (1):
  SecurityPkg : Sync PcdTpm2HashMask to the active PCR banks in the TPM

 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

-- 
2.36.1.windows.1



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




[edk2-devel] [PATCH] ArmPkg/Drivers: ArmGicIsInterruptEnabled returns incorrect value

2022-07-03 Thread Robbie King
The issue appears to have been introduced by:

41fb5d46 : ArmPkg/ArmGic: Use the GIC Redistributor instead of GIC Distributor 
for GICv3

The changes to ArmGicIsInterruptEnabled() introduced the error where the Boolean
result is assigned to Interrupts, but then the bit position check is performed
again (against the computed Boolean result instead of the interrupt mask) during
the return statement.

Fix removes erroneous test and relies on boolean test made at return.

Cc: Leif Lindholm  
Cc: Ard Biesheuvel  
Cc: Sami Mujawar  
Signed-off-by: Robbie King 
---
 ArmPkg/Drivers/ArmGic/ArmGicLib.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c 
b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
index 58ab45f812..dd3670c7cc 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c
+++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
@@ -366,10 +366,9 @@ ArmGicIsInterruptEnabled (
   FeaturePcdGet (PcdArmGicV3WithV2Legacy) ||
   SourceIsSpi (Source))
   {
-Interrupts = ((MmioRead32 (
- GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
- )
-   & (1 << RegShift)) != 0);
+Interrupts = MmioRead32 (
+   GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
+   );
   } else {
 GicCpuRedistributorBase = GicGetCpuRedistributorBase (
 GicRedistributorBase,
-- 
2.17.1



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




[edk2-devel] Erorr during building Qualcomm sourcecode

2022-07-03 Thread Wiadzkowicz Fryderyk LDZ UDAS114
Hello,

I've encountered error during building Qualcomm deilivery with information to 
write an email to you. Please, see logs in attachment.

Pozdrawiam/Kind Regards

Fryderyk Wiadzkowicz
Software Engineer
ADAS Application Interface Software

ZF Automotive Systems Poland Sp. z o.o.
Division U - Electronics and ADAS
Lodz Engineering Center
Ul. PiƂsudskiego 86, 92-202 Lodz, Poland
Phone +48 42 293 8057
fryderyk.wiadzkow...@zf.com


ZF Automotive Systems Poland sp. z o.o., ul. Legionow 63, 42-202 Czestochowa, 
Poland,
Sad Rejonowy w Czestochowie, KRS nr 077409,
NIP nr 573-010-52-34, kapital zakladowy: 244.596.975,00 PLN

Niniejsza wiadomosc moze zawierac informacje poufne oraz/lub prawnie chronione, 
przeznaczone do wylacznego uzytku adresata. Jesli nie jestescie Panstwo 
adresatem przesylki lub jesli otrzymaliscie ja Panstwo omylkowo, prosimy o 
bezzwloczne skontaktowanie sie z nadawca i usuniecie tej wiadomosci. Wszelkie 
kopiowanie, wykorzystanie lub rozpowszechnianie tej wiadomosci czy tez 
zawartych w niej informacji przez osoby inne niz adresat jest niedozwolone i 
moze spowodowac odpowiedzialnosc prawna.
Informacje na temat przetwarzania Panstwa danych osobowych oraz na temat 
Panstwa praw znajduja sie w naszych informacjach o ochronie danych osobowych: 
zf.com/pl/data-protection-notice

ZF Automotive Systems Poland sp. z o.o., ul. Legionow 63, 42-202 Czestochowa, 
Poland
District Court for Czestochowa, KRS no. 077409,
tax identification no. NIP 573-010-52-34, share capital: 244.596.975,00 PLN

This e-mail together with any attachments, may contain confidential and/or 
privileged information. If you are not the intended recipient or have received 
this e-mail in error, please notify the sender immediately and delete this 
e-mail. Any unauthorized copying, disclosure or distribution of the material in 
this e-mail or any attachments is strictly forbidden.
You can find information about how we process your data and your rights in our 
data protection notice: zf.com/en/data-protection-notice


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




log.log
Description: log.log


Re: [edk2-devel] [Patch V2] pip-requirements.txt: Update basetools version to 0.1.24

2022-07-03 Thread Yuwei Chen
Reviewed-by: Yuwei Chen

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Bob
> Feng
> Sent: Thursday, June 30, 2022 12:11 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D ; Kubacki, Michael
> 
> Subject: [edk2-devel] [Patch V2] pip-requirements.txt: Update basetools
> version to 0.1.24
> 
> Upgrade the edk2-basetools version from 0.1.17 to 0.1.24
> 
> features and bug fixes:
> 1. Add FMMT Python Tool
> 2. Remove RVCT support
> 3. Fix dependency issue in PcdValueInit
> 4. Output the intermediate library instance when error occurs 5. Ecc: Fix
> grammar in Ecc error message 6. Fix the GenMake bug for .cpp source file
> 
> Signed-off-by: Bob Feng 
> Reviewed-by: Michael D Kinney 
> Acked-by: Michael Kubacki  ---update the
> commit message.
>  pip-requirements.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pip-requirements.txt b/pip-requirements.txt index
> 6585df201d..29424b08bd 100644
> --- a/pip-requirements.txt
> +++ b/pip-requirements.txt
> @@ -12,7 +12,7 @@
>  # https://www.python.org/dev/peps/pep-0440/#version-specifiers ##  edk2-
> pytool-library==0.11.2 edk2-pytool-extensions~=0.16.0-edk2-
> basetools==0.1.17+edk2-basetools==0.1.24 antlr4-python3-runtime==4.7.1--
> 2.29.1.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#90926): https://edk2.groups.io/g/devel/message/90926
> Mute This Topic: https://groups.io/mt/92080401/4546272
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [yuwei.c...@intel.com]
> -=-=-=-=-=-=
> 



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