Re: [edk2-devel] [PATCH v4 14/14] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

2024-05-05 Thread Ni, Ray
Reviewed-by: Ray Ni 

Thanks,
Ray

From: Wu, Jiaxin 
Sent: Friday, April 26, 2024 20:17
To: devel@edk2.groups.io 
Cc: Ni, Ray ; Zeng, Star ; Gerd Hoffmann 
; Kumar, Rahul R 
Subject: [PATCH v4 14/14] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation 
logic

This patch is to remove legacy SmBase relocation in
PiSmmCpuDxeSmm Driver. The responsibility for SmBase
relocation has been transferred to the SmmRelocationInit
interface, which now handles the following tasks:
1. Relocates the SmBase for each processor.
2. Generates the gSmmBaseHobGuid HOB.

As a result of this change, the PiSmmCpuDxeSmm driver's
role in SMM environment setup is simplified to:
1. Utilize the gSmmBaseHobGuid to determine the SmBase.
2. Perform the ExecuteFirstSmiInit() to do early SMM
initialization.

Cc: Ray Ni 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c|  21 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c   |  42 
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm  |  96 
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c|  10 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c   | 334 +++
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h   | 103 +
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf |   4 -
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmMpPerf.h|   2 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c   |  69 --
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/Semaphore.c|  69 --
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm   | 146 
 11 files changed, 40 insertions(+), 856 deletions(-)
 delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c
 delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm
 delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/X64/Semaphore.c
 delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
index b14c289a27..d67fb49890 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
@@ -639,27 +639,14 @@ InitializeCpuProcedure (
 //
 InitializeCpuBeforeRebase (IsBsp);
   }

   if (IsBsp) {
-DEBUG ((DEBUG_INFO, "SmmRestoreCpu: mSmmRelocated is %d\n", 
mSmmRelocated));
-
 //
-// Check whether Smm Relocation is done or not.
-// If not, will do the SmmBases Relocation here!!!
+// Issue SMI IPI (All Excluding  Self SMM IPI + BSP SMM IPI) to execute 
first SMI init.
 //
-if (!mSmmRelocated) {
-  //
-  // Restore SMBASE for BSP and all APs
-  //
-  SmmRelocateBases ();
-} else {
-  //
-  // Issue SMI IPI (All Excluding  Self SMM IPI + BSP SMM IPI) to execute 
first SMI init.
-  //
-  ExecuteFirstSmiInit ();
-}
+ExecuteFirstSmiInit ();
   }

   //
   // Skip initialization if mAcpiCpuData is not valid
   //
@@ -978,13 +965,13 @@ InitSmmS3ResumeState (
 SmmS3ResumeState->SmmS3StackBase = 
(EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePages (EFI_SIZE_TO_PAGES 
((UINTN)SmmS3ResumeState->SmmS3StackSize));
 if (SmmS3ResumeState->SmmS3StackBase == 0) {
   SmmS3ResumeState->SmmS3StackSize = 0;
 }

-SmmS3ResumeState->SmmS3Cr0 = mSmmCr0;
+SmmS3ResumeState->SmmS3Cr0 = (UINT32)AsmReadCr0 ();
 SmmS3ResumeState->SmmS3Cr3 = Cr3;
-SmmS3ResumeState->SmmS3Cr4 = mSmmCr4;
+SmmS3ResumeState->SmmS3Cr4 = (UINT32)AsmReadCr4 ();

 if (sizeof (UINTN) == sizeof (UINT64)) {
   SmmS3ResumeState->Signature = SMM_S3_RESUME_SMM_64;
 }

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c
deleted file mode 100644
index a9fcc89dda..00
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
-Semaphore mechanism to indicate to the BSP that an AP has exited SMM
-after SMBASE relocation.
-
-Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "PiSmmCpuDxeSmm.h"
-
-UINTN mSmmRelocationOriginalAddress;
-volatile BOOLEAN  *mRebasedFlag;
-
-/**
-  Hook return address of SMM Save State so that semaphore code
-  can be executed immediately after AP exits SMM to indicate to
-  the BSP that an AP has exited SMM after SMBASE relocation.
-
-  @param[in] CpuIndex The processor index.
-  @param[in] RebasedFlag  A pointer to a flag that is set to TRUE
-  immediately after AP exits SMM.
-
-**/
-VOID
-SemaphoreHook (
-  IN UINTN CpuIndex,
-  IN volatile BOOLEAN  *RebasedFlag
-  )
-{
-  SMRAM_SAVE_STATE_MAP  *CpuState;
-
-  mRebasedFlag = RebasedFlag;
-
-  CpuState  = (SMRAM_SAVE_STATE_MAP 
*)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);
-  mSmmRelocationOriginalAddress = (UINTN)HookReturnFromSmm (
-   CpuIndex,
-   CpuState,
-

Re: [edk2-devel] [PATCH v4 06/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary CpuIndex

2024-05-05 Thread Ni, Ray
Reviewed-by: Ray Ni 

Thanks,
Ray

From: Wu, Jiaxin 
Sent: Friday, April 26, 2024 20:17
To: devel@edk2.groups.io 
Cc: Ni, Ray ; Zeng, Star ; Gerd Hoffmann 
; Kumar, Rahul R 
Subject: [PATCH v4 06/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary 
CpuIndex

This patch is to remove unnecessary CpuIndex.

Cc: Ray Ni 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c |  3 ---
 .../Library/SmmRelocationLib/InternalSmmRelocationLib.h  |  5 -
 UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c   | 12 +++-
 UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c   |  3 ---
 UefiCpuPkg/Library/SmmRelocationLib/X64/Semaphore.c  |  3 ---
 5 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c 
b/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c
index ba329d6ba2..5d9eea3de9 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c
@@ -15,28 +15,25 @@ volatile BOOLEAN  *mRebasedFlag;
 /**
   Hook return address of SMM Save State so that semaphore code
   can be executed immediately after AP exits SMM to indicate to
   the BSP that an AP has exited SMM after SMBASE relocation.

-  @param[in] CpuIndex The processor index.
   @param[in] RebasedFlag  A pointer to a flag that is set to TRUE
   immediately after AP exits SMM.

 **/
 VOID
 SemaphoreHook (
-  IN UINTN CpuIndex,
   IN volatile BOOLEAN  *RebasedFlag
   )
 {
   SMRAM_SAVE_STATE_MAP  *CpuState;

   mRebasedFlag = RebasedFlag;

   CpuState  = (SMRAM_SAVE_STATE_MAP 
*)(UINTN)(SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET);
   mSmmRelocationOriginalAddress = (UINTN)HookReturnFromSmm (
-   CpuIndex,
CpuState,

(UINT64)(UINTN)&SmmRelocationSemaphoreComplete,

(UINT64)(UINTN)&SmmRelocationSemaphoreComplete
);
 }
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h 
b/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h
index ede61b956f..d1387f2dfb 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h
+++ b/UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h
@@ -81,12 +81,10 @@ SmmRelocationSemaphoreComplete (
   Hook the code executed immediately after an RSM instruction on the currently
   executing CPU.  The mode of code executed immediately after RSM must be
   detected, and the appropriate hook must be selected.  Always clear the auto
   HALT restart flag if it is set.

-  @param[in] CpuIndex The processor index for the currently
-  executing CPU.
   @param[in,out] CpuState Pointer to SMRAM Save State Map for 
the
   currently executing CPU.
   @param[in] NewInstructionPointer32  Instruction pointer to use if 
resuming to
   32-bit mode from 64-bit SMM.
   @param[in] NewInstructionPointerInstruction pointer to use if 
resuming to
@@ -96,29 +94,26 @@ SmmRelocationSemaphoreComplete (

 **/
 UINT64
 EFIAPI
 HookReturnFromSmm (
-  IN UINTN CpuIndex,
   IN OUT SMRAM_SAVE_STATE_MAP  *CpuState,
   IN UINT64NewInstructionPointer32,
   IN UINT64NewInstructionPointer
   );

 /**
   Hook return address of SMM Save State so that semaphore code
   can be executed immediately after AP exits SMM to indicate to
   the BSP that an AP has exited SMM after SMBASE relocation.

-  @param[in] CpuIndex The processor index.
   @param[in] RebasedFlag  A pointer to a flag that is set to TRUE
   immediately after AP exits SMM.

 **/
 VOID
 SemaphoreHook (
-  IN UINTN CpuIndex,
   IN volatile BOOLEAN  *RebasedFlag
   );

 /**
   This function fixes up the address of the global variable or function
diff --git a/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c 
b/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
index 86df66a280..7e65bbf929 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
@@ -29,15 +29,10 @@ UINT64  mSmBase;
 //
 // SmBase Rebased flag for current CPU
 //
 volatile BOOLEAN  mRebased;

-//
-// CpuIndex for current CPU
-//
-UINTN  mCpuIndex;
-
 /**
   This function will get the SmBase for CpuIndex.

   @param[in]   CpuIndexThe processor index.
   @param[in]   SmmRelocationStart  The start address of Smm relocated memory 
in SMRAM.
@@ -153,11 +148,11 @@ SmmInitHandler (
   //
   // Hook retu

Re: [edk2-devel] [PATCH v4 05/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable

2024-05-05 Thread Ni, Ray
Reviewed-by: Ray Ni 

Thanks,
Ray

From: Wu, Jiaxin 
Sent: Friday, April 26, 2024 20:17
To: devel@edk2.groups.io 
Cc: Ni, Ray ; Zeng, Star ; Gerd Hoffmann 
; Kumar, Rahul R 
Subject: [PATCH v4 05/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary 
global variable

This patch aims on mProcessorInfo global variable, which can be
defined as local variable in SmmRelocateBases(). With this patch,
no need to allocate the memory for all CPUs to store the
Processor Info.

Cc: Ray Ni 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 .../Library/SmmRelocationLib/SmmRelocationLib.c| 88 --
 1 file changed, 32 insertions(+), 56 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c 
b/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
index 3694a07cbb..86df66a280 100644
--- a/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
+++ b/UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c
@@ -14,15 +14,10 @@
 #include "InternalSmmRelocationLib.h"

 UINTN  mMaxNumberOfCpus = 1;
 UINTN  mNumberOfCpus= 1;

-//
-// Record all Processors Info
-//
-EFI_PROCESSOR_INFORMATION  *mProcessorInfo = NULL;
-
 //
 // IDT used during SMM Init
 //
 IA32_DESCRIPTOR  gcSmmInitIdtr;

@@ -34,10 +29,15 @@ UINT64  mSmBase;
 //
 // SmBase Rebased flag for current CPU
 //
 volatile BOOLEAN  mRebased;

+//
+// CpuIndex for current CPU
+//
+UINTN  mCpuIndex;
+
 /**
   This function will get the SmBase for CpuIndex.

   @param[in]   CpuIndexThe processor index.
   @param[in]   SmmRelocationStart  The start address of Smm relocated memory 
in SMRAM.
@@ -138,37 +138,26 @@ VOID
 EFIAPI
 SmmInitHandler (
   VOID
   )
 {
-  UINT32  ApicId;
-  UINTN   Index;
-
   //
   // Update SMM IDT entries' code segment and load IDT
   //
   AsmWriteIdtr (&gcSmmInitIdtr);
-  ApicId = GetApicId ();

-  for (Index = 0; Index < mNumberOfCpus; Index++) {
-if (ApicId == (UINT32)mProcessorInfo[Index].ProcessorId) {
-  //
-  // Configure SmBase.
-  //
-  ConfigureSmBase (mSmBase);
-
-  //
-  // Hook return after RSM to set SMM re-based flag
-  // SMM re-based flag can't be set before RSM, because SMM save state 
context might be override
-  // by next AP flow before it take effect.
-  //
-  SemaphoreHook (Index, &mRebased);
-  return;
-}
-  }
+  //
+  // Configure SmBase.
+  //
+  ConfigureSmBase (mSmBase);

-  ASSERT (FALSE);
+  //
+  // Hook return after RSM to set SMM re-based flag
+  // SMM re-based flag can't be set before RSM, because SMM save state context 
might be override
+  // by next AP flow before it take effect.
+  //
+  SemaphoreHook (mCpuIndex, &mRebased);
 }

 /**
   Relocate SmmBases for each processor.
   Execute on first boot and all S3 resumes
@@ -185,17 +174,19 @@ SmmRelocateBases (
   IN EDKII_PEI_MP_SERVICES2_PPI  *MpServices2,
   IN EFI_PHYSICAL_ADDRESSSmmRelocationStart,
   IN UINTN   TileSize
   )
 {
-  UINT8 BakBuf[BACK_BUF_SIZE];
-  SMRAM_SAVE_STATE_MAP  BakBuf2;
-  SMRAM_SAVE_STATE_MAP  *CpuStatePtr;
-  UINT8 *U8Ptr;
-  UINTN Index;
-  UINTN BspIndex;
-  UINT32BspApicId;
+  EFI_STATUS Status;
+  UINT8  BakBuf[BACK_BUF_SIZE];
+  SMRAM_SAVE_STATE_MAP   BakBuf2;
+  SMRAM_SAVE_STATE_MAP   *CpuStatePtr;
+  UINT8  *U8Ptr;
+  UINTN  Index;
+  UINTN  BspIndex;
+  UINT32 BspApicId;
+  EFI_PROCESSOR_INFORMATION  ProcessorInfo;

   //
   // Make sure the reserved size is large enough for procedure SmmInitTemplate.
   //
   ASSERT (sizeof (BakBuf) >= gcSmmInitSize);
@@ -230,14 +221,18 @@ SmmRelocateBases (
   // Relocate SM bases for all APs
   // This is APs' 1st SMI - rebase will be done here, and APs' default SMI 
handler will be overridden by gcSmmInitTemplate
   //
   BspIndex = (UINTN)-1;
   for (Index = 0; Index < mNumberOfCpus; Index++) {
-if (BspApicId != (UINT32)mProcessorInfo[Index].ProcessorId) {
-  mRebased = FALSE;
-  mSmBase  = GetSmBase (Index, SmmRelocationStart, TileSize);
-  SendSmiIpi ((UINT32)mProcessorInfo[Index].ProcessorId);
+Status = MpServices2->GetProcessorInfo (MpServices2, Index | 
CPU_V2_EXTENDED_TOPOLOGY, &ProcessorInfo);
+ASSERT_EFI_ERROR (Status);
+
+if (BspApicId != (UINT32)ProcessorInfo.ProcessorId) {
+  mRebased  = FALSE;
+  mSmBase   = GetSmBase (Index, SmmRelocationStart, TileSize);
+  mCpuIndex = Index;
+  SendSmiIpi ((UINT32)ProcessorInfo.ProcessorId);
   //
   // Wait for this AP to finish its 1st SMI
   //
   while (!mRebased) {
   }
@@ -443,11 +438,10 @@ SmmRelocationInit (
   UINTN TileSize;
   UINT64SmmRelocationSize;
   EFI_PHYSICAL_ADDRESS  SmmRelocationStart;
   UINTN SmmStackSize;

Re: [edk2-devel] [PATCH v3 0/3] TCG_Sp800_155_PlatformId_Event3 support

2024-05-05 Thread Yao, Jiewen
Hi Dionna
I tried to create PR but I saw failure - 
https://github.com/tianocore/edk2/pull/5628

Would you please clarify if you have tested the patch in EDKII CI, before you 
submit the patch?


BTW: I have fixed a typo in the V3 patch. The "Reviewed-By" tag in 1/3 should 
be "Reviewed-by".

Thank you
Yao, Jiewen



> -Original Message-
> From: Dionna Glaze 
> Sent: Thursday, May 2, 2024 8:50 AM
> To: devel@edk2.groups.io
> Cc: Dionna Glaze ; Kinney, Michael D
> ; Liming Gao ; Liu,
> Zhiguang ; Yao, Jiewen ;
> Kumar, Rahul R ; Ard Biesheuvel
> ; Gerd Hoffmann 
> Subject: [PATCH v3 0/3] TCG_Sp800_155_PlatformId_Event3 support
> 
> In December 2023, the TCG published the PC Client Platform Firmware
> Profile version 1.06 revision 52. This revision includes a new event
> type for NIST SP 800-155 recommended signed BIOS reference measurements.
> The new type allows for the event log auditor to find local or remote
> copies of the signed reference measurements.
> 
> Supporting this new event type eases the process of distributing signed
> reference measurements since the machine can now simply report where
> they can be found in a standard way.
> 
> Changes since v2:
>   - Removed errant spacing.
> Changes since v1:
>   - MdePkg defines TCG_Sp800_155_PlatformId_Event3 instead of adding a
> comment about Event3 to Event2.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Jiewen Yao 
> Cc: Rahul Kumar 
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffmann 
> Reviewed-by: Jiewen Yao 
> 
> Dionna Glaze (3):
>   MdePkg: Add TcgSp800155Event3 type info
>   SecurityPkg: recognize sp800155Event3 event too
>   OvmfPkg: add sp800155Event3 support
> 
>  .../IndustryStandard/UefiTcgPlatform.h| 38 ++-
>  OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c |  9 -
>  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c |  9 -
>  3 files changed, 51 insertions(+), 5 deletions(-)
> 
> --
> 2.45.0.rc0.197.gbae5840b3b-goog


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




Re: [edk2-devel] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Handle the NULL gMpInformation2HobGuid

2024-05-05 Thread Ni, Ray
Reviewed-by: Ray Ni 

Thanks,
Ray

From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Tuesday, April 30, 2024 15:45
To: Ni, Ray ; devel@edk2.groups.io 
Cc: Laszlo Ersek ; Kumar, Rahul R ; 
Gerd Hoffmann 
Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Handle the NULL 
gMpInformation2HobGuid


Hi Ray,

Some of AMD platform doesnt use CpuMpPeim.

Also this patch helps not to enforce the platform to brinup all AP's in PEI 
phase.


Thanks

AbduL


On 30-04-2024 11:17, Ni, Ray wrote:

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.

Abdul,
Does Amd PEI include the CpuMpPeim?
If it includes the PEIM, the MpInformation2Hob should be in the HOB database.

Thanks,
Ray

From: Abdul Lateef Attar 

Sent: Monday, April 29, 2024 19:17
To: devel@edk2.groups.io 

Cc: Abdul Lateef Attar 
; Ni, Ray 
; Laszlo Ersek 
; Kumar, Rahul R 
; Gerd Hoffmann 

Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Handle the NULL 
gMpInformation2HobGuid

If gMpInformation2HobGuid HOB is NULL,
then fall back to an older way of collecting
CPU information from the MP services library.

Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
Signed-off-by: Abdul Lateef Attar 

---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c   | 87 +++-
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf |  3 +-
 2 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
index 499f979d34..74e494f332 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
@@ -3,7 +3,7 @@ Agent Module to load other modules to deploy SMM Entry Vector 
for X86 CPU.

 Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.
 Copyright (c) 2017, AMD Incorporated. All rights reserved.
-Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.

 SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -750,6 +750,85 @@ MpInformation2HobCompare (
   return 0;
 }

+/**
+  Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all 
CPU from gEfiMpServiceProtocolGuid.
+
+  @param[out] NumberOfCpus   Pointer to NumberOfCpus.
+  @param[out] MaxNumberOfCpusPointer to MaxNumberOfCpus.
+
+  @retval ProcessorInfo  Pointer to EFI_PROCESSOR_INFORMATION 
buffer.
+**/
+EFI_PROCESSOR_INFORMATION *
+GetMpInformationFromMpServices (
+  OUT UINTN  *NumberOfCpus,
+  OUT UINTN  *MaxNumberOfCpus
+  )
+{
+  EFI_STATUS Status;
+  UINTN  Index;
+  UINTN  NumberOfEnabledProcessors;
+  UINTN  NumberOfProcessors;
+  EFI_MP_SERVICES_PROTOCOL   *MpService;
+  EFI_PROCESSOR_INFORMATION  *ProcessorInfo;
+
+  if ((NumberOfCpus == NULL) || (MaxNumberOfCpus == NULL)) {
+ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+return NULL;
+  }
+
+  ProcessorInfo= NULL;
+  *NumberOfCpus= 0;
+  *MaxNumberOfCpus = 0;
+
+  /// Get the MP Services Protocol
+  Status = gBS->LocateProtocol (&gEfiMpServiceProtocolGuid, NULL, (VOID 
**)&MpService);
+  if (EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+return NULL;
+  }
+
+  /// Get the number of processors
+  Status = MpService->GetNumberOfProcessors (MpService, &NumberOfProcessors, 
&NumberOfEnabledProcessors);
+  if (EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+return NULL;
+  }
+
+  ASSERT (NumberOfProcessors <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
+
+  /// Allocate buffer for processor information
+  ProcessorInfo = AllocateZeroPool (sizeof (EFI_PROCESSOR_INFORMATION) * 
NumberOfProcessors);
+  if (ProcessorInfo == NULL) {
+ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);
+return NULL;
+  }
+
+  /// Get processor information
+  for (Index = 0; Index < NumberOfProcessors; Index++) {
+Status = MpService->GetProcessorInfo (MpService, Index | 
CPU_V2_EXTENDED_TOPOLOGY, &ProcessorInfo[Index]);
+if (EFI_ERROR (Status)) {
+  FreePool (ProcessorInfo);
+  DEBUG ((DEBUG_ERROR, "%a: Failed to get processor information for 
processor %d\n", __func__, Index));
+  ASSERT_EFI_ERROR (Status);
+  return NULL;
+}
+  }
+
+  *NumberOfCpus = NumberOfEnabledProcessors;
+
+  ASSERT (*NumberOfCpus <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
+  //
+  // If support CPU hot plug, we need to allocate resources for possibly 
hot-added processors
+  //
+  

[edk2-devel] [PATCH] DynamicTablesPkg: Adds integer to the AML package node

2024-05-05 Thread Abdul Lateef Attar via groups.io
Adds an AmlAddIntegerPackageEntry() API to generate AML code,
which adds an integer value to the package node.

Cc: Pierre Gondois 
Cc: Sami Mujawar 
Signed-off-by: Abdul Lateef Attar 
---
 .../Include/Library/AmlLib/AmlLib.h   | 41 +-
 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 75 +++
 2 files changed, 115 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 82d5464084..7ae11e3624 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -2,7 +2,7 @@
   AML Lib.
 
   Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.
-  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+  Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -1838,4 +1838,43 @@ AmlCreatePsdNode (
   OUT AML_OBJECT_NODE_HANDLE  *NewPsdNode   OPTIONAL
   );
 
+/** Add an integer value to Package node.
+
+  AmlCodeGenNamePackage ("_CID", NULL, &PackageNode);
+  AmlGetEisaIdFromString ("PNP0A03", &EisaId);
+  AmlAddIntegerPackageEntry (EisaId, PackageNameNode);
+  AmlGetEisaIdFromString ("PNP0A08", &EisaId);
+  AmlAddIntegerPackageEntry (EisaId, PackageNameNode);
+
+  equivalent of the following ASL code:
+  Name (_CID, Package (0x02)  // _CID: Compatible ID
+  {
+  EisaId ("PNP0A03"),
+  EisaId ("PNP0A08")
+  })
+
+  The package is added at the tail of the list of the input package node
+  name:
+Name ("NamePackageNode", Package () {
+  [Pre-existing package entries],
+  [Newly created integer entry]
+})
+
+
+  @ingroup CodeGenApis
+
+  @param [in]   Integer  Integer value that need to be added to 
package node.
+  @param [in, out]  PackageNameNode  Package named node to add the object to 

+
+  @retval EFI_SUCCESS Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval Others  Error occurred during the operation.
+**/
+EFI_STATUS
+EFIAPI
+AmlAddIntegerPackageEntry (
+  INUINT32  Integer,
+  IN  OUT   AML_OBJECT_NODE_HANDLE  PackageNameNode
+  );
+
 #endif // AML_LIB_H_
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index 22c2d598d0..735b359bd5 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -4296,3 +4296,78 @@ error_handler:
   AmlDeleteTree ((AML_NODE_HANDLE)PsdNode);
   return Status;
 }
+
+/** Add an integer value to Package node.
+
+  AmlCodeGenNamePackage ("_CID", NULL, &PackageNode);
+  AmlGetEisaIdFromString ("PNP0A03", &EisaId);
+  AmlAddIntegerPackageEntry (EisaId, PackageNameNode);
+  AmlGetEisaIdFromString ("PNP0A08", &EisaId);
+  AmlAddIntegerPackageEntry (EisaId, PackageNameNode);
+
+  equivalent of the following ASL code:
+  Name (_CID, Package (0x02)  // _CID: Compatible ID
+  {
+  EisaId ("PNP0A03"),
+  EisaId ("PNP0A08")
+  })
+
+  The package is added at the tail of the list of the input package node
+  name:
+Name ("NamePackageNode", Package () {
+  [Pre-existing package entries],
+  [Newly created integer entry]
+})
+
+
+  @ingroup CodeGenApis
+
+  @param [in]   Integer  Integer value that need to be added to 
package node.
+  @param [in, out]  PackageNameNode  Package named node to add the object to 

+
+  @retval EFI_SUCCESS Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval Others  Error occurred during the operation.
+**/
+EFI_STATUS
+EFIAPI
+AmlAddIntegerPackageEntry (
+  INUINT32  Integer,
+  IN  OUT   AML_OBJECT_NODE_HANDLE  PackageNameNode
+  )
+{
+  EFI_STATUS   Status;
+  AML_OBJECT_NODE  *PackageEntryList;
+
+  if (PackageNameNode == NULL) {
+ASSERT_EFI_ERROR (FALSE);
+return EFI_INVALID_PARAMETER;
+  }
+
+  if ((PackageNameNode == NULL) ||
+  (AmlGetNodeType ((AML_NODE_HANDLE)PackageNameNode) != EAmlNodeObject) ||
+  (!AmlNodeHasOpCode (PackageNameNode, AML_NAME_OP, 0)))
+  {
+ASSERT_EFI_ERROR (FALSE);
+return EFI_INVALID_PARAMETER;
+  }
+
+  PackageEntryList = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
+   PackageNameNode,
+   EAmlParseIndexTerm1
+   );
+  if ((PackageEntryList == NULL)  
||
+  (AmlGetNodeType ((AML_NODE_HANDLE)PackageEntryList) != EAmlNodeObject)  
||
+  (!AmlNodeHasOpCode (PackageEntryList, AML_PACKAGE_OP, 0)))
+  {
+ASSERT_EFI_ERROR (FALSE);
+return EFI_INVALID_PARAMETER;
+  }
+
+  Status = AmlAddRegisterOrIntegerToPackage (NULL, Integer, PackageEntryList);
+  if (

[edk2-devel] 回复: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to Dmem.c

2024-05-05 Thread gaoliming via groups.io
Sam:

Thanks for your update. This version patch is good to me. Reviewed-by:
Liming Gao 

Besides, is there a Pull Request for this patch set?

Thanks
Liming
> -邮件原件-
> 发件人: Sam Kaynor 
> 发送时间: 2024年5月1日 22:58
> 收件人: devel@edk2.groups.io
> 抄送: Ray Ni ; Zhichao Gao ;
> Michael D Kinney ; Liming Gao
> ; Zhiguang Liu ; Stuart
> Yoder 
> 主题: [PATCH v7 0/5] Adding support for veborse UEFI Table dumping to
> Dmem.c
> 
> This adds an additional option to the dmem UEFI shell command for verbose
> dumping of a couple of UEFI tables.
> 
> The tables specified are the RT Properties Table, the Image Execution
Table,
> and the Conformance Profiles table.
> 
> Supporting objects are added in the .inf and .uni files relating to Dmem.c
and
> an additional header file for the Conformance Profiles table was added.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
> 
> v6->v7:
> - Additional patch to separate UEFI and EBBR Guids
> 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Stuart Yoder 
> Signed-off-by: Sam Kaynor 
> 
> Sam Kaynor (5):
>   ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in
> Dmem.c
>   ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
>   MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE
>   MdePkg: Adding EBBR EFI_CONFORMANCE_PROFILE_TABLE GUIDs
>   ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c
> 
>  MdePkg/MdePkg.dec
> |  10 +
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> ib.inf |   4 +
>  MdePkg/Include/Guid/ConformanceProfiles.h
> |  63 
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> | 321 ++--
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsL
> ib.uni |  31 +-
>  5 files changed, 402 insertions(+), 27 deletions(-)
>  create mode 100644 MdePkg/Include/Guid/ConformanceProfiles.h
> 
> --
> 2.34.1





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




回复: [edk2-devel] [PATCH v3 1/3] MdePkg: Add TcgSp800155Event3 type info

2024-05-05 Thread gaoliming via groups.io
Acked-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Dionna Glaze
> via groups.io
> 发送时间: 2024年5月2日 8:50
> 收件人: devel@edk2.groups.io
> 抄送: Dionna Glaze ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu ; Jiewen Yao 
> 主题: [edk2-devel] [PATCH v3 1/3] MdePkg: Add TcgSp800155Event3 type
> info
> 
> TCG PC Client Platform Firmware Profile 1.06 revision 52 of December
> 2023 added a new event signature and extended information about where a
> reference measurement document for the firmware can be found.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> 
> Reviewed-By: Jiewen Yao 
> Signed-off-by: Dionna Glaze 
> ---
>  .../IndustryStandard/UefiTcgPlatform.h| 38
> ++-
>  1 file changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> index 61bd4e4667..aaee5d6c88 100644
> --- a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> +++ b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> @@ -451,6 +451,7 @@ typedef struct tdTCG_PCClientTaggedEvent {
> 
>  #define TCG_Sp800_155_PlatformId_Event_SIGNATURE   "SP800-155
> Event"
>  #define TCG_Sp800_155_PlatformId_Event2_SIGNATURE  "SP800-155
> Event2"
> +#define TCG_Sp800_155_PlatformId_Event3_SIGNATURE  "SP800-155
> Event3"
> 
>  typedef struct tdTCG_Sp800_155_PlatformId_Event2 {
>UINT8   Signature[16];
> @@ -478,9 +479,44 @@ typedef struct
> tdTCG_Sp800_155_PlatformId_Event2 {
>// UINT8
> FirmwareManufacturerStr[FirmwareManufacturerStrSize];
>// UINT32  FirmwareManufacturerId;
>// UINT8   FirmwareVersion;
> -  // UINT8   FirmwareVersion[FirmwareVersionSize]];
> +  // UINT8   FirmwareVersion[FirmwareVersionSize];
>  } TCG_Sp800_155_PlatformId_Event2;
> 
> +typedef struct tdTCG_Sp800_155_PlatformId_Event3 {
> +  UINT8   Signature[16];
> +  //
> +  // Where Vendor ID is an integer defined
> +  // at http://www.iana.org/assignments/enterprisenumbers
> +  //
> +  UINT32  VendorId;
> +  //
> +  // 16-byte identifier of a given platform's static configuration of code
> +  //
> +  EFI_GUIDReferenceManifestGuid;
> +  // UINT8   PlatformManufacturerStrSize;
> +  // UINT8
> PlatformManufacturerStr[PlatformManufacturerStrSize];
> +  // UINT8   PlatformModelSize;
> +  // UINT8   PlatformModel[PlatformModelSize];
> +  // UINT8   PlatformVersionSize;
> +  // UINT8   PlatformVersion[PlatformVersionSize];
> +  // UINT8   PlatformModelSize;
> +  // UINT8   PlatformModel[PlatformModelSize];
> +  // UINT8   FirmwareManufacturerStrSize;
> +  // UINT8
> FirmwareManufacturerStr[FirmwareManufacturerStrSize];
> +  // UINT32  FirmwareManufacturerId;
> +  // UINT8   FirmwareVersion;
> +  // UINT8   FirmwareVersion[FirmwareVersionSize];
> +  //
> +  // Below structure is newly added in TCG_Sp800_155_PlatformId_Event3
> +  //
> +  // UINT32  RimLocatorType;
> +  // UINT32  RimLocatorLength;
> +  // UINT8   RimLocator[RimLocatorLength];
> +  // UINT32  PlatformCertLocatorType;
> +  // UINT32  PlatformCertLocatorLength;
> +  // UINT8
> PlatformCertLocator[PlatformCertLocatorLength];
> +} TCG_Sp800_155_PlatformId_Event3;
> +
>  #define TCG_EfiStartupLocalityEvent_SIGNATURE  "StartupLocality"
> 
>  //
> --
> 2.45.0.rc0.197.gbae5840b3b-goog
> 
> 
> 
> 
> 





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




[edk2-devel] 回复: [EXTERNAL] 回复: [PATCH 0/7] General Updates based on UEFI 2.10 and PI 1.8 Specification

2024-05-05 Thread gaoliming via groups.io
Felix:
 I understand your point. I would suggest to directly add 
PI_SPECIFICATION_VERSION definition, and update PEI/DXE/SMM version to align 
with it. 
 
 Original PEI/DXE/SMM minor and major version definitions are still kept now. 

Thanks
Liming
> -邮件原件-
> 发件人: Felix Polyudov 
> 发送时间: 2024年5月1日 6:35
> 收件人: gaoliming ; Sachin Ganesh
> ; devel@edk2.groups.io
> 抄送: zhiguang@intel.com; michael.d.kin...@intel.com;
> ardb+tianoc...@kernel.org; kra...@redhat.com; jiewen@intel.com;
> erdemak...@google.com; min.m...@intel.com; thomas.lenda...@amd.com;
> Dhanaraj V 
> 主题: RE: [EXTERNAL] 回复: [PATCH 0/7] General Updates based on UEFI
> 2.10 and PI 1.8 Specification
> 
> Liming,
> 
> In PI 1.8 macros for major and minor versions have been replaced with a
> single revision macro combining both version elements.
> Refer to:
> PEI:
> https://uefi.org/specs/PI/1.8/V1_PEI_Services_Table.html#related-definition
> s
> DXE: https://uefi.org/specs/PI/1.8/V2_UEFI_System_Table.html#dxe-services
> MM:
> https://uefi.org/specs/PI/1.8/V4_Management_Mode_System_Table.html#e
> fi-mm-system-table
> 
> If patch is updated to literally follow the spec, the following macros will be
> removed:
> PEI_SPECIFICATION_MAJOR_REVISION
> PEI_SPECIFICATION_MINOR_REVISION
> DXE_SPECIFICATION_MAJOR_REVISION
> DXE_SPECIFICATION_MINOR_REVISION
> MM_SPECIFICATION_MAJOR_REVISION
> MM_SPECIFICATION_MINOR_REVISION
> 
> These macros exist for a long time, so their removal can break some code in
> the downstream projects.
> That's why we thought it would be safer to honor the spirit of the spec
> without following it literally.
> 
> Let us know if you want us to update the patch to match the spec.
> 
> -Original Message-
> From: gaoliming 
> Sent: Friday, April 26, 2024 5:23 AM
> To: Sachin Ganesh ; Felix Polyudov
> ; devel@edk2.groups.io
> Cc: zhiguang@intel.com; michael.d.kin...@intel.com;
> ardb+tianoc...@kernel.org; kra...@redhat.com; jiewen@intel.com;
> erdemak...@google.com; min.m...@intel.com; thomas.lenda...@amd.com;
> Dhanaraj V 
> Subject: 回复: [EXTERNAL] 回复: [PATCH 0/7] General Updates based on
> UEFI 2.10 and PI 1.8 Specification
> 
> Felix and Sachin:
>   I don't find PI_SPECIFICATION_MINOR_REVISION definition from the latest
> public PI 1.8A. So, this change may not be added now.
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Sachin Ganesh 
> > 发送时间: 2024年4月25日 17:57
> > 收件人: Felix Polyudov ; gaoliming
> > ; devel@edk2.groups.io
> > 抄送: zhiguang@intel.com; michael.d.kin...@intel.com;
> > ardb+tianoc...@kernel.org; kra...@redhat.com; jiewen@intel.com;
> > erdemak...@google.com; min.m...@intel.com;
> thomas.lenda...@amd.com;
> > Dhanaraj V 
> > 主题: RE: [EXTERNAL] 回复: [PATCH 0/7] General Updates based on UEFI
> > 2.10 and PI 1.8 Specification
> >
> > Hi Felix/ Liming,
> >
> > Thank you for your comments. Patch 6 has been updated to only focus on
> > consolidating the revision macros.
> >
> > Patch Link:
> >
> https://edk2.groups.io/g/devel/message/118246?p=%2C%2C%2C20%2C0%2
> 52
> >
> C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2Csachin%2C20%2C2%2C0%
> > 2C105721897
> > PR Link: https://github.com/tianocore/edk2/pull/5569
> >
> > Thank you,
> > Sachin.
> >
> > -Original Message-
> > From: Felix Polyudov 
> > Sent: Tuesday, April 23, 2024 10:58 PM
> > To: gaoliming ; Sachin Ganesh
> > ; devel@edk2.groups.io
> > Cc: zhiguang@intel.com; michael.d.kin...@intel.com;
> > ardb+tianoc...@kernel.org; kra...@redhat.com; jiewen@intel.com;
> > erdemak...@google.com; min.m...@intel.com;
> thomas.lenda...@amd.com;
> > Dhanaraj V 
> > Subject: RE: [EXTERNAL] 回复: [PATCH 0/7] General Updates based on
> UEFI
> > 2.10 and PI 1.8 Specification
> >
> > I think patch 6 can be updated to introduce unified PI specification
> versioning
> > macros without incrementing the minor revision, by changing
> > PI_SPECIFICATION_MINOR_REVISION back to 70.
> > This will ensure compliance with the versioning schema introduced in PI
> 1.7B
> > without changing the PI support level.
> > (the macros were introduced by PIWG mantis 2101)
> >
> > -Original Message-
> > From: gaoliming 
> > Sent: Tuesday, April 23, 2024 10:49 AM
> > To: Sachin Ganesh ; devel@edk2.groups.io
> > Cc: zhiguang@intel.com; michael.d.kin...@intel.com;
> > ardb+tianoc...@kernel.org; kra...@redhat.com; jiewen@intel.com;
> > erdemak...@google.com; min.m...@intel.com;
> thomas.lenda...@amd.com;
> > Felix Polyudov ; Dhanaraj V 
> > Subject: [EXTERNAL] 回复: [PATCH 0/7] General Updates based on UEFI
> 2.10
> > and PI 1.8 Specification
> >
> >
> > **CAUTION: The e-mail below is from an external source. Please exercise
> > caution before opening attachments, clicking links, or following guidance.**
> >
> > Except for Patch 6/7, others are good to me. Reviewed-by: Liming Gao
> > 
> >
> > I suggest to merge others first. The patch 6/7 to update PI version from 1.7
> to
> > 1.8 can be discussed first.
> >
> > Thanks
> > Liming
> > > -邮件原件-
> > > 发

Re: [edk2-devel] [PATCH v2] XiangshanSeriesPkg:Add BOSC NanhuDev platform

2024-05-05 Thread WangYang
Hi,Sunil V L

   Excuse me,who will receive this patch next?

Best Regards,
Yang Wang

> -原始邮件-
> 发件人: "Sunil V L" 
> 发送时间: 2024-04-19 18:08:25 (星期五)
> 收件人: devel@edk2.groups.io, wangy...@bosc.ac.cn
> 抄送: g...@danielschaefer.me, "Ran Wang" , "YunFeng Yang" 
> , "YaXing Guo" , "Leif 
> Lindholm" , "Michael D Kinney" 
> 
> 主题: Re: [edk2-devel] [PATCH v2] XiangshanSeriesPkg:Add BOSC NanhuDev platform
> 
> On Wed, Apr 10, 2024 at 01:50:12PM +0800, WangYang wrote:
> > This commit adds the initial support for BOSC's
> > nanhu platform which provides up to 2 RISC-V RV64
> > processor cores.
> > 
> > Signed-off-by: Yang Wang 
> > Signed-off-by: Ran Wang 
> > Signed-off-by: YunFeng Yang 
> > Signed-off-by: YaXing Guo 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Cc: Sunil V L 
> > Cc: Daniel Schaefer 
> > 
> > ---
> >  V2:This solution is changed to EDK2 as the payload of opensbi.
> > 
> >  Platform/Bosc/Readme.md   |  61 ++
> >  .../XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc  | 552 ++
> >  .../XiangshanSeriesPkg/NanhuDev/NanhuDev.fdf  | 241 
> >  .../NanhuDev/NanhuDev.fdf.inc |  62 ++
> >  .../NanhuDev/VarStore.fdf.inc |  77 +++
> >  Silicon/Bosc/NanHuPkg/NanHuDevPkg.dec |  31 +
> >  Silicon/Bosc/NanHuPkg/NanHuPkg.uni|  13 +
> >  Silicon/Bosc/NanHuPkg/NanHuPkgExtra.uni   |  13 +
> >  8 files changed, 1050 insertions(+)
> >  create mode 100644 Platform/Bosc/Readme.md
> >  create mode 100644 Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc
> >  create mode 100644 Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.fdf
> >  create mode 100644 
> > Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.fdf.inc
> >  create mode 100644 
> > Platform/Bosc/XiangshanSeriesPkg/NanhuDev/VarStore.fdf.inc
> >  create mode 100644 Silicon/Bosc/NanHuPkg/NanHuDevPkg.dec
> >  create mode 100644 Silicon/Bosc/NanHuPkg/NanHuPkg.uni
> >  create mode 100644 Silicon/Bosc/NanHuPkg/NanHuPkgExtra.uni
> > 
> Acked-by: Sunil V L  


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




[edk2-devel] 回复: [PATCH v4 1/1] MdePkg: Added new SPCR table Revision 4 structure

2024-05-05 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Praveen Sankar N 
> 发送时间: 2024年5月2日 19:16
> 收件人: devel@edk2.groups.io
> 抄送: gaolim...@byosoft.com.cn; Srinivasan Mani ;
> Sundaresan S ; michael.d.kin...@intel.com;
> zhiguang@intel.com; Felix Polyudov ; Rabisha R
> 
> 主题: [PATCH v4 1/1] MdePkg: Added new SPCR table Revision 4 structure
> 
> In SPCR table, 4 structure members have been added newly as per SPCR
> table Revision 4, which has to be added in
> MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h.
> 
> Signed-off-by: Praveen Sankar N praveensank...@ami.com
> 
> Cc: michael.d.kin...@intel.com
> 
> Cc: gaolim...@byosoft.com.cn
> 
> Cc: zhiguang@intel.com
> 
> Cc: fel...@ami.com
> 
> Cc: srinivas...@ami.com
> 
> Cc: sundares...@ami.com
> 
> Cc: rabis...@ami.com
> ---
>  .../SerialPortConsoleRedirectionTable.h   | 32 +++
>  1 file changed, 32 insertions(+)
> 
> diff --git
> a/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> b/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> index eb5ae28390..bf967880ab 100644
> --- a/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> +++
> b/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> @@ -23,6 +23,7 @@
>  ///
> 
>  #define
> EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION  0x02
> 
> 
> 
> +#define
> EFI_ACPI_4_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION
> 0x04
> 
>  ///
> 
>  /// Serial Port Console Redirection Table Format
> 
>  ///
> 
> @@ -50,6 +51,37 @@ typedef struct {
>UINT32Reserved3;
> 
>  } EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE;
> 
> 
> 
> +///
> 
> +/// Serial Port Console Redirection Table Format Revision 4
> 
> +///
> 
> +typedef struct {
> 
> +  EFI_ACPI_DESCRIPTION_HEADER   Header;
> 
> +  UINT8 InterfaceType;
> 
> +  UINT8 Reserved1[3];
> 
> +  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTUREBaseAddress;
> 
> +  UINT8 InterruptType;
> 
> +  UINT8 Irq;
> 
> +  UINT32
> GlobalSystemInterrupt;
> 
> +  UINT8 BaudRate;
> 
> +  UINT8 Parity;
> 
> +  UINT8 StopBits;
> 
> +  UINT8 FlowControl;
> 
> +  UINT8 TerminalType;
> 
> +  UINT8 Reserved2;
> 
> +  UINT16PciDeviceId;
> 
> +  UINT16PciVendorId;
> 
> +  UINT8 PciBusNumber;
> 
> +  UINT8 PciDeviceNumber;
> 
> +  UINT8 PciFunctionNumber;
> 
> +  UINT32PciFlags;
> 
> +  UINT8 PciSegment;
> 
> +  UINT32UartClockFrequency;
> 
> +  UINT32PreciseBaudRate;
> 
> +  UINT16
> NameSpaceStrLength;
> 
> +  UINT16
> NameSpaceStrOffset;
> 
> +  CHAR8
> NameSpaceString[0];
> 
> +} EFI_ACPI_4_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE;
> 
> +
> 
>  #pragma pack()
> 
> 
> 
>  //
> 
> --
> 2.38.1.windows.1
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is intended
to
> be read only by the individual or entity to whom it is addressed or by
their
> designee. If the reader of this message is not the intended recipient, you
are
> on notice that any distribution of this message, in any form, is strictly
> prohibited. Please promptly notify the sender by reply e-mail or by
telephone
> at 770-246-8600, and then delete or destroy all copies of the
transmission=




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




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, May 6, 2024 #cal-reminder

2024-05-05 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, May 6, 2024
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d

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

*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 (#118577): https://edk2.groups.io/g/devel/message/118577
Mute This Topic: https://groups.io/mt/105931057/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] edk2-test Release candidate 2: edk2-test-rc2_202405

2024-05-05 Thread Heinrich Schuchardt

On 5/4/24 01:47, G Edhaya Chandran wrote:

Hi All,
    A new release candidate is published after upstreaming Stuart's 
commits on build cleanup.
_https://github.com/tianocore/edk2-test/tree/edk2-test-rc2_202405_ 

The updates since the old tag are the following commits in the patch 
series:
_[PATCH v2 0/4] TCG2 protocol clean up (groups.io)_ 


The release candidate may be used for any further testing.
With Warm Regards,
Edhay


Hello Edhaya,

I am not allowed to create the folder structure for uploading the test 
results.


Could you, please, create it and inform us.

Best regards

Heinrich


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




Re: [edk2-rfc] [edk2-devel] Proposal to switch TianoCore Code Review from email to GitHub Pull Requests on 5-24-2024

2024-05-05 Thread Pedro Falcato
On Sat, May 4, 2024 at 1:57 AM Michael Kubacki
 wrote:
>
> On 5/3/2024 4:38 PM, Michael D Kinney wrote:
> >
> >
> >> -Original Message-
> >> From: Kinney, Michael D 
> >> Sent: Friday, May 3, 2024 1:13 PM
> >> To: Pedro Falcato 
> >> Cc: r...@edk2.groups.io; devel@edk2.groups.io; Leif Lindholm
> >> ; Andrew Fish (af...@apple.com) ;
> >> Kinney, Michael D 
> >> Subject: RE: [edk2-rfc] [edk2-devel] Proposal to switch TianoCore Code
> >> Review from email to GitHub Pull Requests on 5-24-2024
> >>
> >>
> >>
> >>> -Original Message-
> >>> From: Pedro Falcato 
> >>> Sent: Friday, May 3, 2024 10:39 AM
> >>> To: Kinney, Michael D 
> >>> Cc: r...@edk2.groups.io; devel@edk2.groups.io; Leif Lindholm
> >>> ; Andrew Fish (af...@apple.com) 
> >>> Subject: Re: [edk2-rfc] [edk2-devel] Proposal to switch TianoCore Code
> >>> Review from email to GitHub Pull Requests on 5-24-2024
> >>>
> >>> On Thu, May 2, 2024 at 7:17 PM Kinney, Michael D
> >>>  wrote:
> 
> 
> 
> > -Original Message-
> > From: r...@edk2.groups.io  On Behalf Of Pedro
> >>> Falcato
> > Sent: Thursday, May 2, 2024 10:51 AM
> > To: devel@edk2.groups.io; Kinney, Michael D
> >>> 
> > Cc: r...@edk2.groups.io; Leif Lindholm ; Andrew
> >>> Fish
> > (af...@apple.com) 
> > Subject: Re: [edk2-rfc] [edk2-devel] Proposal to switch TianoCore
> >>> Code
> > Review from email to GitHub Pull Requests on 5-24-2024
> >
> > On Wed, May 1, 2024 at 6:44 PM Michael D Kinney via groups.io
> >  wrote:
> >>> 
> >> * All contributors, maintainers, and reviewers must have GitHub
> >>> IDs.
> >> * The commit message would no longer require Cc:, Reviewed-by:,
> >>> Acked-
> > by:
> >>or Tested-by: tags.  The only required tag would be Signed-
> >> off-
> >>> by.
> >
> > I'd just like to note that losing the CC:, Reviewed-by:, etc is a
> >>> big
> > loss. Gerrit auto-adds Rb's, github PR's do not (I'd guess there's
> >> a
> > way to pull that off with github actions, but I haven't looked).
> >>> It'll
> > be a mess if I have to go through online GH PR backlogs just to
> >> find
> > who to CC/add-to-review. It kills the decentralized bit off of git
> >>> too
> > :)
> >
> 
>  Can you provide more details on the impact of the loss?
> >>>
> >>> In my view, commits should be fairly self-describing. What changes,
> >>> why, are obvious, but who looked at it, who reviewed it, who was cc'd
> >>> but didn't respond, who tested are also pretty important. Git is
> >>> supposed to be decentralized, let's not forget. If we ever migrate
> >>> from GH, if GH ever goes down, if the links ever go down, you'll never
> >>> be able to know who looked at it. If you're looking at an EDK2 commit
> >>> deep into an Intel-internal fork, you won't know what "PR #478" is
> >>> (heck, rebase-and-merge doesn't reference PRs either).
> >>>
> >>> Side-note: How are we supposed to find the PR for a given commit?
> >>> Searching doesn't seem to work well. For instance, I picked a random
> >>> non-trivial commit out of the current open PRs:
> >>> MdeModulePkg/Bus/Spi/SpiBus: Adding SpiBus Drivers.
> >>>
> >> https://github.com/tianocore/edk2/pulls?q=is%3Apr+is%3Aopen+MdeModulePkg
> >>> %2FBus%2FSpi%2FSpiBus%3A+Adding+SpiBus+Drivers
> >>> has no matches?
> >>
> >> If you have the sha of the commit, you can search in GitHub
> >>
> >> For example, I selected a commit at random from recent edk2 commit
> >> history:
> >>
> >>  https://github.com/tianocore/edk2/commit/032830e96841f2a752e364378c
> >> 3428ac5d2f59d1
> >>
> >> Goto the "Pull Requests" tab for the repo and in the "Filters" search
> >> box enter
> >>
> >>  is:pr is:merged 
> >>
> >> In this example:
> >>
> >>  is:pr is:merged 032830e96841f2a752e364378c3428ac5d2f59d1
> >>
> >> This returns a single hit on PR #5560
> >>
> >>  https://github.com/tianocore/edk2/pull/5560
> >>
> >> There is also a 'gh' command line utility that can be used to write
> >> small scripts to collect this information
> >
> > Here is the equivalent query and output using 'gh' CLI command:
> >
> >  gh pr list --repo tianocore/edk2 --state merged --search 
> > 032830e96841f2a752e364378c3428ac5d2f59d1
> >
> >  Showing 1 of 1 pull request in tianocore/edk2 that matches your search
> >
> >  ID TITLE BRANCHCREATED AT
> >  #5560  Loongcpu  niruiyu:loongcpu  about 17 days ago
>
> I didn't see this explicitly mentioned but the easiest way to get to the
> PR if you already have a commit hash/URL like
> https://github.com/tianocore/edk2/commit/032830e is to click the PR link
> next to the branch name at the bottom of the commit message.
>
> In that commit you'll see: "master (#5560)"
>
> Where "#5560" is the PR number and the link to the PR.

Thank you Mike(s), this is useful stuff (and should be written down)!

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Re