Re: [edk2-devel] [PATCH v2] UefiCpuPkg/MmSaveStateLib: Remove checking Smm Rev ID in AMD MmSaveStateLib

2023-10-31 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

+Laszlo, +Gerd, +Paolo
PR:  https://github.com/tianocore/edk2/pull/4982

-Original Message-
From: Lin, Jacque 
Sent: Tuesday, October 31, 2023 11:07 AM
To: devel@edk2.groups.io
Cc: Lin, Jacque ; Attar, AbdulLateef (Abdul Lateef) 
; Chang, Abner 
Subject: [PATCH v2] UefiCpuPkg/MmSaveStateLib: Remove checking Smm Rev ID in 
AMD MmSaveStateLib

Remove checking SMM Rev ID in AMD Save State lib when reading Save State 
Register EFI_MM_SAVE_STATE_REGISTER_IO.
For AMD, it is not necessary to check SmmRevId when reading Save State Register 
EFI_MM_SAVE_STATE_REGISTER_IO.

Cc: Abdul Lateef Attar 
Cc: Abner Chang 
Signed-off-by: Jacque Lin 
---
 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c 
b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
index 3315a6cc44..c4bf6ad4bb 100644
--- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
+++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
@@ -102,7 +102,6 @@ MmSaveStateReadRegister (
   OUT VOID*Buffer   ) {-  UINT32 
SmmRevId;   EFI_MM_SAVE_STATE_IO_INFO  *IoInfo;   AMD_SMRAM_SAVE_STATE_MAP   
*CpuSaveState;   UINT8  DataWidth;@@ -124,18 +123,6 @@ 
MmSaveStateReadRegister (
// Check for special EFI_MM_SAVE_STATE_REGISTER_IO   if (Register == 
EFI_MM_SAVE_STATE_REGISTER_IO) {-//-// Get SMM Revision ID-//-
MmSaveStateReadRegisterByIndex (CpuIndex, 
AMD_MM_SAVE_STATE_REGISTER_SMMREVID_INDEX, sizeof (SmmRevId), );--
//-// See if the CPU supports the IOMisc register in the save state-//- 
   if (SmmRevId < AMD_SMM_MIN_REV_ID_X64) {-  return EFI_NOT_FOUND;-}-  
   // Check if IO Restart Dword [IO Trap] is valid or not using bit 1. if 
(!(CpuSaveState->x64.IO_DWord & 0x02u)) {   return EFI_NOT_FOUND;--
2.36.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110429): https://edk2.groups.io/g/devel/message/110429
Mute This Topic: https://groups.io/mt/102292190/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/MmSaveStateLib: Remove checking Smm Rev ID in AMD MmSaveStateLib

2023-10-31 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Laszlo and @Lin, Jacque
Please find my response inline.
Thanks
AbduL
-Original Message-
From: Laszlo Ersek 
Sent: Monday, October 30, 2023 7:34 PM
To: devel@edk2.groups.io; Lin, Jacque 
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Gerd Hoffmann ; Paolo Bonzini 

Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MmSaveStateLib: Remove checking 
Smm Rev ID in AMD MmSaveStateLib

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


+Gerd, +Paolo

On 10/30/23 07:12, Jacque Lin via groups.io wrote:
> Remove checking SMM Rev ID in AMD Save State lib when reading Save
> State Register EFI_MM_SAVE_STATE_REGISTER_IO.
> For AMD, it is not necessary to check SmmRevId when reading Save State
> Register EFI_MM_SAVE_STATE_REGISTER_IO.
>
> Cc: Abdul Lateef Attar 
> Cc: Abner Chang 
> Signed-off-by: Jacque Lin 
> ---
>  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c | 13 -
>  1 file changed, 13 deletions(-)
>
> diff --git a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> index 3315a6cc44..c4bf6ad4bb 100644
> --- a/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> +++ b/UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
> @@ -102,7 +102,6 @@ MmSaveStateReadRegister (
>OUT VOID*Buffer
>
>)
>
>  {
>
> -  UINT32 SmmRevId;
>
>EFI_MM_SAVE_STATE_IO_INFO  *IoInfo;
>
>AMD_SMRAM_SAVE_STATE_MAP   *CpuSaveState;
>
>UINT8  DataWidth;
>
> @@ -124,18 +123,6 @@ MmSaveStateReadRegister (
>
>
>// Check for special EFI_MM_SAVE_STATE_REGISTER_IO
>
>if (Register == EFI_MM_SAVE_STATE_REGISTER_IO) {
>
> -//
>
> -// Get SMM Revision ID
>
> -//
>
> -MmSaveStateReadRegisterByIndex (CpuIndex, 
> AMD_MM_SAVE_STATE_REGISTER_SMMREVID_INDEX, sizeof (SmmRevId), );
>
> -
>
> -//
>
> -// See if the CPU supports the IOMisc register in the save state
>
> -//
>
> -if (SmmRevId < AMD_SMM_MIN_REV_ID_X64) {
>
> -  return EFI_NOT_FOUND;
>
> -}
>
> -
>
>  // Check if IO Restart Dword [IO Trap] is valid or not using bit 1.
>
>  if (!(CpuSaveState->x64.IO_DWord & 0x02u)) {
>
>return EFI_NOT_FOUND;
>

I still don't understand.

Are you saying that the

  SmmRevId < AMD_SMM_MIN_REV_ID_X64

check will always evaluate to FALSE, and so the "return EFI_NOT_FOUND"
branch is dead code?
[Attar, AbdulLateef (Abdul Lateef)] that's right it always evaluate to FALSE
If that's the case, then the patch seems right, but *why* is SmmRevId always 
greater than or equal to AMD_SMM_MIN_REV_ID_X64?
[Attar, AbdulLateef (Abdul Lateef)] as per AMD64 Programmer's manual 10.2.4 
SMM-Revision Identifier.
First 16bit contains the version, which 0x64 for 64bit architecture.
Bit 16 and bit 17 always set 1.
Hence SmmRevId is always equal to AMD_SMM_MIN_REV_ID_X64.

SmmRevId is used to tell apart x86 from x64 (i.e., to distinguish the two 
formats of the save state map). Is the intent of this patch to remove 32-bit 
(x86) support?
[Attar, AbdulLateef (Abdul Lateef)]  Nope, we are not removing the x86(32bit) 
support.
@Lin, Jacque can you modify the logic like below, so that we will honor 
x86(32bit).

if (MmSaveStateGetRegisterLma () == EFI_MM_SAVE_STATE_REGISTER_LMA_32BIT) {
//
// Get SMM Revision ID
//
MmSaveStateReadRegisterByIndex (CpuIndex, 
AMD_MM_SAVE_STATE_REGISTER_SMMREVID_INDEX, sizeof (SmmRevId), );
if (SmmRevId < AMD_SMM_MIN_REV_ID_X64) {
  return EFI_NOT_FOUND;
}
}
That makes me uncomfortable, because it could break SMM support in
*IA32* OVMF. Note that commit f2188fe5d155 ("OvmfPkg: Uses MmSaveStateLib 
library", 2023-07-03) also updated "OvmfPkg/OvmfPkgIa32.dsc".

In fact, I'm worried that the conversion of OVMF to MmSaveStateLib may have 
been incorrect. Note that commit f2188fe5d155 removed the following comment 
from "OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c":

> //
> // No support for I/O restart
> //

Furthermore, commit f2188fe5d155 removed the following functions:
GetRegisterIndex(), ReadSaveStateRegisterByIndex(), 
SmmCpuFeaturesReadSaveStateRegister(),
SmmCpuFeaturesWriteSaveStateRegister().

In particular, the latter two functions contained comments and code
like:

>   //
>   // Check for special EFI_SMM_SAVE_STATE_REGISTER_IO
>   //
>   if (Register == EFI_SMM_SAVE_STATE_REGISTER_IO) {
> return EFI_NOT_FOUND;
>   }

and

>   //
>   // Writes to EFI_SMM_SAVE_STATE_REGISTER_IO are not supported
>   //
>   if (Register == EFI_SMM_SAVE_STATE_REGISTER_IO) {
> return EFI_NOT_FOUND;
>   }

All of these came from Paolo's original commit 4036b4e57cce ("OvmfPkg:
SmmCpuFeaturesLib: implement SMRAM state save map access", 2015-11-30).

Consider the following commits from Paolo (including 4036b4e57cce):

> commit 86d71589c1fdb099c04a0f9e548fe868a2fef266
> Author: Paolo Bonzini 
> Date:   Mon Nov 

Re: [edk2-devel] [PATCH edk2-platforms v3 02/16] ManageabilityPkg: Check MCTP EIDs for reserved values

2023-10-25 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Attar, AbdulLateef (Abdul Lateef) ;

-Original Message-
From: Konstantin Aladyshev 
Sent: Monday, October 23, 2023 6:35 PM
To: devel@edk2.groups.io
Cc: Chang, Abner ; Attar, AbdulLateef (Abdul Lateef) 
; nick...@nvidia.com; Konstantin Aladyshev 

Subject: [PATCH edk2-platforms v3 02/16] ManageabilityPkg: Check MCTP EIDs for 
reserved values

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


MTCP base specification marks EIDs 1-7 as reserved. Therefore return 
EFI_INVALID_PARAMETER if such EIDs were provided to the MctpSubmitMessage 
function.

Signed-off-by: Konstantin Aladyshev 
Signed-off-by: Abner Chang 
---
 .../Universal/MctpProtocol/Dxe/MctpProtocol.c   | 17 +
 1 file changed, 17 insertions(+)

diff --git 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c
index 88bfd9b7e7..d0f49a1abb 100644
--- a/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.c
+++ b/Features/ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocol.
+++ c
@@ -78,6 +78,23 @@ MctpSubmitMessage (
 return EFI_INVALID_PARAMETER;

   }



+  //

+  // Check source EID and destination EID

+  //

+  if ((MctpSourceEndpointId >= MCTP_RESERVED_ENDPOINT_START_ID) &&

+  (MctpSourceEndpointId <= MCTP_RESERVED_ENDPOINT_END_ID)

+  ) {

+DEBUG ((DEBUG_ERROR, "%a: The value of MCTP source EID (%x) is
+ reserved.\n", __func__, MctpSourceEndpointId));

+return EFI_INVALID_PARAMETER;

+  }

+

+  if ((MctpDestinationEndpointId >= MCTP_RESERVED_ENDPOINT_START_ID) &&

+  (MctpDestinationEndpointId <= MCTP_RESERVED_ENDPOINT_END_ID)

+  ) {

+DEBUG ((DEBUG_ERROR, "%a: The value of MCTP destination EID (%x) is
+ reserved.\n", __func__, MctpDestinationEndpointId));

+return EFI_INVALID_PARAMETER;

+  }

+

   Status = CommonMctpSubmitMessage (

  mTransportToken,

  MctpType,

--
2.34.1



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




Re: [edk2-devel] [PATCH edk2-platforms v3 01/16] ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure

2023-10-25 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Attar, AbdulLateef (Abdul Lateef) 

-Original Message-
From: Konstantin Aladyshev 
Sent: Monday, October 23, 2023 6:35 PM
To: devel@edk2.groups.io
Cc: Chang, Abner ; Attar, AbdulLateef (Abdul Lateef) 
; nick...@nvidia.com; Konstantin Aladyshev 

Subject: [PATCH edk2-platforms v3 01/16] ManageabilityPkg: Add definition for 
the MCTP KCS TRAILER structure

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


Currently there is only a definition for the MCTP KCS HEADER structure.
Add definition for the MCTP KCS TRAILER structure as well.

Signed-off-by: Konstantin Aladyshev 
Signed-off-by: Abner Chang 
---
 .../Library/ManageabilityTransportMctpLib.h|  5 +
 .../MctpProtocol/Common/MctpProtocolCommon.c   | 14 +++---
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h
index 43bd142f4c..462e7436e6 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h
@@ -39,6 +39,11 @@ typedef struct {
   UINT8DefiningBody; ///< Message type.

   UINT8ByteCount;///< Byte count of payload.

 } MANAGEABILITY_MCTP_KCS_HEADER;

+

+typedef struct {

+  UINT8Pec;  ///< MCTP over KCS Packet Error Code.

+} MANAGEABILITY_MCTP_KCS_TRAILER;

+

 #define MCTP_KCS_NETFN_LUN   0xb0

 #define DEFINING_BODY_DMTF_PRE_OS_WORKING_GROUP  0x01



diff --git 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
index 1ad48efdc7..7576007f77 100644
--- 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
@@ -132,7 +132,7 @@ SetupMctpRequestTransportPacket (
   MANAGEABILITY_MCTP_KCS_HEADER  *MctpKcsHeader;

   MCTP_TRANSPORT_HEADER  *MctpTransportHeader;

   MCTP_MESSAGE_HEADER*MctpMessageHeader;

-  UINT8  *Pec;

+  MANAGEABILITY_MCTP_KCS_TRAILER *MctpKcsTrailer;

   UINT8  *ThisPackage;



   if ((PacketHeader == NULL) || (PacketHeaderSize == NULL) ||

@@ -151,8 +151,8 @@ SetupMctpRequestTransportPacket (
   return EFI_OUT_OF_RESOURCES;

 }



-Pec = (UINT8 *)AllocateZeroPool (sizeof (UINT8));

-if (Pec == NULL) {

+MctpKcsTrailer = (MANAGEABILITY_MCTP_KCS_TRAILER *)AllocateZeroPool 
(sizeof (MANAGEABILITY_MCTP_KCS_TRAILER));

+if (MctpKcsTrailer == NULL) {

   DEBUG ((DEBUG_ERROR, "%a: Not enough resource for PEC.\n", __func__));

   FreePool (MctpKcsHeader);

   return EFI_OUT_OF_RESOURCES;

@@ -167,7 +167,7 @@ SetupMctpRequestTransportPacket (
 if (ThisPackage == NULL) {

   DEBUG ((DEBUG_ERROR, "%a: Not enough resource for package.\n", 
__func__));

   FreePool (MctpKcsHeader);

-  FreePool (Pec);

+  FreePool (MctpKcsTrailer);

   return EFI_OUT_OF_RESOURCES;

 }



@@ -193,14 +193,14 @@ SetupMctpRequestTransportPacket (


 //

 // Generate PEC follow SMBUS 2.0 specification.

-*Pec = HelperManageabilityGenerateCrc8 (MCTP_KCS_PACKET_ERROR_CODE_POLY, 
0, ThisPackage, MctpKcsHeader->ByteCount);

+MctpKcsTrailer->Pec = HelperManageabilityGenerateCrc8 
(MCTP_KCS_PACKET_ERROR_CODE_POLY, 0, ThisPackage, MctpKcsHeader->ByteCount);



 *PacketBody= (UINT8 *)ThisPackage;

 *PacketBodySize= MctpKcsHeader->ByteCount;

-*PacketTrailer = (MANAGEABILITY_TRANSPORT_TRAILER)Pec;

+*PacketTrailer = (MANAGEABILITY_TRANSPORT_TRAILER)MctpKcsTrailer;

 *PacketHeader  = (MANAGEABILITY_TRANSPORT_HEADER)MctpKcsHeader;

 *PacketHeaderSize  = sizeof (MANAGEABILITY_MCTP_KCS_HEADER);

-*PacketTrailerSize = 1;

+*PacketTrailerSize = sizeof (MANAGEABILITY_MCTP_KCS_TRAILER);

 return EFI_SUCCESS;

   } else {

 DEBUG ((DEBUG_ERROR, "%a: No implementation of building up packet.", 
__func__));

--
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110056): https://edk2.groups.io/g/devel/message/110056
Mute This Topic: https://groups.io/mt/102134647/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] Maintainers.txt: Update maintainers list

2023-10-19 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Acked-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Thursday, October 19, 2023 11:13 AM
To: devel@edk2.groups.io
Cc: Andrew Fish ; Leif Lindholm ; 
Michael D Kinney ; Attar, AbdulLateef (Abdul 
Lateef) ; Nickle Wang ; Jian J 
Wang ; Liming Gao ; Zhiguang 
Liu ; Eric Dong ; Ray Ni 
; Rahul Kumar ; Gerd Hoffmann 

Subject: [PATCH 1/1] Maintainers.txt: Update maintainers list

From: Abner Chang 

- Add two entries of MdePkg and MdeModulePkg for
  manageability modules and files.
- Add one entry of UefiCpuPkg AMD related files.

Signed-off-by: Abner Chang 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
---
 Maintainers.txt | 21 +
 1 file changed, 21 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index 1a7525b1b4c..4bec19832f4 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -443,6 +443,13 @@ F: MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h
 M: Richard Ho  [richardho]
 R: Rebecca Cran  [bcran]

+MdeModulePkg: Manageability modules
+F: MdeModulePkg/Include/*Ipmi*.*
+F: MdeModulePkg/Library/*Ipmi*.*
+M: Abner Chang  [changab]
+R: Abdul Lateef Attar  [abdattar]
+R: Nickle Wang  [nicklela]
+
 MdePkg
 F: MdePkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
@@ -468,6 +475,14 @@ R: Gua Guo  [gguo11837463]
 R: Chasel Chiu  [ChaselChiu]
 R: James Lu  [jameslu8]

+MdePkg: Manageability industryStandard standard C header files
+F: MdePkg/Include/IndustryStandard/*Ipmi*.h
+F: MdePkg/Include/IndustryStandard/*Mctp*.h
+F: MdePkg/Include/IndustryStandard/*Pldm*.h
+M: Abner Chang  [changab]
+R: Abdul Lateef Attar  [abdattar]
+R: Nickle Wang  [nicklela]
+
 NetworkPkg
 F: NetworkPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg
@@ -657,6 +672,12 @@ F: UefiCpuPkg/ResetVector/
 R: Debkumar De  [dde01]
 R: Catharine West  [catharine-intl]

+UefiCpuPkg: AMD related files
+F: UefiCpuPkg/Library/MmSaveStateLib/*Amd*.*
+F: UefiCpuPkg/Library/SmmCpuFeaturesLib/*Amd*.*
+M: Abdul Lateef Attar  [abdattar]
+R: Abner Chang  [changab]
+
 UefiPayloadPkg
 F: UefiPayloadPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
--
2.37.1.windows.1



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




Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System Interface Capabilities Command

2023-10-10 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Looks good.
Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Tuesday, October 10, 2023 8:47 PM
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Nickle Wang 

Subject: [edk2-platforms][PATCH] ManageabilityPkg/Ipmi: IPMI Get System 
Interface Capabilities Command

From: Abner Chang 

Implment AppFn, 0x57 command.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 .../IpmiCommandLib/IpmiCommandLibNetFnApp.c   | 68 +++
 1 file changed, 68 insertions(+)

diff --git 
a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c 
b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
index e580ec2ece..f145e291a9 100644
--- a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
+++ b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
@@ -442,3 +442,71 @@ IpmiGetChannelInfo (
   );
   return Status;
 }
+
+/**
+  This function gets system interface capability
+
+  @param[in]  InterfaceCapabilityRequestGet system interface capability 
request.
+  @param[out] InterfaceCapabilityResponse   The response of system interface 
capability.
+That is caller's responsibility to 
allocate
+memory for the response data.
+
+  @retval EFI_SUCCESSCommand is sent successfully.
+  @retval Other  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemInterfaceCapability (
+  IN  IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST   
*InterfaceCapabilityRequest,
+  OUT IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_RESPONSE  
*InterfaceCapabilityResponse
+  )
+{
+  UINT8   InterfaceType;
+  UINT32  ResponseSize;
+  UINT32  ActualResponseSize;
+  UINT8   *ResponsePtr;
+  EFI_STATUS  Status;
+
+  if (InterfaceCapabilityRequest == NULL) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  InterfaceType = InterfaceCapabilityRequest->Bits.InterfaceType;
+  if ((InterfaceType != 
IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF) &&
+  (InterfaceType != 
IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_KCS) &&
+  (InterfaceType != 
IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SMIC))
+  {
+DEBUG ((DEBUG_ERROR, "%a: Unsupported given system interface type = 
0x%x.\n", __func__, InterfaceType));
+return EFI_INVALID_PARAMETER;
+  }
+
+  if (InterfaceType == 
IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF) {
+ResponseSize = sizeof 
(IPMI_GET_SYSTEM_INTERFACE_SSIF_CAPABILITIES_RESPONSE);
+ResponsePtr  = (UINT8 
*)InterfaceCapabilityResponse->InterfaceSsifCapability;
+  } else {
+ResponseSize = sizeof 
(IPMI_GET_SYSTEM_INTERFACE_KCS_SMIC_CAPABILITIES_RESPONSE);
+ResponsePtr  = (UINT8 
*)InterfaceCapabilityResponse->InterfaceKcsSmicCapability;
+  }
+
+  ActualResponseSize = ResponseSize;
+  Status = IpmiSubmitCommand (
+ IPMI_NETFN_APP,
+ IPMI_APP_GET_SYSTEM_INTERFACE_CAPABILITIES,
+ (UINT8 *)InterfaceCapabilityRequest,
+ sizeof 
(IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST),
+ ResponsePtr,
+ 
+ );
+  if (ActualResponseSize != ResponseSize) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: The expected response size 0x%x is not equal to the returned size 
0x%x.\n",
+  __func__,
+  ResponseSize,
+  ActualResponseSize
+  ));
+  }
+
+  return Status;
+}
--
2.37.1.windows.1



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




Re: [edk2-devel] [[edk2-non-osi][Silicon/AMD][PATCH v2] 1/2] Maintainers.txt: Add maintainer for Silicon/AMD and Silicon/AMD/Vangogh

2023-09-29 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Reviewed-by:  Abdul Lateef Attar 

-Original Message-
From: Xing, Eric 
Sent: Thursday, September 28, 2023 10:37 PM
To: devel@edk2.groups.io
Cc: Michael D Kinney ; Chang, Abner 
; Leif Lindholm ; Attar, 
AbdulLateef (Abdul Lateef) 
Subject: [[edk2-non-osi][Silicon/AMD][PATCH v2] 1/2] Maintainers.txt: Add 
maintainer for Silicon/AMD and Silicon/AMD/Vangogh

From: Eric Xing 

Cc: Michael D Kinney 
Cc: Abner Chang 
Cc: Leif Lindholm 
Cc: Abdul Lateef Attar 
Signed-off-by: Eric Xing 
---
 Maintainers.txt | 9 +
 1 file changed, 9 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index c42d135..1d5dacb 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -58,6 +58,15 @@ Platform/Intel/CometlakeSiliconBinPkg
 M: Kathappan Esakkithevar 
 M: Sai Chaganty 

+Silicon/AMD
+M: Abner Chang 
+M: Abdul Lateef Attar 
+M: Eric Xing 
+
+Silicon/AMD/Vangogh
+M: Duke Zhai 
+M: Eric Xing 
+
 Silicon/Ampere/AmpereAltraBinPkg
 M: Nhi Pham 
 M: Vu Nguyen 
--
2.17.1



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




Re: [edk2-devel] [PATCH v4 2/4] DynamicTablesPkg: Add support for simple method invocation.

2023-09-23 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Jeff, Sami,
I'm not reviewer, just providing the opinion.
How about making it generic(generic to integer argument)  instead of single 
integer argument.
INUINT64  IntegerArgument
IN UINT64   *IntegerArgumentArray.
Create the list(by making use of AmlVarListAddTail) of data object depends on 
IntergerArgument value.

Also, I think if data in data node is AML_ARG0(0x68), AML_ARG1, then it 
will considered as Arg0, Arg1, etc.

Thanks
AbduL


From: devel@edk2.groups.io  On Behalf Of Jeff Brasen via 
groups.io
Sent: Friday, September 22, 2023 2:19 AM
To: Sami Mujawar ; devel@edk2.groups.io
Cc: Pierre Gondois ; Swatisri Kantamsetti 
; Ashish Singhal ; nd 

Subject: Re: [edk2-devel] [PATCH v4 2/4] DynamicTablesPkg: Add support for 
simple method invocation.

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

I see you swapped the order of the functions, that looks good and avoids 
special handling for that case. That looks good to me.

Thanks,

Jeff
From: Sami Mujawar mailto:sami.muja...@arm.com>>
Sent: Thursday, September 21, 2023 2:07 PM
To: Jeff Brasen mailto:jbra...@nvidia.com>>; 
devel@edk2.groups.io
Cc: Pierre Gondois mailto:pierre.gond...@arm.com>>; 
Swatisri Kantamsetti mailto:swatis...@nvidia.com>>; 
Ashish Singhal mailto:ashishsin...@nvidia.com>>; nd 
mailto:n...@arm.com>>
Subject: Re: [PATCH v4 2/4] DynamicTablesPkg: Add support for simple method 
invocation.

External email: Use caution opening links or attachments

Hi Jeff,

Yes, I recorded the integer node and data node creation.

Regards,

Sami Mujawar



From: Jeff Brasen mailto:jbra...@nvidia.com>>
Sent: 21 September 2023 18:38
To: Sami Mujawar mailto:sami.muja...@arm.com>>; 
devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: Pierre Gondois mailto:pierre.gond...@arm.com>>; 
Swatisri Kantamsetti mailto:swatis...@nvidia.com>>; 
Ashish Singhal mailto:ashishsin...@nvidia.com>>; nd 
mailto:n...@arm.com>>
Subject: RE: [PATCH v4 2/4] DynamicTablesPkg: Add support for simple method 
invocation.


Only thing I see is if AmlCodeGenInteger fails we don't delete DataNode right?



From: Sami Mujawar mailto:sami.muja...@arm.com>>
Sent: Thursday, September 21, 2023 10:49 AM
To: Jeff Brasen mailto:jbra...@nvidia.com>>; 
devel@edk2.groups.io
Cc: pierre.gond...@arm.com; Swatisri Kantamsetti 
mailto:swatis...@nvidia.com>>; Ashish Singhal 
mailto:ashishsin...@nvidia.com>>; 
n...@arm.com
Subject: Re: [PATCH v4 2/4] DynamicTablesPkg: Add support for simple method 
invocation.



External email: Use caution opening links or attachments



Hi Jeff,

Thank you for this patch.

Please see my response inline marked [SAMI].

Regards,

Sami Mujawar

On 18/09/2023 04:46 pm, Jeff Brasen wrote:

Add support to add Return objects via AML that pass a single integer



argument to the named method.







Signed-off-by: Jeff Brasen 



---



 .../Include/Library/AmlLib/AmlLib.h   |  54 



 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 244 ++



 2 files changed, 298 insertions(+)







diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h



index d201ae9499..b82c7a3ce8 100644



--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h



+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h



@@ -1194,6 +1194,60 @@ AmlCodeGenMethodRetInteger (



   OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNodeOPTIONAL



   );







+/** AML code generation for a method returning a NameString that takes an



+integer argument.



+



+  AmlCodeGenMethodRetNameStringIntegerArgument (



+"MET0", "MET1", 1, TRUE, 3, 5, ParentNode, NewObjectNode



+);



+  is equivalent of the following ASL code:



+Method(MET0, 1, Serialized, 3) {



+  Return (MET1 (5))



+}



+



+  The ASL parameters "ReturnType" and "ParameterTypes" are not asked



+  in this function. They are optional parameters in ASL.



+



+  @param [in]  MethodNameString The new Method's name.



+Must be a NULL-terminated ASL NameString



+e.g.: "MET0", "_SB.MET0", etc.



+The input string is copied.



+  @param [in]  ReturnedNameString   The name of the object returned by the



+method. Optional parameter, can be:



+ - NULL (ignored).



+ - A NULL-terminated ASL NameString.



+   e.g.: "MET0", "_SB.MET0", etc.



+  

Re: [edk2-devel] [PATCH 1/1] OutOfBandManagement/SpcrFeaturePkg: PCD based IRQ/GSI

2023-08-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Gentle reminder, review please.

-Original Message-
From: Chang, Abner 
Sent: Thursday, August 3, 2023 12:12 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Sai Chaganty 
; Isaac Oram ; Nate 
DeSimone ; Liming Gao 
Subject: RE: [PATCH 1/1] OutOfBandManagement/SpcrFeaturePkg: PCD based IRQ/GSI

[AMD Official Use Only - General]

Acked-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Thursday, August 3, 2023 2:35 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Sai
> Chaganty ; Isaac Oram
> ; Nate DeSimone
> ; Liming Gao
> ; Chang, Abner 
> Subject: [PATCH 1/1] OutOfBandManagement/SpcrFeaturePkg: PCD based
> IRQ/GSI
>
> From: Abdul Lateef Attar 
>
> Create a new PCD to hold the IRQ or GSI number for SPCR, with default
> values of 4.
> Update the ACPI SPCR table's IRQ value based on PCD.
>
> Cc: Sai Chaganty 
> Cc: Isaac Oram 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Cc: Abner Chang 
> Signed-off-by: Abdul Lateef Attar 
>
> Change-Id: I7218903fa5572f8139ad45db598ab085f079713b
> ---
>  .../OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec  | 5 +
>  .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf | 4 
>  .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.h  | 3 +++
>  .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c  | 7 ---
>  4 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d
> ec
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d
> ec
> index b084fad89220..d69d650f3f20 100644
> ---
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d
> ec
> +++
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d
> ec
> @@ -7,6 +7,7 @@
>  # for the build infrastructure.
>  #
>  # Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -24,6 +25,10 @@
> [Includes]  [Guids]
>gSpcrFeaturePkgTokenSpaceGuid = { 0xe978c988, 0xeeba, 0x4671, {
> 0xb8, 0x0d, 0xcc, 0x8b, 0x89, 0xb5, 0xd1, 0xef }}
>
> +[PcdsFixedAtBuild]
> +  # SPCR default IRQ set to 4
> +  gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrInterrupt|4|UINT8|0x0010
> +
>  [PcdsFeatureFlag]
>
> gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable|FALSE|BOOLEAN|0x
> 0001
>
> diff --git
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> AcpiDxe.inf
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> AcpiDxe.inf
> index 9a4f95e86bbf..cd43afea5242 100644
> ---
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> AcpiDxe.inf
> +++
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> AcpiDxe.inf
> @@ -24,6 +24,7 @@ [LibraryClasses]
>UefiDriverEntryPoint
>UefiLib
>SpcrDeviceLib
> +  PcdLib
>
>  [Packages]
>MdePkg/MdePkg.dec
> @@ -51,5 +52,8 @@ [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
>
> +[FixedPcd]
> +  gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrInterrupt
> +
>  [Depex]
>TRUE
> diff --git
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.h
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.h
> index c11da439fcb8..245a847762c5 100644
> ---
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.h
> +++
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.h
> @@ -3,6 +3,8 @@
>SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
>
>Copyright (c) 2004 - 2020, Intel Corporation. All rights
> reserved.
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
> +
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  **/
> @@ -23,6 +25,7 @@
>  #include 
>  #include   #include
> 
> +#include 
>
>  #include 
>  #include 
> diff --git
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.c
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.c
> index 51449d0fad9e..e92db96caaa9 100644
> ---
> a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.c
> +++
> b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
> Acpi.c
> @@ -3,7 +3,7 @@
>SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
>
>Copyright (c) 2004 - 2020, Intel Corporation. All rights
> reserved.
> -  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> reserved.
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  **/
> @@ -83,8 +83,8 @@
> EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE gSpcrInfo = {
>},
>
>0x03,   //INTERRUPT_TYPE,
> 

Re: [edk2-devel] Use gMmst from MmServiceTableLib in MmSaveStateLib

2023-07-11 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Thanks Dun for clarifying, I'll submit the patch.

Regards,
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of duntan via 
groups.io
Sent: Tuesday, July 11, 2023 3:21 PM
To: Attar, AbdulLateef (Abdul Lateef) ; Ni, Ray 
; devel@edk2.groups.io; Chang, Abner 
Subject: Re: [edk2-devel] Use gMmst from MmServiceTableLib in MmSaveStateLib

[AMD Official Use Only - General]

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


AbduL,

For the part ' preserve the SAVE_STATE pointed by gSmst(Instead of gMmst)', do 
you mean the following code in RestoreSmmConfigurationInS3()?
gSmst->CpuSaveState  = gSmmCpuPrivate->SmmCoreEntryContext.CpuSaveState;

Acctually when PiSmmCpuDxeSmm uses MmServicesTableLib, the gSmst is the same as 
gMmst. You can check the lib constructor MmServicesTableLibConstructor() and 
SmmServicesTableLibConstructor. In the two constructor functions, they both 
locate the same global pointer by gEfiSmmBase2ProtocolGuid/ 
gEfiMmBaseProtocolGuid(same GUID)  and assign the value to gSmst or gMmst. In 
this case the only difference of gMmst and gSmst is the naming. So I think  
PiSmmCpuDxeSmm can still consume the MmSaveStateLib even MmSaveStateLib use 
gMmst.

Thanks,
Dun
-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Tuesday, July 11, 2023 5:06 PM
To: Ni, Ray ; Tan, Dun ; 
devel@edk2.groups.io; Chang, Abner 
Subject: RE: Use gMmst from MmServiceTableLib in MmSaveStateLib

[AMD Official Use Only - General]

Hi Ray,
I think Michael raised the similar concerned during the patch review.
Its intentionally kept it as gSmst because of the below reason.

2. AmdMmSaveStateLib and IntelMmSaveStateLib depend on SmmServicesTableLib. Can 
they depend on MmServicesTableLib instead?
[Attar, AbdulLateef (Abdul Lateef)] MmSaveStateLib is mainly used by 
PiSmmCpuDxeSmm driver which still uses Smm convention and preserve the 
SAVE_STATE pointed by gSmst(Instead of gMmst).
Hence I don't think we can move to MmServicesTableLib.


Thanks
AbduL

-Original Message-
From: Ni, Ray 
Sent: Tuesday, July 11, 2023 1:40 PM
To: Tan, Dun ; devel@edk2.groups.io; Attar, AbdulLateef 
(Abdul Lateef) ; Chang, Abner 
Subject: RE: Use gMmst from MmServiceTableLib in MmSaveStateLib

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


Abdul,
Can you please send a patch to fix MmSaveStateLib to use gMmst (instead of 
gSmst)?

Using gSmst forbids the lib instance be linked by standalone MM modules.

Thanks,
Ray

> -Original Message-
> From: Tan, Dun 
> Sent: Wednesday, July 5, 2023 4:42 PM
> To: devel@edk2.groups.io; abdat...@amd.com
> Cc: Ni, Ray 
> Subject: Use gMmst from MmServiceTableLib in MmSaveStateLib
>
> Hi Abdul,
>
> In the new MmSaveStateLib created in this patch set, gSmst from
> SmmServiceTableLib is used. This causes that only DXE_SMM_DRIVER type
> module can consume this lib but MM_STANDALONE type module cannot.
>
> In current edk2, there are different MmServicesTableLib and
> SmmServicesTableLib:
> StadaloneMmServicesTableLib(MmServicesTableLib|MM_STANDALONE):
> initialize gMmst in standalone SMM env.
>   MmServicesTableLib(MmServicesTableLib|DXE_SMM_DRIVER):
> initialize gMmst in legacy SMM env.
> SmmServicesTableLib(SmmServicesTableLib|DXE_SMM_DRIVER): initialize
> gSmst in legacy SMM env.
>
> If MmSaveStateLib uses gMmst from MmServiceTableLib instead of gSmst,
> then MmSaveStateLib can be consumed by both DXE_SMM_DRIVER and
> MM_STANDALONE module.
> Could you pls send patch to fix this?
>
> Thanks,
> Dun
>
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abdul
> Lateef Attar via groups.io
> Sent: Sunday, July 2, 2023 12:14 PM
> To: devel@edk2.groups.io
> Cc: Abdul Lateef Attar ; Paul Grimes
> ; Abner Chang ; Dong, Eric
> ; Ni, Ray ; Kumar, Rahul R
> ; Gerd Hoffmann ; Kinney,
> Michael D ; Gao, Liming
> ; Liu, Zhiguang ;
> Ard Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L 
> Subject: [edk2-devel] [PATCH v15 0/8] Adds AmdSmmCpuFeaturesLib and
> MmSaveStateLib
>
> Backward-compatibility changes:
>   This patch series removes the SmmCpuFeaturesReadSaveStateRegister
>   and SmmCpuFeaturesWriteSaveStateRegister interface/function.
>   SmmReadSaveState() and SmmWriteSaveState() now directly invokes
> MmSaveStateLib
>   routines to save/restore registers.
>
> PR: https://github.com/tianocore/edk2/pull/4597
>
> V15: Delta changes
>   Rebase the branch and fix the merge conflicts.
> V14: Delta changes
>   Added @note to the MmSaveStateLib.h.
>   SaveState(Read/Write) of
> EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID/EFI_MM_SAVE_STATE_REGIS
> TER_PROCESSOR_ID
>   is handled by PiSmmCpuDxeSmm driver.
>   Fixed PatchCheck warnings.
> V13: Delta changes
>   Address review comments from Ray Ni
>   Changed the BASE _NAME 

Re: [edk2-devel] Use gMmst from MmServiceTableLib in MmSaveStateLib

2023-07-11 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
I think Michael raised the similar concerned during the patch review.
Its intentionally kept it as gSmst because of the below reason.

2. AmdMmSaveStateLib and IntelMmSaveStateLib depend on SmmServicesTableLib. Can 
they depend on MmServicesTableLib instead?
[Attar, AbdulLateef (Abdul Lateef)] MmSaveStateLib is mainly used by 
PiSmmCpuDxeSmm driver which still uses Smm convention and preserve the 
SAVE_STATE pointed by gSmst(Instead of gMmst).
Hence I don't think we can move to MmServicesTableLib.


Thanks
AbduL

-Original Message-
From: Ni, Ray 
Sent: Tuesday, July 11, 2023 1:40 PM
To: Tan, Dun ; devel@edk2.groups.io; Attar, AbdulLateef 
(Abdul Lateef) ; Chang, Abner 
Subject: RE: Use gMmst from MmServiceTableLib in MmSaveStateLib

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


Abdul,
Can you please send a patch to fix MmSaveStateLib to use gMmst (instead of 
gSmst)?

Using gSmst forbids the lib instance be linked by standalone MM modules.

Thanks,
Ray

> -Original Message-
> From: Tan, Dun 
> Sent: Wednesday, July 5, 2023 4:42 PM
> To: devel@edk2.groups.io; abdat...@amd.com
> Cc: Ni, Ray 
> Subject: Use gMmst from MmServiceTableLib in MmSaveStateLib
>
> Hi Abdul,
>
> In the new MmSaveStateLib created in this patch set, gSmst from
> SmmServiceTableLib is used. This causes that only DXE_SMM_DRIVER type
> module can consume this lib but MM_STANDALONE type module cannot.
>
> In current edk2, there are different MmServicesTableLib and
> SmmServicesTableLib:
> StadaloneMmServicesTableLib(MmServicesTableLib|MM_STANDALONE):
> initialize gMmst in standalone SMM env.
>   MmServicesTableLib(MmServicesTableLib|DXE_SMM_DRIVER):
> initialize gMmst in legacy SMM env.
> SmmServicesTableLib(SmmServicesTableLib|DXE_SMM_DRIVER): initialize
> gSmst in legacy SMM env.
>
> If MmSaveStateLib uses gMmst from MmServiceTableLib instead of gSmst,
> then MmSaveStateLib can be consumed by both DXE_SMM_DRIVER and
> MM_STANDALONE module.
> Could you pls send patch to fix this?
>
> Thanks,
> Dun
>
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abdul
> Lateef Attar via groups.io
> Sent: Sunday, July 2, 2023 12:14 PM
> To: devel@edk2.groups.io
> Cc: Abdul Lateef Attar ; Paul Grimes
> ; Abner Chang ; Dong, Eric
> ; Ni, Ray ; Kumar, Rahul R
> ; Gerd Hoffmann ; Kinney,
> Michael D ; Gao, Liming
> ; Liu, Zhiguang ;
> Ard Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L 
> Subject: [edk2-devel] [PATCH v15 0/8] Adds AmdSmmCpuFeaturesLib and
> MmSaveStateLib
>
> Backward-compatibility changes:
>   This patch series removes the SmmCpuFeaturesReadSaveStateRegister
>   and SmmCpuFeaturesWriteSaveStateRegister interface/function.
>   SmmReadSaveState() and SmmWriteSaveState() now directly invokes
> MmSaveStateLib
>   routines to save/restore registers.
>
> PR: https://github.com/tianocore/edk2/pull/4597
>
> V15: Delta changes
>   Rebase the branch and fix the merge conflicts.
> V14: Delta changes
>   Added @note to the MmSaveStateLib.h.
>   SaveState(Read/Write) of
> EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID/EFI_MM_SAVE_STATE_REGIS
> TER_PROCESSOR_ID
>   is handled by PiSmmCpuDxeSmm driver.
>   Fixed PatchCheck warnings.
> V13: Delta changes
>   Address review comments from Ray Ni
>   Changed the BASE _NAME of AmdSmmCpuFeaturesLib.
>   Removed EFIAPI from local function.
>   Removed CpuIndex parameter from MmSaveStateGetRegisterLma
>   Modifed MmSaveStateGetRegisterIndex () to accept RegOffset
> as second parameter.
>   Removed FILE_GUID library instance for intel implemention from
> UefiCpuPkg.dsc.
> V12:
>   Addressed review comments from Michael.
>   Added LibraryClasses to .inf file.
>   removed duplicate MACRO definations.
>   Moved related MACRO defination to respective file.
> V11: Delta changes
>   Drop the OVMF implementation of MmSaveStateLib
> V10: Delta changes:
>   Addressed review comments from Abner.
> V9: Delta changes:
>   Addressed review comments.
>   Rename to MmSaveStateLib.
>   Also rename SMM_ defines to MM_.
>   Implemented OVMF MmSaveStateLib.
>   Removes SmmCpuFeaturesReadSaveStateRegister and
> SmmCpuFeaturesWriteSaveStateRegister
>   function interface.
> V8 delta changes:
>Addressed review comments from Abner,
>Fix the whitespace error.
>Seperate the Ovmf changes to another patch
> V7 delta changes:
>Adds SmmSmramSaveStateLib for Intel processor.
>Integrate SmmSmramSaveStateLib library.
> V6 delta changes:
>Addressed review comments for Ray NI.
>removed unnecessary EFIAPI.
> V5 delta changes:
>rebase to master branch.
>updated Reviewed-by
> V4 delta changes:
>   rebase to master branch.
>   added reviewed-by.
> V3 delta changes:
>   Addressed review comments from Abner chang.
>   Re-arranged patch order.
>
> Cc: Paul Grimes 
> Cc: Abner Chang 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Rahul 

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] AmdPlatformPkg/SimulatorSerialPortLibPort80: Simulator serial port lib

2023-06-26 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by:  Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Wednesday, June 21, 2023 7:08 AM
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) 
Subject: [edk2-platforms][PATCH 2/2] 
AmdPlatformPkg/SimulatorSerialPortLibPort80: Simulator serial port lib

From: Abner Chang 

AMD simulator port 80 serial port library.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
---
 .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |  71 ++
 .../SimulatorSerialPortLibPort80.inf  |  31 +++
 .../SimulatorSerialPortLibPort80.c| 207 ++
 3 files changed, 309 insertions(+)
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Library/SimulatorSerialPortLibPort80/SimulatorSerialPortLibPort80.inf
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Library/SimulatorSerialPortLibPort80/SimulatorSerialPortLibPort80.c

diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc 
b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
index d3368c87ee..aa097bba09 100644
--- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
+++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
@@ -20,3 +20,74 @@

 [Packages]
   AmdPlatformPkg/AmdPlatformPkg.dec
+
+!include MdePkg/MdeLibs.dsc.inc
+
+[LibraryClasses.Common]
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+
+UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntr
+yPoint.inf
+
+UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBo
+otServicesTableLib.inf
+
+UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/
+UefiRuntimeServicesTableLib.inf
+  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+
+DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Base
+DebugPrintErrorLevelLib.inf
+
+  #
+  # Debug libraries
+  #
+
+DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Base
+DebugPrintErrorLevelLib.inf
+!if $(TARGET) == RELEASE
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+!else
+
+DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.i
+nf
+!endif
+
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+
+ SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroni
+ zationLib.inf  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+
+ BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.i
+ nf  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+
+ SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNu
+ ll.inf  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
+
+ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServ
+ icesLib.inf
+ DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
+
+ DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTabl
+ eLib.inf
+ UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEnt
+ ryPoint.inf
+ UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiB
+ ootServicesTableLib.inf
+ UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib
+ /UefiRuntimeServicesTableLib.inf
+ UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+
+  #
+  # CryptLib
+  #
+  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+  RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
+
+  #
+  # Secureboot library
+  #
+
+ SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/Secure
+ BootVariableLib.inf
+ SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableP
+ rovisionLib/SecureBootVariableProvisionLib.inf
+
+ PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVar
+ Policy/PlatformPKProtectionLibVarPolicy.inf
+
+  #
+  # Platform - Replace the modules in this section in platform DSC file.
+  #
+
+ TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTempl
+ ate.inf
+
+  # Simulator serial port 80
+
+ SerialPortLib|AmdPlatformPkg/Library/SimulatorSerialPortLibPort80/Simu
+ latorSerialPortLibPort80.inf
+
+[LibraryClasses.common.DXE_CORE, LibraryClasses.common.DXE_SMM_DRIVER,
+LibraryClasses.common.SMM_CORE, LibraryClasses.common.DXE_DRIVER,
+LibraryClasses.common.DXE_RUNTIME_DRIVER,
+LibraryClasses.common.UEFI_DRIVER,
+LibraryClasses.common.UEFI_APPLICATION]
+
+MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAl
+locationLib.inf
+
+ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepo
+rtStatusCodeLib.inf
+
+[Components]
+
+AmdPlatformPkg/Library/SimulatorSerialPortLibPort80/SimulatorSerialPort
+LibPort80.inf
+

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] Platform/AMD: Initial commit of AmdPlatformPkg

2023-06-26 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by:  Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Wednesday, June 21, 2023 10:36 AM
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) 
Subject: [edk2-platforms][PATCH 1/2] Platform/AMD: Initial commit of 
AmdPlatformPkg

From: Abner Chang 

Platform/AMD/AmdPlatformPkg provides the AMD edk2 common platform drivers and 
libraries for AMD server, client and Strategic Silicon Solutions (S3) platforms.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
---
 .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec | 18 +++
 .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc | 22 +++
 2 files changed, 40 insertions(+)
 create mode 100644 Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
 create mode 100644 Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc

diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec 
b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
new file mode 100644
index 00..1fe7f94dc7
--- /dev/null
+++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
@@ -0,0 +1,18 @@
+## @file
+# AMD Platform common Package DEC file
+# This is the package provides the AMD edk2 common platform drivers #
+and libraries for AMD Server, Clinet and Gaming console platforms.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  DEC_SPECIFICATION = 1.27
+  PACKAGE_NAME  = AmdPlatformPkg
+  PACKAGE_GUID  = 2CB1238B-18E2-4837-B714-9DAB2B30A3C2
+  PACKAGE_VERSION   = 1.0
+
+[Guids]
+  gAmdPlatformPkgTokenSpaceGuid   = { 0x663DE733, 0x70E0, 0x4D37, { 0xBB, 
0x30, 0x7D, 0x9E, 0xAF, 0x9B, 0xDA, 0xE9 }}
diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc 
b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
new file mode 100644
index 00..d3368c87ee
--- /dev/null
+++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
@@ -0,0 +1,22 @@
+## @file
+# AMD Platform common Package DSC file
+# This is the package provides the AMD edk2 common platform drivers #
+and libraries for AMD Server, Clinet and Gaming console platforms.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  PLATFORM_NAME  = AmdPlatformPkg
+  PLATFORM_GUID  = ACFD1C98-D451-45FE-B300-4049C5AD553B
+  PLATFORM_VERSION   = 1.0
+  DSC_SPECIFICATION  = 1.28
+  OUTPUT_DIRECTORY   = Build/AmdPlatformPkg
+  SUPPORTED_ARCHITECTURES= IA32|X64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
+[Packages]
+  AmdPlatformPkg/AmdPlatformPkg.dec
--
2.37.1.windows.1



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




Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg: Replace __FUNCTION__ with __func__

2023-05-30 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Tuesday, May 30, 2023 12:03 PM
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg: Replace __FUNCTION__ 
with __func__

From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../BaseManageabilityTransportHelper.c| 36 +--
 .../Common/KcsCommon.c| 12 +++
 .../Dxe/ManageabilityTransportKcs.c   | 28 +++
 .../Dxe/ManageabilityTransportMctp.c  | 22 ++--
 .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c |  4 +--
 .../IpmiProtocol/Common/IpmiProtocolCommon.c  | 14 
 .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 14 
 .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 18 +-
 .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 14 
 .../MctpProtocol/Common/MctpProtocolCommon.c  | 30 
 .../Universal/MctpProtocol/Dxe/MctpProtocol.c | 18 +-
 .../PldmProtocol/Common/PldmProtocolCommon.c  | 20 +--
 .../Universal/PldmProtocol/Dxe/PldmProtocol.c | 14 
 .../PldmSmbiosTransferDxe.c   | 22 ++--
 14 files changed, 133 insertions(+), 133 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
index ce68f89531..f72957ea7f 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
@@ -49,7 +49,7 @@ HelperManageabilitySpecName (
   }

   if ((SpecificationGuid == NULL) || IsZeroGuid (SpecificationGuid)) {
-DEBUG ((DEBUG_ERROR, "%a: Improper input GUIDs, could be NULL or zero 
GUID.\n", __FUNCTION__));
+DEBUG ((DEBUG_ERROR, "%a: Improper input GUIDs, could be NULL or zero 
GUID.\n", __func__));
 return NULL;
   }

@@ -106,7 +106,7 @@ HelperManageabilityCheckSupportedSpec (
   IsZeroGuid (ManageabilityProtocolToCheck)
   )
   {
-DEBUG ((DEBUG_ERROR, "%a: Improper input GUIDs, could be NULL or zero 
GUID.\n", __FUNCTION__));
+DEBUG ((DEBUG_ERROR, "%a: Improper input GUIDs, could be NULL or zero 
GUID.\n", __func__));
 return EFI_INVALID_PARAMETER;
   }

@@ -120,7 +120,7 @@ HelperManageabilityCheckSupportedSpec (
   DEBUG ((
 DEBUG_MANAGEABILITY_INFO,
 "%a: Transport interface %s supports %s manageability 
specification.\n",
-__FUNCTION__,
+__func__,
 HelperManageabilitySpecName (TransportGuid),
 HelperManageabilitySpecName (ManageabilityProtocolToCheck)
 ));
@@ -133,7 +133,7 @@ HelperManageabilityCheckSupportedSpec (
   DEBUG ((
 DEBUG_ERROR,
 "%a: Transport interface %s doesn't support %s manageability 
specification.\n",
-__FUNCTION__,
+__func__,
 HelperManageabilitySpecName (TransportGuid),
 HelperManageabilitySpecName (ManageabilityProtocolToCheck)
 ));
@@ -163,16 +163,16 @@ HelperAcquireManageabilityTransport (
   CHAR16  *ManageabilityProtocolName;
   CHAR16  *ManageabilityTransportName;

-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __FUNCTION__));
+  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
   if ((TransportToken == NULL) || (ManageabilityProtocolSpec == NULL)) {
-DEBUG ((DEBUG_ERROR, "%a: One of the required input parameters is 
NULL.\n", __FUNCTION__));
+DEBUG ((DEBUG_ERROR, "%a: One of the required input parameters is 
NULL.\n", __func__));
 return EFI_INVALID_PARAMETER;
   }

   *TransportToken   = NULL;
   ManageabilityProtocolName = HelperManageabilitySpecName 
(ManageabilityProtocolSpec);
   if (ManageabilityProtocolName == NULL) {
-DEBUG ((DEBUG_ERROR, "%a: Unsupported Manageability Protocol 
Specification.\n", __FUNCTION__));
+DEBUG ((DEBUG_ERROR, "%a: Unsupported Manageability Protocol 
Specification.\n", __func__));
 return EFI_UNSUPPORTED;
   }

@@ -180,7 +180,7 @@ HelperAcquireManageabilityTransport (

   Status = AcquireTransportSession (ManageabilityProtocolSpec, TransportToken);
   if (Status == EFI_UNSUPPORTED) {
-DEBUG ((DEBUG_ERROR, "%a: No supported transport interface for %s 
packet.\n", __FUNCTION__, ManageabilityProtocolName));
+DEBUG ((DEBUG_ERROR, "%a: No supported transport interface for %s 
packet.\n", __func__, ManageabilityProtocolName));
 return Status;
   }

@@ -188,7 +188,7 @@ HelperAcquireManageabilityTransport (
 DEBUG ((
   DEBUG_ERROR,
   "%a: Fail to acquire Manageability transport token for %s (%r).\n",
-  __FUNCTION__,
+  __func__,
   ManageabilityProtocolName,
   Status
 

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg: Use DEBUG_MANAGEABILITY

2023-05-30 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Tuesday, May 30, 2023 12:03 PM
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 2/2] ManageabilityPkg: Use DEBUG_MANAGEABILITY

From: Abner Chang 

Use debug print level DEBUG_MANAGEABILITY in ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Library/ManageabilityTransportHelperLib.h  |  2 +-
 .../BaseManageabilityTransportHelper.c |  2 +-
 .../Universal/IpmiBmcAcpi/BmcAcpi.c|  6 --
 .../Universal/IpmiBmcElog/BmcElog.c|  4 +++-
 .../ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c|  8 +---
 .../PldmSmbiosTransferDxe/PldmSmbiosTransferDxe.c  | 14 +++---
 6 files changed, 21 insertions(+), 15 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
index 11a1bd0521..dfe32189ad 100644
--- 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHe
+++ lperLib.h
@@ -11,7 +11,7 @@

 #include 

-#define DEBUG_MANAGEABILITY_INFO  DEBUG_INFO
+#define DEBUG_MANAGEABILITY_INFO  DEBUG_MANAGEABILITY

 typedef struct _MANAGEABILITY_PROTOCOL_NAME MANAGEABILITY_PROTOCOL_NAME;

diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
index f72957ea7f..27bc5eaddf 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelper
+++ Lib/BaseManageabilityTransportHelper.c
@@ -163,7 +163,7 @@ HelperAcquireManageabilityTransport (
   CHAR16  *ManageabilityProtocolName;
   CHAR16  *ManageabilityTransportName;

-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
+  DEBUG ((DEBUG_MANAGEABILITY_INFO, "%a: Entry\n", __func__));
   if ((TransportToken == NULL) || (ManageabilityProtocolSpec == NULL)) {
 DEBUG ((DEBUG_ERROR, "%a: One of the required input parameters is 
NULL.\n", __func__));
 return EFI_INVALID_PARAMETER;
diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c 
b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c
index cf066dd095..d04623ecad 100644
--- a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c
@@ -24,6 +24,8 @@
 #include 
 #include 

+#include 
+
 #ifndef EFI_ACPI_CREATOR_ID
 #define EFI_ACPI_CREATOR_ID  SIGNATURE_32 ('M', 'S', 'F', 'T')  #endif @@ 
-140,7 +142,7 @@ UpdateDeviceSsdtTable (
   //
   // Update IO(Decode16, 0xCA2, 0xCA2, 0, 2)
   //
-  DEBUG ((DEBUG_INFO, "UpdateDeviceSsdtTable - IPMI\n"));
+  DEBUG ((DEBUG_MANAGEABILITY_INFO, "UpdateDeviceSsdtTable - IPMI\n"));
   for (DataPtr = (UINT8 *)(Table + 1);
DataPtr < (UINT8 *)((UINT8 *)Table + Table->Length - 4);
DataPtr++)
@@ -158,7 +160,7 @@ UpdateDeviceSsdtTable (
   ASSERT (IoRsc->Header.Bits.Type == ACPI_SMALL_ITEM_FLAG);
   ASSERT (IoRsc->Header.Bits.Name == ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME);
   ASSERT (IoRsc->Header.Bits.Length == sizeof 
(EFI_ACPI_IO_PORT_DESCRIPTOR) - sizeof (ACPI_SMALL_RESOURCE_HEADER));
-  DEBUG ((DEBUG_INFO, "IPMI IO Base in ASL update - 0x%04x <= 0x%04x\n", 
IoRsc->BaseAddressMin, PcdGet16 (PcdIpmiKcsIoBaseAddress)));
+  DEBUG ((DEBUG_MANAGEABILITY_INFO, "IPMI IO Base in ASL update -
+ 0x%04x <= 0x%04x\n", IoRsc->BaseAddressMin, PcdGet16
+ (PcdIpmiKcsIoBaseAddress)));
   IoRsc->BaseAddressMin = PcdGet16 (PcdIpmiKcsIoBaseAddress);
   IoRsc->BaseAddressMax = PcdGet16 (PcdIpmiKcsIoBaseAddress);
 }
diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
index 02873fc4c6..8b34b2d2d5 100644
--- a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
@@ -15,6 +15,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include 

 #include 

+#include 
+
 EFI_STATUS
 EFIAPI
 CheckIfSelIsFull (
@@ -186,7 +188,7 @@ CheckIfSelIsFull (
   // Check the Bit7 of the OperationByte if SEL is OverFlow.
   //
   SelIsFull = (SelInfo.OperationSupport & 0x80);
-  DEBUG ((DEBUG_INFO, "SelIsFull - 0x%x\n", SelIsFull));
+  DEBUG ((DEBUG_MANAGEABILITY_INFO, "SelIsFull - 0x%x\n", SelIsFull));

   return EFI_SUCCESS;
 }
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
index 46f741eed1..40ae0c3ecc 100644
--- 

Re: [edk2-devel] failed Pr

2023-05-29 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Emulator PR failed, that might be the reason its not allowing to push
https://github.com/tianocore/edk2/pull/4442/checks?check_run_id=13834435150

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Ard Biesheuvel 
via groups.io
Sent: Monday, May 29, 2023 6:19 PM
To: Michael Kinney ; Michael Kubacki 
; Liming Gao (Byosoft address) 
; edk2-devel-groups-io 
Subject: [edk2-devel] failed Pr

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


Hello all,

Regarding

https://github.com/tianocore/edk2/pull/4442

could someone please explain to me:
- what went wrong,
- where to find the button to push to resubmit this PR to CI

Thanks,
Ard.







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




Re: [edk2-devel] [PATCH v2 1/2] AMD/AmdMinBoardPkg: Implements PCI hotplug init protocol

2023-05-29 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Abner,
Yes, its same patch series with V2 version.
Thanks
AbduL

-Original Message-
From: Chang, Abner 
Sent: Friday, May 26, 2023 7:07 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) 
Subject: RE: [PATCH v2 1/2] AMD/AmdMinBoardPkg: Implements PCI hotplug init 
protocol

[AMD Official Use Only - General]

Hi Abdul,
Is this a duplicate patch?
There was a patch you sent:  [edk2-devel] [PATCH 1/1] AMD/AmdMinBoardPkg: 
Implements PCI hotplug init protocol, they both create PciHotPlug.c and 
PciHotPlug.inf.

Thanks
Abner

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Monday, May 22, 2023 5:29 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ;
> Chang, Abner 
> Subject: [PATCH v2 1/2] AMD/AmdMinBoardPkg: Implements PCI hotplug
> init protocol
>
> From: Abdul Lateef Attar 
>
> Implements PCI hotplug init protocol.
> Adds resources padding based on PCD values.
>
> Cc: Abner Chang 
>
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |  16 +
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |  14 +-
>  .../PciHotPlug/PciHotPlugInit.inf |  39 +++
>  .../PciHotPlug/PciHotPlugInit.c   | 331 ++
>  4 files changed, 399 insertions(+), 1 deletion(-)  create mode 100755
> Platform/AMD/AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
>  create mode 100755
> Platform/AMD/AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.c
>
> diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> index e37b02c4cf5a..65ba08545021 100644
> --- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> +++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> @@ -17,3 +17,19 @@ [Defines]
>PACKAGE_GUID   = 44F9D761-9ECB-43DD-A5AC-177E5048701B
>PACKAGE_VERSION= 0.1
>
> +[Guids]
> +  gAmdMinBoardPkgTokenSpaceGuid  = {0xd4d23d79, 0x73bf, 0x460a,
> {0xa1, 0xc7, 0x85, 0xa3, 0xca, 0x71, 0xb9, 0x4c}}
> +
> +[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
> +  #
> +  # PCI HotPlug Resource Padding
> +  #
> +  # PCI bus padding, number of bus to reserve, default 2 bus
> +
> gAmdMinBoardPkgTokenSpaceGuid.PcdPciHotPlugResourcePadBus|2|UINT8
> |0x1003
> +  # IO Resource padding in bytes, default 4KB
> +
> gAmdMinBoardPkgTokenSpaceGuid.PcdPciHotPlugResourcePadIo|0x10
> 00|UINT32|0x1000
> +  # Non-PreFetch Memory padding in bytes, default 1MB
> +
> gAmdMinBoardPkgTokenSpaceGuid.PcdPciHotPlugResourcePadMem|0x0010
> |UINT32|0x1002
> +  # PreFetch Memory padding in bytes, default 2MB
> +
> gAmdMinBoardPkgTokenSpaceGuid.PcdPciHotPlugResourcePadPMem|0x002
> 0|UINT32|0x1001
> +
> diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> index 273cd74f7842..1a8407250c56 100644
> --- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> +++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> @@ -9,7 +9,7 @@
>
>  [Defines]
>DSC_SPECIFICATION   = 1.30
> -  PLATFORM_GUID   = 88F8A9AE-2FA0-4D58-A6F9-05F635C05F4E
> +  PLATFORM_GUID   = 939B559B-269B-4B8F-9637-44DF6575C1E2
>PLATFORM_NAME   = AmdMinBoardPkg
>PLATFORM_VERSION= 0.1
>OUTPUT_DIRECTORY= Build/$(PLATFORM_NAME)
> @@ -25,6 +25,16 @@ [Packages]
>  [LibraryClasses]
>
> SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
>
> +[LibraryClasses.common]
> +  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> +
> BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRe
> pStr.inf
> +  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> +
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemor
> yAllocationLib.inf
> +  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> +
> RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterL
> RegisterFilterLib|ibNull.inf
> +
> UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiB
> UefiBootServicesTableLib|oo
> tServicesTableLib.inf
> +
> UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEnt
> UefiDriverEntryPoint|ryP
> oint.inf
> +
>  [LibraryClasses.common.PEIM]
>
> SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLi
> b.inf
>
> @@ -34,3 +44,5 @@ [Components]
>  [Components.IA32]
>AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
>
> +[Components.X64]
> +  AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
> diff --git a/Platform/AMD/AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
> b/Platform/AMD/AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
> new file mode 100755
> index ..44564df38718
> --- /dev/null
> +++ b/Platform/AMD/AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
> @@ -0,0 +1,39 @@
> +## @file
> +# This driver implements EFI_PCI_HOT_PLUG_INIT_PROTOCOL.
> +# Adds 

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI FRB Driver

2023-05-15 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 13 May 2023 18:03
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI FRB Driver

From: Abner Chang 

IpmiFrb is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/Frb in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/Frb until the reference to this 
instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   5 +
 .../Universal/IpmiFrb/FrbDxe.inf  |  37 +++
 .../Universal/IpmiFrb/FrbPei.inf  |  37 +++
 .../Universal/IpmiFrb/FrbDxe.c| 212 ++
 .../Universal/IpmiFrb/FrbPei.c|  87 +++
 5 files changed, 378 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.c

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..b0ca01094a 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -80,3 +80,8 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006

+[PcdsDynamic, PcdsDynamicEx]
+
+gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0x2
+001
+  ## This is the timeout value in milliseconds, default set to 360
+milliseconds
+  # @Prompt IPMI Fault Resilient Booting timeout value in milliseconds.
+
+gManageabilityPkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0x200
+2
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
new file mode 100644
index 00..ae57fe7697
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI FRB.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= FrbDxe
+  FILE_GUID= A142CEE5-99D5-4ECF-943E-D8F0DE3052AA
+  MODULE_TYPE  = DXE_DRIVER
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = FrbDxeEntryPoint
+
+[Sources]
+  FrbDxe.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseMemoryLib
+  DebugLib
+  IpmiCommandLib
+  MemoryAllocationLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
new file mode 100644
index 00..89d633f32e
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI FRB PEIM.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= FrbPei
+  FILE_GUID= 7CAAE1A7-0B37-4EEA-A432-2F203DA6F288
+  MODULE_TYPE  = PEIM
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeFrbPei
+
+[Sources]
+  FrbPei.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiCommandLib
+  PcdLib
+  PeimEntryPoint
+
+[Pcd]
+  gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag
+  gManageabilityPkgTokenSpaceGuid.PcdFRBTimeoutValue
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
new file mode 100644
index 00..46f741eed1
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
@@ -0,0 +1,212 @@
+/** @file
+IPMI Fault Resilient Booting Driver.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include  #include 
+#include  #include 
+
+/**
+  This routine disables the specified FRB timer.
+
+  @retval EFI_STATUS  EFI_SUCCESS  FRB timer was disabled
+ 

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiBmcElog: IPMI BMC Elog Driver

2023-05-15 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 12 May 2023 15:28
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiBmcElog: IPMI BMC 
Elog Driver

From: Abner Chang 

IpmiBmcElog is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/BmcElog in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/BmcElog until the reference to 
this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Universal/IpmiBmcElog/BmcElog.inf |  33 +++
 .../Universal/IpmiBmcElog/BmcElog.c   | 192 ++
 2 files changed, 225 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c

diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
new file mode 100644
index 00..4c28862fe5
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
@@ -0,0 +1,33 @@
+### @file
+# Component description file for BMC ELOG.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= BmcElog
+  FILE_GUID= A0FF2235-B652-45E3-B3D2-B20F3E714E6F
+  MODULE_TYPE  = DXE_DRIVER
+  PI_SPECIFICATION_VERSION = 0x0001000A
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeBmcElogLayer
+
+[Sources]
+  BmcElog.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IpmiCommandLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
new file mode 100644
index 00..ab179e9d49
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
@@ -0,0 +1,192 @@
+/** @file
+  BMC Event Log functions.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include  #include
+
+#include 
+#include 
+
+EFI_STATUS
+EFIAPI
+CheckIfSelIsFull (
+  VOID
+  );
+
+/**
+  This function erases event logs and waits unti complete.
+
+  @param [in]  ResvId  - Reserved ID
+
+  @retval  EFI_STATUS   EFI_SUCCESS
+EFI_NO_RESPONSE
+
+**/
+EFI_STATUS
+WaitTillErased (
+  IN  UINT8  *ResvId
+  )
+{
+  INTN Counter;
+  IPMI_CLEAR_SEL_REQUEST   ClearSel;
+  IPMI_CLEAR_SEL_RESPONSE  ClearSelResponse;
+
+  Counter = 0x200;
+  ZeroMem (, sizeof (ClearSelResponse));
+
+  while (TRUE) {
+ZeroMem (, sizeof (ClearSel));
+ClearSel.Reserve[0] = ResvId[0];
+ClearSel.Reserve[1] = ResvId[1];
+ClearSel.AscC   = 0x43;
+ClearSel.AscL   = 0x4C;
+ClearSel.AscR   = 0x52;
+ClearSel.Erase  = 0x00;
+
+IpmiClearSel (
+  ,
+  
+  );
+
+if ((ClearSelResponse.ErasureProgress & 0xf) == 1) {
+  return EFI_SUCCESS;
+}
+
+//
+//  If there is not a response from the BMC controller we need to return 
and not hang.
+//
+--Counter;
+if (Counter == 0x0) {
+  return EFI_NO_RESPONSE;
+}
+  }
+}
+
+/**
+  This function activates BMC event log.
+
+  @param [in] EnableElog  Enable/Disable event log  @param [out]
+ ElogStatus  return log status
+
+  @retval  EFI_STATUS
+
+**/
+EFI_STATUS
+EfiActivateBmcElog (
+  IN BOOLEAN   *EnableElog,
+  OUT BOOLEAN  *ElogStatus
+  )
+{
+  EFI_STATUSStatus;
+  UINT8 ElogStat;
+  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST   SetBmcGlobalEnables;
+  IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  GetBmcGlobalEnables;
+  UINT8 CompletionCode;
+
+  Status   = EFI_SUCCESS;
+  ElogStat = 0;
+
+  Status = IpmiGetBmcGlobalEnables ();  if
+ (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  if (EnableElog == NULL) {
+*ElogStatus =
+ GetBmcGlobalEnables.GetEnables.Bits.SystemEventLogging;
+  } else {
+if (Status == EFI_SUCCESS) {
+  if (*EnableElog) {
+ElogStat = 1;
+  }
+
+  CopyMem (, (UINT8 *) + 1, sizeof 
(UINT8));
+  SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging =
+ ElogStat;
+
+  Status = IpmiSetBmcGlobalEnables (, );
+}
+  }
+
+  return Status;
+}
+
+/**
+
+  

Re: [edk2-devel] [PATCH v11 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib

2023-05-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
Looks like some issue with my mailbox, I saw your mail after submitting 
patch V12.
I'll rework and send V13 patch series.

Thanks
AbduL

-Original Message-
From: Ni, Ray 
Sent: 12 May 2023 09:11
To: devel@edk2.groups.io; Ni, Ray ; Attar, AbdulLateef (Abdul 
Lateef) ; Wu, Jiaxin 
Cc: Grimes, Paul ; Chang, Abner ; 
Dong, Eric ; Kumar, Rahul R ; 
Gerd Hoffmann ; Kinney, Michael D 
; Gao, Liming ; Liu, 
Zhiguang ; Ard Biesheuvel ; 
Yao, Jiewen ; Justen, Jordan L 
; Holthaus, CJ 
Subject: RE: [edk2-devel] [PATCH v11 0/8] Adds AmdSmmCpuFeaturesLib and 
MmSaveStateLib

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


Abdul,
I checked your V12 patch. It seems none of comments I have for your V11 are not 
addressed. (check my inline reply below)

Can we get aligned firstly then you send out next version patches?

This could also save my time on downloading your changes and reviewing them one 
by one.

Thanks,
Ray


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Thursday, May 11, 2023 2:56 PM
> To: Abdul Lateef Attar ; devel@edk2.groups.io; Wu,
> Jiaxin 
> Cc: Paul Grimes ; Abner Chang
> ; Dong, Eric ; Kumar, Rahul
> R ; Gerd Hoffmann ;
> Kinney, Michael D ; Gao, Liming
> ; Liu, Zhiguang ;
> Ard Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L ;
> Holthaus, CJ 
> Subject: Re: [edk2-devel] [PATCH v11 0/8] Adds AmdSmmCpuFeaturesLib
> and MmSaveStateLib
>
> >   UefiCpuPkg: Adds MmSaveStateLib library class
> You can take "Reviewed-by: Ray Ni " for this patch.
>
> > UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code
> You can take "Reviewed-by: Ray Ni " for this patch.
>
> > UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family
> One comment: can you please change the BASE_NAME in lib INF to
> "AmdSmmCpuFeaturesLib"?
> The BASE_NAME guides tool to generate the .Lib file in the disk.
> Choosing different BASE_NAME for Intel and AMD lib instance can avoid
> one LIB file is replaced by the other during pkg build.
>
> > UefiCpuPkg: Implements MmSaveStateLib for Intel
> 1. MmSaveStateLib local functions should not have "EFIAPI". Please
> only add "EFIAPI" for lib APIs.

1. not addressed in V12.

> 2. MmSaveStateGetRegisterLma() doesn't need to carry "CpuIndex" as
> parameter. Can you please remove the parameter?


2. not addressed in V12.

> 3. MmSaveStateGetRegisterIndex () returns wrong value for Intel
> processors because it uses Offset ( = 2) but Intel implementation uses Offset 
> ( = 4).
>
> (I remember comments #1, #3 were both raised last time when I reviewed
> the
> patch.)

3. not addressed in V12.

>
> > UefiCpuPkg: Removes SmmCpuFeaturesReadSaveStateRegister
> You can take "Reviewed-by: Ray Ni " for this patch.
>
>
> One more comment:
> Can you please avoid FILE_GUID overridden in UefiCpuPkg.dsc for Intel
> instance of SmmCpu driver?
> AMD instance can override the FILE_GUID for sure.

4. not addressed in V12.

>
> @Wu, Jiaxin, we will need to change the close-source SmmCpuFeatureLib
> accordingly (separating the SaveState access code into a different
> lib) when this patch series are merged.
>
> > -Original Message-
> > From: Abdul Lateef Attar 
> > Sent: Saturday, May 6, 2023 12:07 PM
> > To: devel@edk2.groups.io
> > Cc: Abdul Lateef Attar ; Paul Grimes
> > ; Abner Chang ; Dong, Eric
> > ; Ni, Ray ; Kumar, Rahul R
> > ; Gerd Hoffmann ;
> > Kinney, Michael D ; Gao, Liming
> > ; Liu, Zhiguang ;
> > Ard Biesheuvel ; Yao, Jiewen
> ;
> > Justen, Jordan L 
> > Subject: [PATCH v11 0/8] Adds AmdSmmCpuFeaturesLib and
> > MmSaveStateLib
> >
> > PR: https://github.com/tianocore/edk2/pull/4341
> >
> > V11: Delta changes
> > Drop the OVMF implementation of MmSaveStateLib
> > V10: Delta changes:
> >   Addressed review comments from Abner.
> > V9: Delta changes:
> >   Addressed review comments.
> >   Rename to MmSaveStateLib.
> >   Also rename SMM_ defines to MM_.
> >   Implemented OVMF MmSaveStateLib.
> >   Removes SmmCpuFeaturesReadSaveStateRegister and
> > SmmCpuFeaturesWriteSaveStateRegister
> >   function interface.
> > V8 delta changes:
> >Addressed review comments from Abner,
> >Fix the whitespace error.
> >Seperate the Ovmf changes to another patch
> > V7 delta changes:
> >Adds SmmSmramSaveStateLib for Intel processor.
> >Integrate SmmSmramSaveStateLib library.
> > V6 delta changes:
> >Addressed review comments for Ray NI.
> >removed unnecessary EFIAPI.
> > V5 delta changes:
> >rebase to master branch.
> >updated Reviewed-by
> > V4 delta changes:
> >   rebase to master branch.
> >   added reviewed-by.
> > V3 delta changes:
> >   Addressed review comments from Abner chang.
> >   Re-arranged patch order.
> >
> > Cc: Paul Grimes 
> > Cc: Abner Chang 
> > Cc: Eric Dong 
> > Cc: Ray Ni 
> > Cc: Rahul Kumar 
> > Cc: Gerd Hoffmann 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: 

Re: [edk2-devel] [PATCH v11 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib

2023-05-11 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Michael,
Thanks for providing the inputs, I will make the necessary changes. 
Please see inline for my reply.

-Original Message-
From: Michael Kubacki 
Sent: 10 May 2023 00:42
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Grimes, Paul ; Chang, Abner ; 
Eric Dong ; Ray Ni ; Rahul Kumar 
; Gerd Hoffmann ; Michael D Kinney 
; Liming Gao ; Zhiguang 
Liu ; Ard Biesheuvel ; 
Jiewen Yao ; Jordan Justen 
Subject: Re: [edk2-devel] [PATCH v11 0/8] Adds AmdSmmCpuFeaturesLib and 
MmSaveStateLib

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


I haven't followed the whole thread but looking at v11, I wanted to check on 
the following.

1. The library source files (for AmdMmSaveStateLib and
IntelMmSaveStateLib) include several library headers (particularly in
MmSaveStateLib/MmSaveState.h) but do not have a [LibraryClasses] section in 
their INF files. Is there a reason?
[Attar, AbdulLateef (Abdul Lateef)]  I will make changes and submit V12 version.

2. AmdMmSaveStateLib and IntelMmSaveStateLib depend on SmmServicesTableLib. Can 
they depend on MmServicesTableLib instead?
[Attar, AbdulLateef (Abdul Lateef)] MmSaveStateLib is mainly used by 
PiSmmCpuDxeSmm driver which still uses Smm convention and preserve the 
SAVE_STATE pointed by gSmst(Instead of gMmst).
Hence I don’t think we can move to MmServicesTableLib.

3. It seems resources like the EFER register LMA bit should be defined 
somewhere agnostic to the MmSaveState.h file in MmSaveStateLib. It is 
referenced in MdePkg/Include/Register/Intel/ArchitecturalMsr.h:

https://github.com/tianocore/edk2/blob/5215cd5baf6609e54050c69909273b7f5161c59e/MdePkg/Include/Register/Intel/ArchitecturalMsr.h#L6342

In any case, can the bit be defined in one location?
[Attar, AbdulLateef (Abdul Lateef)] This AMD specific implementation, I'll move 
the MACRO definition under the AmdMmSaveStateLib.c file.

4. Your change to the SmmCpuFeaturesLib.h interface is not backward compatible 
and a build breaking change. I think that should be called out in your cover 
letter.
[Attar, AbdulLateef (Abdul Lateef)] I will update the cover letter in V12 
version.

Thanks,
Michael

On 5/6/2023 12:06 AM, Abdul Lateef Attar via groups.io wrote:
> PR: https://github.com/tianocore/edk2/pull/4341
>
> V11: Delta changes
> Drop the OVMF implementation of MmSaveStateLib
> V10: Delta changes:
>Addressed review comments from Abner.
> V9: Delta changes:
>Addressed review comments.
>Rename to MmSaveStateLib.
>Also rename SMM_ defines to MM_.
>Implemented OVMF MmSaveStateLib.
>Removes SmmCpuFeaturesReadSaveStateRegister and 
> SmmCpuFeaturesWriteSaveStateRegister
>function interface.
> V8 delta changes:
> Addressed review comments from Abner,
> Fix the whitespace error.
> Seperate the Ovmf changes to another patch
> V7 delta changes:
> Adds SmmSmramSaveStateLib for Intel processor.
> Integrate SmmSmramSaveStateLib library.
> V6 delta changes:
> Addressed review comments for Ray NI.
> removed unnecessary EFIAPI.
> V5 delta changes:
> rebase to master branch.
> updated Reviewed-by
> V4 delta changes:
>rebase to master branch.
>added reviewed-by.
> V3 delta changes:
>Addressed review comments from Abner chang.
>Re-arranged patch order.
>
> Cc: Paul Grimes 
> Cc: Abner Chang 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Rahul Kumar 
> Cc: Gerd Hoffmann 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Abdul Lateef Attar 
>
> Abdul Lateef Attar (8):
>MdePkg: Adds AMD SMRAM save state map
>UefiCpuPkg: Adds MmSaveStateLib library class
>UefiCpuPkg: Implements MmSaveStateLib library instance
>UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code
>UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family
>UefiCpuPkg: Implements MmSaveStateLib for Intel
>UefiCpuPkg: Removes SmmCpuFeaturesReadSaveStateRegister
>OvmfPkg: Uses MmSaveStateLib library
>
>   UefiCpuPkg/UefiCpuPkg.dec |   4 +
>   OvmfPkg/OvmfPkgIa32.dsc   |   1 +
>   OvmfPkg/OvmfPkgIa32X64.dsc|   3 +
>   OvmfPkg/OvmfPkgX64.dsc|   1 +
>   UefiCpuPkg/UefiCpuPkg.dsc |  14 +
>   .../MmSaveStateLib/AmdMmSaveStateLib.inf  |  28 +
>   .../MmSaveStateLib/IntelMmSaveStateLib.inf|  28 +
>   .../AmdSmmCpuFeaturesLib.inf  |  38 +
>   UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf  |   2 +
>   .../Include/Register/Amd/SmramSaveStateMap.h  | 194 +
>   UefiCpuPkg/Include/Library/MmSaveStateLib.h   |  70 ++
>   .../Include/Library/SmmCpuFeaturesLib.h   |  52 --
>   .../Library/MmSaveStateLib/MmSaveState.h  | 102 +++
>   UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h|  56 +-
>   

Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/IpmiCommandLib:IPMI Command Library

2023-05-09 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 05 May 2023 10:54
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH] ManageabilityPkg/IpmiCommandLib:IPMI Command 
Library

From: Abner Chang 

BZ #: 

IpmiCommandLib is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/Library/IpmiCommandLib in order to
consolidate edk2 system manageability support in
one place. Function header are added to the source
files and header files. Uncustify is applied to C
files and no functionalities are changed in this patch.

We will still keep the one under IpmiFeaturePkg/Library/
IpmiCommandLib until the reference to this instance are
removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Library/IpmiCommandLib/IpmiCommandLib.inf |  33 +
 .../Include/Library/IpmiCommandLib.h  | 620 ++
 .../IpmiCommandLib/IpmiCommandLibNetFnApp.c   | 444 +
 .../IpmiCommandLibNetFnChassis.c  | 199 ++
 .../IpmiCommandLibNetFnStorage.c  | 384 +++
 .../IpmiCommandLibNetFnTransport.c| 156 +
 6 files changed, 1836 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
 create mode 100644 Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnChassis.c
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnStorage.c
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c

diff --git 
a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf 
b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
new file mode 100644
index 00..3dc485cf38
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
@@ -0,0 +1,33 @@
+### @file
+# Component description file for IPMI Command Library.
+#
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = IpmiCommandLib
+  FILE_GUID  = 96FC1989-CB7F-489B-9D3B-68DCA2C2DADC
+  MODULE_TYPE= UEFI_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiCommandLib
+
+[sources]
+  IpmiCommandLibNetFnApp.c
+  IpmiCommandLibNetFnTransport.c
+  IpmiCommandLibNetFnChassis.c
+  IpmiCommandLibNetFnStorage.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiLib
diff --git a/Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h 
b/Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h
new file mode 100644
index 00..685f6e2ea2
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h
@@ -0,0 +1,620 @@
+/** @file
+  This library abstract how to send/receive IPMI command.
+
+Copyright (c) 2018-2021, Intel Corporation. All rights reserved.
+Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef IPMI_COMMAND_LIB_H_
+#define IPMI_COMMAND_LIB_H_
+
+#include 
+#include 
+
+///
+/// Functions for IPMI NetFnApp commands
+///
+
+/**
+  This function is used to retrieve device ID.
+
+  @param [out]  DeviceId  The pointer to receive IPMI_GET_DEVICE_ID_RESPONSE.
+
+  @retval EFI_STASTUS   See the return values of IpmiSubmitCommand () function.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetDeviceId (
+  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
+  );
+
+/**
+  This function returns device self test results
+
+  @param [out]  SelfTestResult  The pointer to receive 
IPMI_SELF_TEST_RESULT_RESPONSE.
+
+  @retval EFI_STASTUS   See the return values of IpmiSubmitCommand () function.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelfTestResult (
+  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
+  );
+
+/**
+  This function is used for starting and restarting the Watchdog
+  Timer from the initial countdown value that was specified in
+  the Set Watchdog Timer command the watchdog timer.
+
+  @param [out]  CompletionCode  IPMI completetion code, refer to Ipmi.h.
+
+  @retval EFI_STASTUS   See the return values of IpmiSubmitCommand () function.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiResetWatchdogTimer (
+  OUT UINT8  *CompletionCode
+  );
+
+/**
+  This function  is used for initializing and configuring
+  the 

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg: Add Manageability IPMI helper Library

2023-05-09 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 09 May 2023 13:26
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg: Add Manageability IPMI 
helper Library

From: Abner Chang 

Add IPMI helper library to print debug message of IPMI Completion Code in human 
readable string and return the transport interface additional status.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../BaseManageabilityTransportHelper.inf  |  1 +
 .../Library/ManageabilityTransportHelperLib.h | 24 +++
 .../Library/ManageabilityTransportIpmiLib.h   | 13 +++-
 .../Library/ManageabilityTransportLib.h   | 11 +--
 .../BaseManageabilityTransportIpmiHelper.c| 70 +++
 5 files changed, 112 insertions(+), 7 deletions(-)  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportIpmiHelper.c

diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
index c9e5eaef60..0936449fda 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelper
+++ Lib/BaseManageabilityTransportHelper.inf
@@ -21,6 +21,7 @@

 [Sources]
   BaseManageabilityTransportHelper.c
+  BaseManageabilityTransportIpmiHelper.c

 [LibraryClasses]
   BaseMemoryLib
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
index c2c98d6c2d..11a1bd0521 100644
--- 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHe
+++ lperLib.h
@@ -187,4 +187,28 @@ HelperManageabilityDebugPrint (
   ...
   );

+///
+/// IPMI Helper Functions.
+///
+
+/**
+  This function returns a human readable string of IPMI KCS Completion
+Code
+  and returns the corresponding additional status of transport interface.
+
+  @param [in]  CompletionCode The Completion Code returned from KCS.
+  @param [out] CompletionCodeStr  Human readable string of IPMI Completion 
Code.
+  @param [out] AdditionalStatus   Return the addtional status.
+
+  @retval  EFI_SUCCESSThe information of Completion Code is 
returned.
+  @retval  EFI_NOT_FOUND  No information of Completion Code is 
returned.
+  @retval  EFI_INVALID_PARAMETER  The given parameter is incorrect.
+
+**/
+EFI_STATUS
+IpmiHelperCheckCompletionCode (
+  IN   UINT8  CompletionCode,
+  OUT  CHAR16 **CompletionCodeStr,
+  OUT  MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS  *AdditionalStatus
+  );
+
 #endif
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
index 1628255a6a..6d136e460f 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIp
+++ miLib.h
@@ -16,9 +16,18 @@
 /// the payload.
 ///
 typedef struct {
-  UINT8Lun:2;
-  UINT8NetFn:6;
+  UINT8Lun   : 2;
+  UINT8NetFn : 6;
   UINT8Command;
 } MANAGEABILITY_IPMI_TRANSPORT_HEADER;

+///
+/// The IPMI Completion Code mapping.
+///
+typedef struct {
+  UINT8CompletionCode;
+  CHAR16   *CompletionCodeString;
+  MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUSAdditionalStatus;
+} MANAGEABILITY_IPMI_COMPLETTION_CODE_MAPPING;
+
 #endif
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
index 04072aee89..f423a1ed44 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLi
+++ b.h
@@ -61,11 +61,12 @@ typedef union {
 /// Additional transport interface status.
 ///
 typedef UINT32 MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS;
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NO_ERRORS  0x
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_ERROR  0x0001
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_READ   0x0002
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_WRITE  0x0004 
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NOT_AVAILABLE  0x
+#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NO_ERRORS0x
+#define 

Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/IpmiCommandLib: Add IpmiCommandLib to package

2023-05-09 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 05 May 2023 10:54
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH] ManageabilityPkg/IpmiCommandLib: Add 
IpmiCommandLib to package

From: Abner Chang 

BZ #: 
Add IpmiCommandLib to ManageabilityPkg package.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 4 
 Features/ManageabilityPkg/Include/Manageability.dsc | 1 +
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 1 +
 3 files changed, 6 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 6f58ab4f45..38813c5f48 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -18,6 +18,10 @@
   Include

 [LibraryClasses]
+  ##  @libraryclass IPMI command library
+  #   Provide the help functions to send IPMI commands.
+  IpmiCommandLib|Include/Library/IpmiCommandLib.h
+
   ##  @libraryclass Manageability Transport Library
   #   Manageability Transport Library definitions
   ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index 5e7cdb885f..a432b0ff26 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -7,6 +7,7 @@
 ##
 [LibraryClasses]
   
ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+  IpmiCommandLib|ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf

 [LibraryClasses.common.DXE_DRIVER]
   
PldmProtocolLib|ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index a0712d1c0a..e3baf27f2a 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -49,6 +49,7 @@
   
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
   
ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/DxeManageabilityTransportMctp.inf
   ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
+  ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf

 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
--
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH v10 7/9] UefiCpuPkg: Implements MmSaveStateLib for Ovmf

2023-05-05 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Thanks Gerd, for the inputs. I'll drop the patch and submit the new version.

-AbduL

-Original Message-
From: Gerd Hoffmann 
Sent: 04 May 2023 14:13
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Grimes, Paul ; Chang, Abner 
; Eric Dong ; Ray Ni 
; Rahul Kumar ; Ard Biesheuvel 
; Jiewen Yao ; Jordan Justen 

Subject: Re: [PATCH v10 7/9] UefiCpuPkg: Implements MmSaveStateLib for Ovmf

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


On Thu, May 04, 2023 at 12:09:19PM +0530, Abdul Lateef Attar wrote:
> From: Abdul Lateef Attar 
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182
>
> Implements MmSaveStateLib library interfaces to read and write save
> state registers for Ovmf/Qemu.

Not needed, ovmf can use AmdMmSaveStateLib

take care,
  Gerd



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




Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-05-01 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Thanks Isaac for correcting and pushing the patch.

-Original Message-
From: Oram, Isaac W 
Sent: 02 May 2023 05:42
To: devel@edk2.groups.io; Oram, Isaac W ; Attar, 
AbdulLateef (Abdul Lateef) 
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: RE: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table 
based on PCD values

[Public]

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


Pushed as 64b06a4d19..d39c665fe3

Note I had trouble extracting the patch.  I had to ignore whitespace and then 
fixup line endings to pass python \edk2\BaseTools\Scripts\PatchCheck.py -1

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Monday, May 1, 2023 5:08 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table 
based on PCD values

Reviewed-by: Isaac Oram 

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD 
values

[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase);
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8
+ 

Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-04-28 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase);
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8
+ (PcdSerialRegisterAccessWidth);  gSpcrInfo.BaseAddress.AccessSize =
+ (UINT8)PcdGet32 (PcdSerialRegisterStride);  if (PcdGetBool 
(PcdSerialUseMmio)) {
+gSpcrInfo.BaseAddress.AddressSpaceId = EFI_ACPI_3_0_SYSTEM_MEMORY;
+ }
+
+  // OEM info
+  CopyMem (
+(VOID *) ,
+PcdGetPtr (PcdAcpiDefaultOemId),
+sizeof (gSpcrInfo.Header.OemId)
+);
+  AcpiTableOemId = PcdGet64 (PcdAcpiDefaultOemTableId);  CopyMem (
+(VOID *) ,
+(VOID *) ,
+sizeof (gSpcrInfo.Header.OemTableId)
+);
+  gSpcrInfo.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+  gSpcrInfo.Header.CreatorId   = PcdGet32 (PcdAcpiDefaultCreatorId);
+  gSpcrInfo.Header.CreatorRevision = PcdGet32
+ (PcdAcpiDefaultCreatorRevision);
+
   //
   // Add table
   //
--
2.25.1



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




Re: [edk2-devel] [edk2-platforms][PATCH V3 01/14] ManageabilityPkg: Add more helper functions

2023-04-22 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 21 April 2023 10:53
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V3 01/14] ManageabilityPkg: Add more helper 
functions

From: Abner Chang 

1. Add a helper function to output payload binary
   to debug output device.
2. Add a helper function to split payload into
   packages according to maximum transfer unit
   of transport interface.
3. Add a helper function to generate CRC8.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../BaseManageabilityTransportHelper.inf  |   1 +
 .../Library/ManageabilityTransportHelperLib.h |  97 
 .../BaseManageabilityTransportHelper.c| 225 +-
 3 files changed, 313 insertions(+), 10 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
index 5447954144..c9e5eaef60 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelper
+++ Lib/BaseManageabilityTransportHelper.inf
@@ -25,6 +25,7 @@
 [LibraryClasses]
   BaseMemoryLib
   DebugLib
+  MemoryAllocationLib

 [Packages]
   ManageabilityPkg/ManageabilityPkg.dec
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
index 718ac34a1f..c2c98d6c2d 100644
--- 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHe
+++ lperLib.h
@@ -11,8 +11,24 @@

 #include 

+#define DEBUG_MANAGEABILITY_INFO  DEBUG_INFO
+
 typedef struct _MANAGEABILITY_PROTOCOL_NAME MANAGEABILITY_PROTOCOL_NAME;

+typedef struct {
+  UINT8 *PayloadPointer;
+  UINT32PayloadSize;
+} MANAGEABILITY_TRANSMISSION_PACKAGE_ATTR;
+
+//
+// The information of multi portions of payload it is // splitted
+according to transport interface Maximum // Transfer Unit.
+typedef struct {
+  UINT16 NumberOfPackages; ///< Number of 
packages in MultiPackages.
+  MANAGEABILITY_TRANSMISSION_PACKAGE_ATTRMultiPackages[];
+} MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES;
+
 /**
   Helper function returns the human readable name of Manageability 
specification.

@@ -90,4 +106,85 @@ HelperInitManageabilityTransport (
   OUT MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS *TransportAdditionalStatus 
OPTIONAL
   );

+/**
+  This function splits payload into multiple packages according to
+  the given transport interface Maximum Transfer Unit (MTU).
+
+  @param[in]  PreambleSize The additional data size precedes
+   each package.
+  @param[in]  PostambleSizeThe additional data size succeeds
+   each package.
+  @param[in]  Payload  Pointer to payload.
+  @param[in]  PayloadSize  Payload size in byte.
+  @param[in]  MaximumTransferUnit  MTU of transport interface.
+  @param[out] MultiplePackages Pointer to receive
+   MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES
+   structure. Caller has to free the memory
+   allocated for 
MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES.
+
+  @retval   EFI_SUCCESS  MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES 
structure
+ is returned successfully.
+  @retval   EFI_OUT_OF_RESOURCE  Not enough resource to create
+ MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES 
structure.
+**/
+EFI_STATUS
+HelperManageabilitySplitPayload (
+  IN UINT16  PreambleSize,
+  IN UINT16  PostambleSize,
+  IN UINT8   *Payload,
+  IN UINT32  PayloadSize,
+  IN UINT32  MaximumTransferUnit,
+  OUT MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES  **MultiplePackages
+  );
+
+/**
+  This function generates CRC8 with given polynomial.
+
+  @param[in]  Polynomial   Polynomial in 8-bit.
+  @param[in]  CrcInitialValue  CRC initial value.
+  @param[in]  BufferStart  Pointer to buffer starts the CRC calculation.
+  @param[in]  BufferSize   Size of buffer.
+
+  @retval  UINT8 CRC value.
+**/
+UINT8
+HelperManageabilityGenerateCrc8 (
+  IN UINT8   Polynomial,
+  IN UINT8   CrcInitialValue,
+  IN UINT8   *BufferStart,
+  IN UINT32  BufferSize
+  );
+
+/**
+  Print out manageability 

Re: [edk2-devel] [edk2-platforms][PATCH V3 03/14] ManageabilityPkg: Add HeaderSize and TrailerSize

2023-04-22 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by:  Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 21 April 2023 10:53
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V3 03/14] ManageabilityPkg: Add HeaderSize and 
TrailerSize

From: Abner Chang 

Add HeaderSize and TrailerSize in
MANAGEABILITY_TRANSFER_TOKEN structure.
Manageability transport interface may used by multiple protocols which have 
different header and trailer of payload. (e.g. MCTP over KCS and IPMI over KCS).

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 .../Library/ManageabilityTransportLib.h   |   2 +
 .../Common/ManageabilityTransportKcs.h|  20 ++-
 .../IpmiProtocol/Common/IpmiProtocolCommon.h  |  36 +++--
 .../Common/KcsCommon.c| 152 --
 .../Dxe/ManageabilityTransportKcs.c   |  14 +-
 .../IpmiProtocol/Common/IpmiProtocolCommon.c  |  63 +---
 Features/ManageabilityPkg/Readme.md   |  10 ++
 7 files changed, 194 insertions(+), 103 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
index d86d0d87d5..04072aee89 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLi
+++ b.h
@@ -168,10 +168,12 @@ struct _MANAGEABILITY_TRANSFER_TOKEN {
   ///< 
which is sent discretely of payload.
   ///< 
This field can be NULL if the transport
   ///< 
doesn't require this.
+  UINT16   TransmitHeaderSize;///< 
Transmit header size in byte.
   MANAGEABILITY_TRANSPORT_TRAILER  TransmitTrailer;   ///< 
This is the transport-specific trailer
   ///< 
which is sent discretely of payload.
   ///< 
This field can be NULL if the transport
   ///< 
doesn't require this.
+  UINT16   TransmitTrailerSize;   ///< 
Transmit trailer size in byte.
   MANAGEABILITY_TRANSMIT_PACKAGE   TransmitPackage;   ///< 
The payload sent to transport interface.
   MANAGEABILITY_RECEIVE_PACKAGEReceivePackage;///< 
The buffer to receive the response.
   EFI_STATUS   TransferStatus;///< 
The EFI Status of the transfer.
diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
index 2cdf60ba7e..d6685c165e 100644
--- 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Com
+++ mon/ManageabilityTransportKcs.h
@@ -41,8 +41,10 @@ typedef struct {
 /**
   This service communicates with BMC using KCS protocol.

-  @param[in]  NetFunction   Net function of the command.
-  @param[in]  Command   IPMI Command.
+  @param[in]  TransmitHeaderKCS packet header.
+  @param[in]  TransmitHeaderSizeKCS packet header size in byte.
+  @param[in]  TransmitTrailer   KCS packet trailer.
+  @param[in]  TransmitTrailerSize   KCS packet trailer size in byte.
   @param[in]  RequestData   Command Request Data.
   @param[in]  RequestDataSize   Size of Command Request Data.
   @param[out] ResponseData  Command Response Data. The completion
@@ -69,12 +71,14 @@ typedef struct {
 EFI_STATUS
 EFIAPI
 KcsTransportSendCommand (
-  IN  UINT8  NetFunction,
-  IN  UINT8  Command,
-  IN  UINT8  *RequestData OPTIONAL,
-  IN  UINT32 RequestDataSize,
-  OUT UINT8  *ResponseData OPTIONAL,
-  IN OUT UINT32  *ResponseDataSize OPTIONAL
+  IN  MANAGEABILITY_TRANSPORT_HEADER   TransmitHeader,
+  IN  UINT16   TransmitHeaderSize,
+  IN  MANAGEABILITY_TRANSPORT_TRAILER  TransmitTrailer OPTIONAL,
+  IN  UINT16   TransmitTrailerSize,
+  IN  UINT8*RequestData OPTIONAL,
+  IN  UINT32   RequestDataSize,
+  OUT UINT8*ResponseData OPTIONAL,
+  IN OUT UINT32*ResponseDataSize OPTIONAL
   );

 /**
diff --git 

Re: [edk2-devel] [edk2-platforms][PATCH V3 04/14] ManageabilityPkg: Add PldmProtocolLib

2023-04-22 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by:  Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 21 April 2023 10:53
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V3 04/14] ManageabilityPkg: Add PldmProtocolLib

From: Abner Chang 

PldmProtocolLib provides the library
function to PLDM protocol.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |  3 +
 .../Include/Dsc/Manageability.dsc |  3 +
 .../ManageabilityPkg/ManageabilityPkg.dsc |  1 +
 .../Dxe/PldmProtocolLib.inf   | 42 +
 .../Include/Library/BasePldmProtocolLib.h | 41 +
 .../Include/Protocol/PldmProtocol.h   | 87 +++
 .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c | 87 +++
 .../Dxe/PldmProtocolLib.uni   | 18 
 8 files changed, 282 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
 create mode 100644 Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h
 create mode 100644 
Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.c
 create mode 100644 
Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 3d279ef033..e4d147fede 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -48,3 +48,6 @@
   gManageabilityProtocolMctpGuid= { 0x76FED8F1, 0x0BE5, 0x4269, { 0xA3, 
0x1A, 0x38, 0x0F, 0x54, 0xF1, 0xA1, 0x8A } }
   # Manageability Protocol PLDM
   gManageabilityProtocolPldmGuid= { 0x3958090D, 0x69DD, 0x4868, { 0x9C, 
0x41, 0xC9, 0xAC, 0x31, 0xB5, 0x25, 0xC5 } }
+
+[Protocols]
+  gEdkiiPldmProtocolGuid= { 0x60997616, 0xDB70, 0x4B5F, { 
0x86, 0xA4, 0x09, 0x58, 0xA3, 0x71, 0x47, 0xB4 } }
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 7f8d8df3f0..eda1a36bb9 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -8,6 +8,9 @@
 [LibraryClasses]
   
ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf

+[LibraryClasses.common.DXE_DRIVER]
+
+PldmProtocolLib|ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmPr
+otocolLib.inf
+
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # This library provides the instrinsic functions generated by a given 
compiler.
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 6a083385fd..412029ef6c 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,7 @@

 [Components]
   
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
+  ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf

 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
diff --git 
a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf 
b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
new file mode 100644
index 00..1233d76726
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProt
+++ ocolLib.inf
@@ -0,0 +1,42 @@
+## @file
+#  Instance of PLDM Protocol Library in DXE phase.
+#
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved. # #  SPDX-License-Identifier: BSD-2-Clause-Patent # # ##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PldmProtocolLib
+  MODULE_UNI_FILE= PldmProtocolLib.uni
+  FILE_GUID  = 5B1173E8-6A5A-468B-BDA4-02303530C55C
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = PldmProtocolLib|DXE_RUNTIME_DRIVER 
DXE_DRIVER DXE_CORE UEFI_DRIVER UEFI_APPLICATION
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  PldmProtocolLib.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  ManageabilityTransportHelperLib
+  UefiBootServicesTableLib
+
+[Guids]
+  gManageabilityProtocolPldmGuid
+
+[Protocols]
+  gEdkiiPldmProtocolGuid  ## ALWAYS_CONSUMES
+
diff --git a/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h 

Re: [edk2-devel] [edk2-platforms][PATCH V2 02/14] ManageabilityPkg: Support Maximum Transfer Unit

2023-04-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 18 April 2023 12:46
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V2 02/14] ManageabilityPkg: Support Maximum 
Transfer Unit

From: Abner Chang 

Update GetTransportCapability to support Maximum Transfer Unit (MTU) of 
transport interface.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../Library/ManageabilityTransportLib.h   | 33 ---
 .../Common/ManageabilityTransportKcs.h|  2 +
 .../IpmiProtocol/Pei/IpmiPpiInternal.h|  8 ++-
 .../BaseManageabilityTransportNull.c  | 18 --
 .../Dxe/ManageabilityTransportKcs.c   | 57 +++
 .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 24 ++--
 .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 51 ++---
 .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 24 ++--
 8 files changed, 145 insertions(+), 72 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
index c022b4ac5c..d86d0d87d5 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLi
+++ b.h
@@ -14,6 +14,9 @@
 #define MANAGEABILITY_TRANSPORT_TOKEN_VERSION
((MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MAJOR << 8) |\
 
MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MINOR)

+#define MANAGEABILITY_TRANSPORT_PAYLOAD_SIZE_FROM_CAPABILITY(a)  (1 << ((a & 
MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_MASK) >>\
+
+MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_BIT_POSITION))
+
 typedef struct  _MANAGEABILITY_TRANSPORT_FUNCTION_V1_0  
MANAGEABILITY_TRANSPORT_FUNCTION_V1_0;
 typedef struct  _MANAGEABILITY_TRANSPORT
MANAGEABILITY_TRANSPORT;
 typedef struct  _MANAGEABILITY_TRANSPORT_TOKEN  
MANAGEABILITY_TRANSPORT_TOKEN;
@@ -68,8 +71,17 @@ typedef UINT32 MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS;
 /// Additional transport interface features.
 ///
 typedef UINT32 MANAGEABILITY_TRANSPORT_CAPABILITY;
+/// Bit 0
 #define MANAGEABILITY_TRANSPORT_CAPABILITY_MULTIPLE_TRANSFER_TOKENS  0x0001
-#define MANAGEABILITY_TRANSPORT_CAPABILITY_ASYNCHRONOUS_TRANSFER 0x0002
+/// Bit 1
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_ASYNCHRONOUS_TRANSFER  0x0002
+/// Bit 2   - Reserved
+/// Bit 7:3 - Transport interface maximum payload size, which is (2 ^ bit[7:3] 
- 1)
+///   bit[7:3] means no maximum payload.
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_MASK   
0x00f8
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_BIT_POSITION   3
+#define
+MANAGEABILITY_TRANSPORT_CAPABILITY_MAXIMUM_PAYLOAD_NOT_AVAILABLE  0x00
+/// Bit 8:31 - Reserved

 ///
 /// Definitions of Manageability transport interface functions.
@@ -187,15 +199,20 @@ AcquireTransportSession (
   );

 /**
-  This function returns the transport capabilities.
-
-  @param [out]  TransportFeaturePointer to receive transport 
capabilities.
-See the definitions of
-MANAGEABILITY_TRANSPORT_CAPABILITY.
-
+  This function returns the transport capabilities according to  the
+ manageability protocol.
+
+  @param [in]   TransportToken Transport token acquired from 
manageability
+   transport library.
+  @param [out]  TransportFeature   Pointer to receive transport 
capabilities.
+   See the definitions of
+   MANAGEABILITY_TRANSPORT_CAPABILITY.
+  @retval   EFI_SUCCESSTransportCapability is returned 
successfully.
+  @retval   EFI_INVALID_PARAMETER  TransportToken is not a valid token.
 **/
-VOID
+EFI_STATUS
 GetTransportCapability (
+  IN MANAGEABILITY_TRANSPORT_TOKEN*TransportToken,
   OUT MANAGEABILITY_TRANSPORT_CAPABILITY  *TransportCapability
   );

diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
index f1758ffd8f..2cdf60ba7e 100644
--- 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Com
+++ mon/ManageabilityTransportKcs.h
@@ -32,6 +32,8 @@ typedef struct {
 #define IPMI_KCS_GET_STATE(s)  (s >> 6)  #define IPMI_KCS_SET_STATE(s)  (s << 
6)

+#define MCTP_KCS_MTU_IN_POWER_OF_2  8
+
 /// 5 sec, according to IPMI spec
 #define IPMI_KCS_TIMEOUT_5_SEC  

Re: [edk2-devel] [edk2-platforms][PATCH V2 01/14] ManageabilityPkg: Add more helper functions

2023-04-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Comments inline.

-Original Message-
From: Chang, Abner 
Sent: 18 April 2023 12:46
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V2 01/14] ManageabilityPkg: Add more helper 
functions

From: Abner Chang 

1. Add a helper function to output payload binary
   to debug output device.
2. Add a helper function to split payload into
   packages according to maximum transfer unit
   of transport interface.
3. Add a helper function to generate CRC8.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../BaseManageabilityTransportHelper.inf  |   1 +
 .../Library/ManageabilityTransportHelperLib.h |  98 
 .../BaseManageabilityTransportHelper.c| 225 +-
 3 files changed, 314 insertions(+), 10 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
index 5447954144..c9e5eaef60 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelper
+++ Lib/BaseManageabilityTransportHelper.inf
@@ -25,6 +25,7 @@
 [LibraryClasses]
   BaseMemoryLib
   DebugLib
+  MemoryAllocationLib

 [Packages]
   ManageabilityPkg/ManageabilityPkg.dec
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
index 718ac34a1f..0dbf5ccb3c 100644
--- 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHe
+++ lperLib.h
@@ -11,8 +11,24 @@

 #include 

+#define DEBUG_MANAGEABILITY_INFO  DEBUG_INFO
+
 typedef struct _MANAGEABILITY_PROTOCOL_NAME MANAGEABILITY_PROTOCOL_NAME;

+typedef struct {
+  UINT8 *PayloadPointer;
+  UINT32PayloadSize;
+} MANAGEABILITY_TRANSMISSION_PACKAGE_ATTR;
+
+//
+// The information of multi portions of payload it is // splitted
+according to transport interface Maximum // Transfer Unit.
+typedef struct {
+  UINT16 NumberOfPackages; ///< Number of 
packages in MultiPackages.
+  MANAGEABILITY_TRANSMISSION_PACKAGE_ATTRMultiPackages[];
+} MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES;
+
 /**
   Helper function returns the human readable name of Manageability 
specification.

@@ -90,4 +106,86 @@ HelperInitManageabilityTransport (
   OUT MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS *TransportAdditionalStatus 
OPTIONAL
   );

+/**
+  This function splits payload into multiple packages according to
+  the given transport interface Maximum Transfer Unit (MTU).
+
+  @param[in]  PreambleSize The additional data size precedes
+   each package.
+  @param[in]  PostambleSizeThe additional data size succeeds
+   each package.
+  @param[in]  Payload  Pointer to payload.
+  @param[in]  PayloadSize  Payload size in byte.
+  @param[in]  MaximumTransferUnit  MTU of transport interface.
+  @param[out] MultiplePackages Pointer to receive
+   MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES
+   structure. Caller has to free the memory
+   allocated for 
MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES.
+
+  @retval   EFI_SUCCESS  MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES 
structure
+ is returned successfully.
+  @retval   EFI_OUT_OF_RESOURCE  Not enough resource to create
+ MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES 
structure.
+**/
+EFI_STATUS
EFIAPI missing, is it intentional?
+HelperManageabilitySplitPayload (
+  IN UINT16  PreambleSize,
+  IN UINT16  PostambleSize,
+  IN UINT8   *Payload,
+  IN UINT32  PayloadSize,
+  IN UINT32  MaximumTransferUnit,
+  OUT MANAGEABILITY_TRANSMISSION_MULTI_PACKAGES  **MultiplePackages
+  );
+
+/**
+  This function generates CRC8 with given polynomial.
+
+  @param[in]  Polynomial   Polynomial in 8-bit.
+  @param[in]  CrcInitialValue  CRC initial value.
+  @param[in]  BufferStart  Pointer to buffer starts the CRC calculation.
+  @param[in]  BufferSize   Size of buffer.
+
+  @retval  UINT8 CRC value.
+**/
+UINT8
EFIAPI is missing, its common header file.
+HelperManageabilityGenerateCrc8 (
+  IN UINT8   Polynomial,
+  IN UINT8   CrcInitialValue,
+  IN UINT8   *BufferStart,
+  IN 

Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib library

2023-04-18 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
From open-source code I can see OVMF still implements 
SmmCpuFeaturesReadSaveStateRegister.
Hence, we can't directly use SmramSaveStateReadRegister in PiSmmCpuDxe driver,
until we implement the MmSaveStateLib for Ovmf.
I think it's better to keep the code as it is, so that we will not break any 
open-source or closed-source project.

Thanks
AbduL


From: Ni, Ray 
Sent: 11 April 2023 18:19
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io; kra...@redhat.com
Cc: Grimes, Paul ; Kirkendall, Garrett 
; Chang, Abner ; Dong, Eric 
; Kumar, Rahul R ; Ard Biesheuvel 
; Yao, Jiewen ; Justen, Jordan 
L 
Subject: Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib 
library


[AMD Official Use Only - General]

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

yes

thanks,
ray

From: Attar, AbdulLateef (Abdul Lateef) 
mailto:abdullateef.at...@amd.com>>
Sent: Tuesday, April 11, 2023 7:17:03 PM
To: Ni, Ray mailto:ray...@intel.com>>; 
devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>; 
kra...@redhat.com 
mailto:kra...@redhat.com>>
Cc: Grimes, Paul mailto:paul.gri...@amd.com>>; Kirkendall, 
Garrett mailto:garrett.kirkend...@amd.com>>; Chang, 
Abner mailto:abner.ch...@amd.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>; Kumar, Rahul R 
mailto:rahul.r.ku...@intel.com>>; Ard Biesheuvel 
mailto:ardb+tianoc...@kernel.org>>; Yao, Jiewen 
mailto:jiewen@intel.com>>; Justen, Jordan L 
mailto:jordan.l.jus...@intel.com>>
Subject: RE: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib 
library

[AMD Official Use Only - General]

Hi Ray,
You mean directly call the SmramSaveStateReadRegister instead of below 
code from edk2/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c ?

  Status = SmmCpuFeaturesReadSaveStateRegister (CpuIndex, Register, Width, 
Buffer);
  if (Status == EFI_UNSUPPORTED) {
Status = SmramSaveStateReadRegister (CpuIndex, Register, Width, Buffer);
  }

Thanks
AbduL

-Original Message-
From: Ni, Ray mailto:ray...@intel.com>>
Sent: 11 April 2023 15:40
To: devel@edk2.groups.io; 
kra...@redhat.com; Attar, AbdulLateef (Abdul Lateef) 
mailto:abdullateef.at...@amd.com>>
Cc: Attar, AbdulLateef (Abdul Lateef) 
mailto:abdullateef.at...@amd.com>>; Grimes, Paul 
mailto:paul.gri...@amd.com>>; Kirkendall, Garrett 
mailto:garrett.kirkend...@amd.com>>; Chang, Abner 
mailto:abner.ch...@amd.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>; Kumar, Rahul R 
mailto:rahul.r.ku...@intel.com>>; Ard Biesheuvel 
mailto:ardb+tianoc...@kernel.org>>; Yao, Jiewen 
mailto:jiewen@intel.com>>; Justen, Jordan L 
mailto:jordan.l.jus...@intel.com>>
Subject: RE: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib 
library

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


Gerd,
I am asking Abdul to directly call SaveStateLib from CpuSmm driver.
I don't think SmmCpuFeaturesLib should be in the middle of CpuSmm driver and 
SaveStateLib regarding the save state access.

Thanks,
Ray

> -Original Message-
> From: devel@edk2.groups.io 
> mailto:devel@edk2.groups.io>> On Behalf Of Gerd
> Hoffmann
> Sent: Tuesday, April 11, 2023 5:43 PM
> To: Abdul Lateef Attar mailto:abdat...@amd.com>>
> Cc: devel@edk2.groups.io; Abdul Lateef Attar
> mailto:abdullateef.at...@amd.com>>; Paul Grimes 
> mailto:paul.gri...@amd.com>>;
> Garrett Kirkendall 
> mailto:garrett.kirkend...@amd.com>>; Abner Chang
> mailto:abner.ch...@amd.com>>; Dong, Eric 
> mailto:eric.d...@intel.com>>; Ni, Ray
> mailto:ray...@intel.com>>; Kumar, Rahul R 
> mailto:rahul.r.ku...@intel.com>>; Ard
> Biesheuvel mailto:ardb+tianoc...@kernel.org>>; 
> Yao, Jiewen
> mailto:jiewen@intel.com>>; Justen, Jordan L 
> mailto:jordan.l.jus...@intel.com>>
> Subject: Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses
> SmmSmramSaveStateLib library
>
> > Uses new SmmSmramSaveStateLib library, which fix the CI failure.
>
> What is the exact failure you are seeing?
>
> > +
> SmmSmramSaveStateLib|UefiCpuPkg/Library/SmmSmramSaveStateLib/Intel
> SmmSmramSaveStateLib.inf
>
> This should be the AMD version.  KVM uses the AMD smram state.
>
> Also: OvmfPkg/Library/SmmCpuFeaturesLib should be updated to use
> actually use the new SmmSmramSaveStateLib library, and once this has
> been done it should be possible to remove
> OvmfPkg/Include/Register/QemuSmramSaveStateMap.h
>
> take care,
>   Gerd
>
>
>
> 
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103179): https://edk2.groups.io/g/devel/message/103179
Mute This Topic: https://groups.io/mt/98172964/21656
Group Owner: 

Re: [edk2-devel] [edk2-platforms][PATCH V2 2/3] ManageabilityPkg: Use SMBUS I2C instead of I2C

2023-04-18 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 17 April 2023 18:26
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH V2 2/3] ManageabilityPkg: Use SMBUS I2C instead 
of I2C

From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec | 10 +-
 .../BaseManageabilityTransportHelper.inf   |  2 +-
 .../BaseManageabilityTransportHelper.c | 14 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 9a930d3e4b..3d279ef033 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -32,13 +32,13 @@
   # Manageability Transport Interface type
   #
   # Manageability Transport KCS
-  gManageabilityTransportKcsGuid= { 0x5A6E64E9, 0xFD47, 0x4086, { 0xAA, 
0xB0, 0x7A, 0x5F, 0xD7, 0x6B, 0x02, 0x2E } }
-  # Manageability Transport I2C
-  gManageabilityTransportI2CGuid= { 0x5B174658, 0x8263, 0x4CB8, { 0xA0, 
0x0F, 0xD6, 0x82, 0xE6, 0xBC, 0x74, 0x93 } }
+  gManageabilityTransportKcsGuid  = { 0x5A6E64E9, 0xFD47, 0x4086, { 0xAA, 
0xB0, 0x7A, 0x5F, 0xD7, 0x6B, 0x02, 0x2E } }
+  # Manageability Transport SMBUS I2C
+  gManageabilityTransportSmbusI2cGuid = { 0x5B174658, 0x8263, 0x4CB8, { 0xA0, 
0x0F, 0xD6, 0x82, 0xE6, 0xBC, 0x74, 0x93 } }
   # Manageability Transport PCI VDM
-  gManageabilityTransportPciVdmGuid = { 0x388021A7, 0xFB59, 0x4811, { 0x9D, 
0xA7, 0xD5, 0x63, 0x7D, 0x04, 0xA7, 0x2F } }
+  gManageabilityTransportPciVdmGuid   = { 0x388021A7, 0xFB59, 0x4811, { 0x9D, 
0xA7, 0xD5, 0x63, 0x7D, 0x04, 0xA7, 0x2F } }
   # Manageability Transport MCTP
-  gManageabilityTransportMctpGuid   = { 0x6798448D, 0x1200, 0x4577, { 0x82, 
0x50, 0xA9, 0x83, 0xBA, 0x2B, 0x45, 0xD9 } }
+  gManageabilityTransportMctpGuid = { 0x6798448D, 0x1200, 0x4577, { 0x82, 
0x50, 0xA9, 0x83, 0xBA, 0x2B, 0x45, 0xD9 } }

   # Manageability Protocol Specification
   #
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
index 95c3362ddb..5447954144 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
@@ -32,7 +32,7 @@

 [Guids]
   gManageabilityTransportKcsGuid
-  gManageabilityTransportI2CGuid
+  gManageabilityTransportSmbusI2cGuid
   gManageabilityTransportPciVdmGuid
   gManageabilityTransportMctpGuid
   gManageabilityProtocolIpmiGuid
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
index 81da209764..c3f35b7beb 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
@@ -15,13 +15,13 @@
 // Make sure the global variables added here should be unchangable.
 //
 MANAGEABILITY_SPECIFICATION_NAME  ManageabilitySpecNameTable[] = {
-  { ,L"KCS" },
-  { ,L"I2C" },
-  { , L"PCI VDM" },
-  { ,   L"MCTP"},
-  { ,L"IPMI"},
-  { ,L"MCTP"},
-  { ,L"PLDM"}
+  { , L"KCS"  },
+  { ,L"SMBUS I2C"},
+  { ,  L"PCI VDM"  },
+  { ,L"MCTP" },
+  { , L"IPMI" },
+  { , L"MCTP" },
+  { , L"PLDM" }
 };

 UINT16  mManageabilitySpecNum = sizeof (ManageabilitySpecNameTable)/ sizeof 
(MANAGEABILITY_SPECIFICATION_NAME);
--
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH v4 3/3] Maintainers.txt: Adds AMD/AmdMinBoardPkg maintainers

2023-04-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi @Ard Biesheuvel , @Leif Lindholm, @Michael D Kinney,
I had renamed the folder from MinBoardPkg to AmdMinBoardPkg, could you 
please review it.
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 03 April 2023 16:53
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Attar, 
AbdulLateef (Abdul Lateef) ; Ard Biesheuvel 
; Leif Lindholm ; Chang, 
Abner ; Michael D Kinney 
Subject: [edk2-devel] [PATCH v4 3/3] Maintainers.txt: Adds AMD/AmdMinBoardPkg 
maintainers

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


From: Abdul Lateef Attar 

Adds maintainers for AMD/AmdMinBoardPkg

Signed-off-by: Abdul Lateef Attar 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Abner Chang 
Cc: Michael D Kinney 
---
 Maintainers.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index 1871ffaa26bd..24918d1c6ede 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -91,6 +91,11 @@ F: Silicon/AMD/Styx/
 M: Ard Biesheuvel 
 M: Leif Lindholm 

+AMD MinBoard package for MinPlatformPkg
+F: Platform/AMD/AmdMinBoardPkg
+M: Abner Chang 
+M: Abdul Lateef Attar 
+
 Ampere Computing
 F: Platform/Ampere
 F: Silicon/Ampere
--
2.25.1








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




Re: [edk2-devel] [PATCH v8 2/9] UefiCpuPkg: Adds SmmSmramSaveStateLib library class

2023-04-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Thanks for review comment, will update accordingly.

-Original Message-
From: Ni, Ray 
Sent: 11 April 2023 13:21
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Grimes, Paul ; Kirkendall, Garrett 
; Chang, Abner ; Dong, Eric 
; Kumar, Rahul R ; Gerd Hoffmann 

Subject: RE: [edk2-devel] [PATCH v8 2/9] UefiCpuPkg: Adds SmmSmramSaveStateLib 
library class

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


> +  ## @libraryclass   Provides functions for manipulating Smram savestate
> registers.
> +  SmmSmramSaveSateLib|Include/Library/SmmSmramSaveStateLib.h

1. Can you please rename the lib class to MmSaveStateLib? So the lib can be 
potentially linked with standalone MM CPU driver.
2. Also the lib header file name can be "MmSaveStateLib.h".

> +EFI_STATUS
> +EFIAPI
> +SmramSaveStateReadRegister (
3. The API can be MmSaveStateReadRegister().


> +  IN  UINTNCpuIndex,
> +  IN  EFI_SMM_SAVE_STATE_REGISTER  Register,
4. "EFI_MM_SAVE_STATE_REGISTER"



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




Re: [edk2-devel] [edk2-platforms][PATCH 2/3] ManageabilityPkg: Use SMBUS I2C instead of I2C

2023-04-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Abner,
I think EDK2 uses the below naming convention for variables which are 
acronyms.
First letter is capitalized, and rest all are smaller.
Its better to rename below variables from I2C to 
I2c.

-Original Message-
From: Chang, Abner  
Sent: Saturday, April 15, 2023 5:27 PM
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 2/3] ManageabilityPkg: Use SMBUS I2C instead of 
I2C

From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec | 10 +-
 .../BaseManageabilityTransportHelper.inf   |  2 +-
 .../BaseManageabilityTransportHelper.c | 14 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 9a930d3e4b..3656190a70 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -32,13 +32,13 @@
   # Manageability Transport Interface type
   #
   # Manageability Transport KCS
-  gManageabilityTransportKcsGuid= { 0x5A6E64E9, 0xFD47, 0x4086, { 0xAA, 
0xB0, 0x7A, 0x5F, 0xD7, 0x6B, 0x02, 0x2E } }
-  # Manageability Transport I2C
-  gManageabilityTransportI2CGuid= { 0x5B174658, 0x8263, 0x4CB8, { 0xA0, 
0x0F, 0xD6, 0x82, 0xE6, 0xBC, 0x74, 0x93 } }
Change to I2c
+  gManageabilityTransportKcsGuid  = { 0x5A6E64E9, 0xFD47, 0x4086, { 0xAA, 
0xB0, 0x7A, 0x5F, 0xD7, 0x6B, 0x02, 0x2E } }
+  # Manageability Transport SMBUS I2C
+  gManageabilityTransportSmbusI2CGuid = { 0x5B174658, 0x8263, 0x4CB8, { 0xA0, 
0x0F, 0xD6, 0x82, 0xE6, 0xBC, 0x74, 0x93 } }
Change to I2c
   # Manageability Transport PCI VDM
-  gManageabilityTransportPciVdmGuid = { 0x388021A7, 0xFB59, 0x4811, { 0x9D, 
0xA7, 0xD5, 0x63, 0x7D, 0x04, 0xA7, 0x2F } }
+  gManageabilityTransportPciVdmGuid   = { 0x388021A7, 0xFB59, 0x4811, { 0x9D, 
0xA7, 0xD5, 0x63, 0x7D, 0x04, 0xA7, 0x2F } }
   # Manageability Transport MCTP
-  gManageabilityTransportMctpGuid   = { 0x6798448D, 0x1200, 0x4577, { 0x82, 
0x50, 0xA9, 0x83, 0xBA, 0x2B, 0x45, 0xD9 } }
+  gManageabilityTransportMctpGuid = { 0x6798448D, 0x1200, 0x4577, { 0x82, 
0x50, 0xA9, 0x83, 0xBA, 0x2B, 0x45, 0xD9 } }
 
   # Manageability Protocol Specification
   #
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
index 95c3362ddb..8876e36480 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
@@ -32,7 +32,7 @@
 
 [Guids]
   gManageabilityTransportKcsGuid
-  gManageabilityTransportI2CGuid
+  gManageabilityTransportSmbusI2CGuid
Change to I2c
   gManageabilityTransportPciVdmGuid
   gManageabilityTransportMctpGuid
   gManageabilityProtocolIpmiGuid
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
index 81da209764..6454f32670 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
@@ -15,13 +15,13 @@
 // Make sure the global variables added here should be unchangable.
 //
 MANAGEABILITY_SPECIFICATION_NAME  ManageabilitySpecNameTable[] = {
-  { ,L"KCS" },
-  { ,L"I2C" },
-  { , L"PCI VDM" },
-  { ,   L"MCTP"},
-  { ,L"IPMI"},
-  { ,L"MCTP"},
-  { ,L"PLDM"}
+  { , L"KCS"  },
+  { ,L"SMBUS I2C"},
Change to I2c
+  { ,  L"PCI VDM"  },
+  { ,L"MCTP" },
+  { , L"IPMI" },
+  { , L"MCTP" },
+  { , L"PLDM" }
 };
 
 UINT16  mManageabilitySpecNum = sizeof (ManageabilitySpecNameTable)/ sizeof 
(MANAGEABILITY_SPECIFICATION_NAME);
-- 
2.37.1.windows.1


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




Re: [edk2-devel] [edk2-platforms][PATCH 1/3] ManageabilityPkg/IpmiPpi: Fix duplicate library instance

2023-04-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner  
Sent: Saturday, April 15, 2023 5:27 PM
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/3] ManageabilityPkg/IpmiPpi: Fix duplicate 
library instance

From: Abner Chang 

Remove duplicate library instance in [LibraryClass] section.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf   | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
index 8d59b46d48..3f839625ac 100644
--- a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.in
+++ f
@@ -37,7 +37,6 @@
   ManageabilityTransportHelperLib
   ManageabilityTransportLib
   PeimEntryPoint
-  ManageabilityTransportLib
 
 [Ppis]
   gPeiIpmiPpiGuid   # PPI ALWAYS PRODUCED
--
2.37.1.windows.1


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




Re: [edk2-devel] [edk2-platforms][PATCH 3/3] ManageabilityPkg: Support AARCH64

2023-04-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner  
Sent: Saturday, April 15, 2023 5:27 PM
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 3/3] ManageabilityPkg: Support AARCH64

From: Abner Chang 

Add AARCH64 support in Manageability.dsc

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../ManageabilityPkg/Include/Dsc/Manageability.dsc| 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 0d868fdf4a..7f8d8df3f0 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -15,11 +15,18 @@
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+  ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
 
-[Components.IA32]
+[LibraryClasses.AARCH64.PEIM]
+  
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
+
+[Components.IA32, Components.AARCH64]
   ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 
-[Components.X64]
+[Components.X64, Components.AARCH64]
   ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
+
+[Components.X64]
   ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
 
-- 
2.37.1.windows.1


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




Re: [edk2-devel] [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and SmmSmramSaveStateLib

2023-04-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Mike, Abner,
Patch 5/9 is blank implementation of SmmCpuFeaturesLib library class.
Whereas patch 6/9 is actual implementation of the library for AMD processor 
family.
I had separated in two different patches for easy to review.
Thanks
AbduL

-Original Message-
From: Chang, Abner 
Sent: 11 April 2023 06:38
To: Kinney, Michael D ; Attar, AbdulLateef (Abdul 
Lateef) ; devel@edk2.groups.io
Cc: Grimes, Paul ; Kirkendall, Garrett 
; Dong, Eric ; Ni, Ray 
; Kumar, Rahul R ; Gerd Hoffmann 
; Gao, Liming ; Liu, Zhiguang 
; Ard Biesheuvel ; Yao, 
Jiewen ; Justen, Jordan L 
Subject: RE: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and SmmSmramSaveStateLib

[AMD Official Use Only - General]

Hi Mike,
I think 5/9 was added for those functions AMD has no implementation as the 
initial commit, while 6/9 was updated for the functions with AMD 
implementations.
@Attar, AbdulLateef (Abdul Lateef)can confirm this.

Thanks
Abner

> -Original Message-
> From: Kinney, Michael D 
> Sent: Tuesday, April 11, 2023 12:29 AM
> To: Attar, AbdulLateef (Abdul Lateef) ;
> devel@edk2.groups.io
> Cc: Grimes, Paul ; Kirkendall, Garrett
> ; Chang, Abner ;
> Dong, Eric ; Ni, Ray ; Kumar,
> Rahul R ; Gerd Hoffmann ;
> Gao, Liming ; Liu, Zhiguang
> ; Ard Biesheuvel ;
> Yao, Jiewen ; Justen, Jordan L
> ; Kinney, Michael D
> 
> Subject: RE: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and
> SmmSmramSaveStateLib
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Is there a reason why patches 5 and 6 where not combined?
>
> Mike
>
> > -Original Message-
> > From: Abdul Lateef Attar 
> > Sent: Monday, April 10, 2023 4:10 AM
> > To: devel@edk2.groups.io
> > Cc: Abdul Lateef Attar ; Paul Grimes
> > ; Garrett Kirkendall
> > ; Abner Chang ;
> Dong,
> > Eric ; Ni, Ray ; Kumar, Rahul
> > R ; Gerd Hoffmann ;
> Kinney,
> > Michael D ; Gao, Liming
> > ; Liu, Zhiguang ;
> > Ard Biesheuvel ; Yao, Jiewen
> > ; Justen, Jordan L 
> > Subject: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and
> > SmmSmramSaveStateLib
> >
> > PR: https://github.com/tianocore/edk2/pull/4258
> >
> > V8 delta changes:
> >Addressed review comments from Abner,
> >Fix the whitespace error.
> >Seperate the Ovmf changes to another patch
> > V7 delta changes:
> >Adds SmmSmramSaveStateLib for Intel processor.
> >Integrate SmmSmramSaveStateLib library.
> > V6 delta changes:
> >Addressed review comments for Ray NI.
> >removed unnecessary EFIAPI.
> > V5 delta changes:
> >rebase to master branch.
> >updated Reviewed-by
> > V4 delta changes:
> >   rebase to master branch.
> >   added reviewed-by.
> > V3 delta changes:
> >   Addressed review comments from Abner chang.
> >   Re-arranged patch order.
> >
> > Cc: Paul Grimes 
> > Cc: Garrett Kirkendall 
> > Cc: Abner Chang 
> > Cc: Eric Dong 
> > Cc: Ray Ni 
> > Cc: Rahul Kumar 
> > Cc: Gerd Hoffmann 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Zhiguang Liu 
> > Cc: Ard Biesheuvel 
> > Cc: Jiewen Yao 
> > Cc: Jordan Justen 
> > Cc: Abdul Lateef Attar 
> >
> > Abdul Lateef Attar (9):
> >   MdePkg: Adds AMD SMRAM save state map
> >   UefiCpuPkg: Adds SmmSmramSaveStateLib library class
> >   UefiCpuPkg: Implements SmmSmramSaveStateLib library class
> >   UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code
> >   UefiCpuPkg: Initial implementation of AMD's SmmCpuFeaturesLib
> >   UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family
> >   UefiCpuPkg: Implements SmmSmramSaveStateLib for Intel
> >   UefiCpuPkg: Uses SmmSmramSaveStateLib library
> >   OvmfPkg: Uses SmmSmramSaveStateLib library
> >
> >  UefiCpuPkg/UefiCpuPkg.dec |   4 +
> >  OvmfPkg/OvmfPkgIa32X64.dsc|   2 +
> >  UefiCpuPkg/UefiCpuPkg.dsc |  15 +
> >  .../AmdSmmCpuFeaturesLib.inf  |  38 ++
> >  .../AmdSmmSmramSaveStateLib.inf   |  28 +
> >  .../IntelSmmSmramSaveStateLib.inf |  28 +
> >  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf  |   2 +
> >  .../Include/Register/Amd/SmramSaveStateMap.h  | 194 +++
> >  .../Include/Library/SmmSmramSaveStateLib.h|  70 +++
> >  .../SmmSmramSaveStateLib/SmramSaveState.h | 100 
> >  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h|   2 +
> >  .../SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c  | 445
> 
> >  .../IntelSmmCpuFeaturesLib.c  | 128 +
> >  .../SmmCpuFeaturesLibCommon.c | 128 -
> >  .../SmmSmramSaveStateLib/AmdSmramSaveState.c  | 286 ++
> >  .../IntelSmramSaveState.c | 359 +
> >  .../SmramSaveStateCommon.c| 232 
> >  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c|   5 +-
> >  UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c| 500 +
> -
> >  MdePkg/MdePkg.ci.yaml |   4 +-
> >  20 

Re: [edk2-devel] [PATCH v8 1/9] MdePkg: Adds AMD SMRAM save state map

2023-04-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
I added the prefix "_" to be in align with Intel's SmramSaveStateMap.h,
so that it looks similar and suppose in future if there is any common 
functionality requires then
we can easily add to the common files.
Thanks
AbduL

-Original Message-
From: Ni, Ray 
Sent: 11 April 2023 13:08
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Kinney, Michael D 
Cc: Grimes, Paul ; Kirkendall, Garrett 
; Chang, Abner ; Gao, Liming 
; Liu, Zhiguang 
Subject: RE: [edk2-devel] [PATCH v8 1/9] MdePkg: Adds AMD SMRAM save state map

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


The patch looks good in general.
@Kinney, Michael D, I think it's ok to use "SmramSaveStateMap.h" instead of 
"MmramSaveStateMap.h" because it matches to the CPU spec.
Do you agree?

"MM" is more like a general term that applies to all archs, X86, ARM, etc.

Abdul, just curious why do you add prefix "_" for some of the fields? I am ok 
if it matches to the AMD CPU spec.

Thanks,
Ray

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abdul
> Lateef Attar via groups.io
> Sent: Monday, April 10, 2023 7:10 PM
> To: devel@edk2.groups.io
> Cc: Abdul Lateef Attar ; Paul Grimes
> ; Garrett Kirkendall
> ; Abner Chang ;
> Kinney, Michael D ; Gao, Liming
> ; Liu, Zhiguang 
> Subject: [edk2-devel] [PATCH v8 1/9] MdePkg: Adds AMD SMRAM save state
> map
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182
>
> Adds an SMM SMRAM save-state map for AMD processors.
> SMRAM save state maps for the AMD processor family are now supported.
>
> Save state map structure is added based on
> AMD64 Architecture Programmer's Manual, Volume 2, Section 10.2.
>
> The AMD legacy save state map for 32-bit architecture is defined.
> The AMD64 save state map for 64-bit architecture is defined.
>
> Also added Amd/SmramSaveStateMap.h to IgnoreFiles of EccCheck, because
> structures defined in this file are derived from
> Intel/SmramSaveStateMap.h.
>
> Cc: Paul Grimes 
> Cc: Garrett Kirkendall 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
>
> Signed-off-by: Abdul Lateef Attar 
> Reviewed-by: Abner Chang 
> Reviewed-by: Michael D Kinney 
> ---
>  .../Include/Register/Amd/SmramSaveStateMap.h  | 194
> ++
>  MdePkg/MdePkg.ci.yaml |   4 +-
>  2 files changed, 197 insertions(+), 1 deletion(-)  create mode 100644
> MdePkg/Include/Register/Amd/SmramSaveStateMap.h
>
> diff --git a/MdePkg/Include/Register/Amd/SmramSaveStateMap.h
> b/MdePkg/Include/Register/Amd/SmramSaveStateMap.h
> new file mode 100644
> index ..0607d2a19145
> --- /dev/null
> +++ b/MdePkg/Include/Register/Amd/SmramSaveStateMap.h
> @@ -0,0 +1,194 @@
> +/** @file
> +  AMD SMRAM Save State Map Definitions.
> +
> +  SMRAM Save State Map definitions based on contents of the
> +AMD64 Architecture Programmer Manual:
> +Volume 2, System Programming, Section 10.2 SMM Resources
> +
> +  Copyright (c) 2015 - 2019, Intel Corporation. All rights
> + reserved.  Copyright (C) 2023 Advanced Micro Devices, Inc. All
> + rights reserved .
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef AMD_SMRAM_SAVE_STATE_MAP_H_
> +#define AMD_SMRAM_SAVE_STATE_MAP_H_
> +
> +///
> +/// Default SMBASE address
> +///
> +#define SMM_DEFAULT_SMBASE  0x3
> +
> +///
> +/// Offset of SMM handler from SMBASE /// #define SMM_HANDLER_OFFSET
> +0x8000
> +
> +// SMM-Revision Identifier for AMD64 Architecture.
> +#define AMD_SMM_MIN_REV_ID_X64  0x30064
> +
> +#pragma pack (1)
> +
> +///
> +/// 32-bit SMRAM Save State Map
> +///
> +typedef struct {
> +  // Padded an extra 0x200 bytes to match Intel/EDK2
> +  UINT8 Reserved[0x200]; // fc00h
> +  // AMD Save State area starts @ 0xfe00
> +  UINT8 Reserved1[0xf8]; // fe00h
> +  UINT32SMBASE;  // fef8h
> +  UINT32SMMRevId;// fefch
> +  UINT16IORestart;   // ff00h
> +  UINT16AutoHALTRestart; // ff02h
> +  UINT8 Reserved2[0x84]; // ff04h
> +  UINT32GDTBase; // ff88h
> +  UINT64Reserved3;   // ff8ch
> +  UINT32IDTBase; // ff94h
> +  UINT8 Reserved4[0x10]; // ff98h
> +  UINT32_ES; // ffa8h
> +  UINT32_CS; // ffach
> +  UINT32_SS; // ffb0h
> +  UINT32_DS; // ffb4h
> +  UINT32_FS; // ffb8h
> +  UINT32_GS; // ffbch
> +  UINT32LDTBase; // ffc0h
> +  UINT32_TR; // ffc4h
> +  UINT32_DR7;// ffc8h
> +  UINT32_DR6;// ffcch
> +  UINT32_EAX;// ffd0h
> +  UINT32_ECX;// ffd4h
> +  UINT32_EDX;// ffd8h
> +  UINT32_EBX;// ffdch
> +  UINT32_ESP;// ffe0h
> +  UINT32_EBP;// ffe4h
> +  UINT32_ESI;// 

Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib library

2023-04-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Gerd,
I think CI was failing with the message " SmmSmramSaveStateLib library 
not found", I didn't preserve the CI log.
Thanks
Abdul

-Original Message-
From: Gerd Hoffmann 
Sent: 11 April 2023 15:13
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Grimes, Paul ; Kirkendall, 
Garrett ; Chang, Abner ; Eric 
Dong ; Ray Ni ; Rahul Kumar 
; Ard Biesheuvel ; Jiewen 
Yao ; Jordan Justen 
Subject: Re: [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib library

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


> Uses new SmmSmramSaveStateLib library, which fix the CI failure.

What is the exact failure you are seeing?

> +
> + SmmSmramSaveStateLib|UefiCpuPkg/Library/SmmSmramSaveStateLib/IntelSm
> + mSmramSaveStateLib.inf

This should be the AMD version.  KVM uses the AMD smram state.

Also: OvmfPkg/Library/SmmCpuFeaturesLib should be updated to use actually use 
the new SmmSmramSaveStateLib library, and once this has been done it should be 
possible to remove OvmfPkg/Include/Register/QemuSmramSaveStateMap.h

take care,
  Gerd



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




Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib library

2023-04-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
You mean directly call the SmramSaveStateReadRegister instead of below 
code from edk2/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c ?

  Status = SmmCpuFeaturesReadSaveStateRegister (CpuIndex, Register, Width, 
Buffer);
  if (Status == EFI_UNSUPPORTED) {
Status = SmramSaveStateReadRegister (CpuIndex, Register, Width, Buffer);
  }

Thanks
AbduL

-Original Message-
From: Ni, Ray 
Sent: 11 April 2023 15:40
To: devel@edk2.groups.io; kra...@redhat.com; Attar, AbdulLateef (Abdul Lateef) 

Cc: Attar, AbdulLateef (Abdul Lateef) ; Grimes, Paul 
; Kirkendall, Garrett ; Chang, 
Abner ; Dong, Eric ; Kumar, Rahul R 
; Ard Biesheuvel ; Yao, 
Jiewen ; Justen, Jordan L 
Subject: RE: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib 
library

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


Gerd,
I am asking Abdul to directly call SaveStateLib from CpuSmm driver.
I don't think SmmCpuFeaturesLib should be in the middle of CpuSmm driver and 
SaveStateLib regarding the save state access.

Thanks,
Ray

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Gerd
> Hoffmann
> Sent: Tuesday, April 11, 2023 5:43 PM
> To: Abdul Lateef Attar 
> Cc: devel@edk2.groups.io; Abdul Lateef Attar
> ; Paul Grimes ;
> Garrett Kirkendall ; Abner Chang
> ; Dong, Eric ; Ni, Ray
> ; Kumar, Rahul R ; Ard
> Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L 
> Subject: Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses
> SmmSmramSaveStateLib library
>
> > Uses new SmmSmramSaveStateLib library, which fix the CI failure.
>
> What is the exact failure you are seeing?
>
> > +
> SmmSmramSaveStateLib|UefiCpuPkg/Library/SmmSmramSaveStateLib/Intel
> SmmSmramSaveStateLib.inf
>
> This should be the AMD version.  KVM uses the AMD smram state.
>
> Also: OvmfPkg/Library/SmmCpuFeaturesLib should be updated to use
> actually use the new SmmSmramSaveStateLib library, and once this has
> been done it should be possible to remove
> OvmfPkg/Include/Register/QemuSmramSaveStateMap.h
>
> take care,
>   Gerd
>
>
>
> 
>



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




Re: [edk2-devel] [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and SmmSmramSaveStateLib

2023-04-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Got it, will merge these two patches(5/9 and 6/9) into single patch.

-Original Message-
From: Kinney, Michael D 
Sent: 12 April 2023 00:19
To: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; devel@edk2.groups.io
Cc: Grimes, Paul ; Kirkendall, Garrett 
; Dong, Eric ; Ni, Ray 
; Kumar, Rahul R ; Gerd Hoffmann 
; Gao, Liming ; Liu, Zhiguang 
; Ard Biesheuvel ; Yao, 
Jiewen ; Justen, Jordan L ; 
Kinney, Michael D 
Subject: RE: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and SmmSmramSaveStateLib

[AMD Official Use Only - General]

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


Thanks for the feedback Abdul.  We usually do not see this in the history for a 
new lib instance.

I know we recommend developers start from a template of a lib instance if it is 
available and then fill in the specific implementation, but those 2 steps do 
not go into commit history.

Mike

> -Original Message-
> From: Attar, AbdulLateef (Abdul Lateef) 
> Sent: Monday, April 10, 2023 9:17 PM
> To: Chang, Abner ; Kinney, Michael D
> ; devel@edk2.groups.io
> Cc: Grimes, Paul ; Kirkendall, Garrett
> ; Dong, Eric ; Ni,
> Ray ; Kumar, Rahul R ; Gerd
> Hoffmann ; Gao, Liming ;
> Liu, Zhiguang ; Ard Biesheuvel
> ; Yao, Jiewen ;
> Justen, Jordan L 
> Subject: RE: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and
> SmmSmramSaveStateLib
>
> [AMD Official Use Only - General]
>
> Hi Mike, Abner,
> Patch 5/9 is blank implementation of SmmCpuFeaturesLib library class.
> Whereas patch 6/9 is actual implementation of the library for AMD processor 
> family.
> I had separated in two different patches for easy to review.
> Thanks
> AbduL
>
> -Original Message-
> From: Chang, Abner 
> Sent: 11 April 2023 06:38
> To: Kinney, Michael D ; Attar, AbdulLateef
> (Abdul Lateef) ; devel@edk2.groups.io
> Cc: Grimes, Paul ; Kirkendall, Garrett
> ; Dong, Eric ; Ni,
> Ray ; Kumar, Rahul R ; Gerd
> Hoffmann ; Gao, Liming ;
> Liu, Zhiguang ; Ard Biesheuvel
> ; Yao, Jiewen ;
> Justen, Jordan L 
> Subject: RE: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and
> SmmSmramSaveStateLib
>
> [AMD Official Use Only - General]
>
> Hi Mike,
> I think 5/9 was added for those functions AMD has no implementation as
> the initial commit, while 6/9 was updated for the functions with AMD 
> implementations.
> @Attar, AbdulLateef (Abdul Lateef)can confirm this.
>
> Thanks
> Abner
>
> > -Original Message-
> > From: Kinney, Michael D 
> > Sent: Tuesday, April 11, 2023 12:29 AM
> > To: Attar, AbdulLateef (Abdul Lateef) ;
> > devel@edk2.groups.io
> > Cc: Grimes, Paul ; Kirkendall, Garrett
> > ; Chang, Abner ;
> > Dong, Eric ; Ni, Ray ; Kumar,
> > Rahul R ; Gerd Hoffmann
> > ; Gao, Liming ; Liu,
> > Zhiguang ; Ard Biesheuvel
> > ; Yao, Jiewen ;
> > Justen, Jordan L ; Kinney, Michael D
> > 
> > Subject: RE: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and
> > SmmSmramSaveStateLib
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Is there a reason why patches 5 and 6 where not combined?
> >
> > Mike
> >
> > > -Original Message-
> > > From: Abdul Lateef Attar 
> > > Sent: Monday, April 10, 2023 4:10 AM
> > > To: devel@edk2.groups.io
> > > Cc: Abdul Lateef Attar ; Paul Grimes
> > > ; Garrett Kirkendall
> > > ; Abner Chang ;
> > Dong,
> > > Eric ; Ni, Ray ; Kumar,
> > > Rahul R ; Gerd Hoffmann
> > > ;
> > Kinney,
> > > Michael D ; Gao, Liming
> > > ; Liu, Zhiguang
> > > ; Ard Biesheuvel
> > > ; Yao, Jiewen ;
> > > Justen, Jordan L 
> > > Subject: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and
> > > SmmSmramSaveStateLib
> > >
> > > PR: https://github.com/tianocore/edk2/pull/4258
> > >
> > > V8 delta changes:
> > >Addressed review comments from Abner,
> > >Fix the whitespace error.
> > >Seperate the Ovmf changes to another patch
> > > V7 delta changes:
> > >Adds SmmSmramSaveStateLib for Intel processor.
> > >Integrate SmmSmramSaveStateLib library.
> > > V6 delta changes:
> > >Addressed review comments for Ray NI.
> > >removed unnecessary EFIAPI.
> > > V5 delta changes:
> > >rebase to master branch.
> > >updated Reviewed-by
> > > V4 delta changes:
> > >   rebase to master branch.
> > >   added reviewed-by.
> > > V3 delta changes:
> > >   Addressed review comments from Abner chang.
> > >   Re-arranged patch order.
> > >
> > > Cc: Paul Grimes 
> > > Cc: Garrett Kirkendall 
> > > Cc: Abner Chang 
> > > Cc: Eric Dong 
> > > Cc: Ray Ni 
> > > Cc: Rahul Kumar 
> > > Cc: Gerd Hoffmann 
> > > Cc: Michael D Kinney 
> > > Cc: Liming Gao 
> > > Cc: Zhiguang Liu 
> > > Cc: Ard Biesheuvel 
> > > Cc: Jiewen Yao 
> > > Cc: Jordan Justen 
> > > Cc: Abdul Lateef Attar 
> > >
> > > Abdul Lateef Attar (9):
> > >   MdePkg: Adds AMD SMRAM save state map
> > >   UefiCpuPkg: Adds SmmSmramSaveStateLib library class
> > >   

Re: [edk2-devel] [PATCH v6 6/6] UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family

2023-04-07 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
Please see inline.
Thanks
AbduL
-Original Message-
From: Ni, Ray 
Sent: 31 March 2023 13:29
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Attar, AbdulLateef (Abdul Lateef) ; Grimes, Paul 
; Kirkendall, Garrett ; Chang, 
Abner ; Dong, Eric ; Kumar, Rahul R 

Subject: RE: [edk2-devel] [PATCH v6 6/6] UefiCpuPkg: Implements 
SmmCpuFeaturesLib for AMD Family

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


It's a bit wired that AMD version of SmmCpuFeaturesLib calls AMD version of 
SmmSmramSaveStateLib.
The question naturally becomes: why not integrate the two lib implementations 
together to avoid creating the SmmSmramSaveStateLib library class? Because I 
cannot imagine AmdSmmCpuFeaturesLib calls to IntelSmmSmramSaveStateLib.
[Abdul] Initial version of this patch series has combined implementation of 
SmmSmramSaveStateLib and AmdSmmCpuFeaturesLib, but reviewers (Abner) suggested 
to separate the save state library; So that we can implement generic library 
for both AMD and Intel.

But I like the idea of separating the SMM save state access logic out of the 
SmmCpuFeaturesLib.
Do you think CpuSmm driver calling the SmmSmramSaveStateLib is better?
[Abdul] I'll make the changes and submit the patch for the same.

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abdul
> Lateef Attar via groups.io
> Sent: Saturday, March 25, 2023 1:39 PM
> To: devel@edk2.groups.io
> Cc: Abdul Lateef Attar ; Paul Grimes
> ; Garrett Kirkendall
> ; Abner Chang ; Dong,
> Eric ; Ni, Ray ; Kumar, Rahul R
> ; Abdul Lateef Attar 
> Subject: [edk2-devel] [PATCH v6 6/6] UefiCpuPkg: Implements
> SmmCpuFeaturesLib for AMD Family
>
> From: Abdul Lateef Attar 
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182
>
> Implements interfaces to read and write save state registers of AMD's
> processor family.
> Initializes processor SMMADDR and MASK depends on PcdSmrrEnable flag.
> Program or corrects the IP once control returns from SMM.
>
> Cc: Paul Grimes 
> Cc: Garrett Kirkendall 
> Cc: Abner Chang 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Rahul Kumar 
> Signed-off-by: Abdul Lateef Attar 
> Reviewed-by: Abner Chang 
> ---
>  .../AmdSmmCpuFeaturesLib.inf  |   6 +
>  .../SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c  | 106
> +-
>  2 files changed, 109 insertions(+), 3 deletions(-)
>
> diff --git
> a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
> b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
> index 4c77efc64462..9d5b8c2e972d 100644
> --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
> +++
> b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
> @@ -31,3 +31,9 @@ [LibraryClasses]
>PcdLib
>MemoryAllocationLib
>DebugLib
> +  SmmSmramSaveStateLib
> +
> +[FeaturePcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdSmrrEnable   ## CONSUMES
> +  gUefiCpuPkgTokenSpaceGuid.PcdSmmFeatureControlEnable  ##
> CONSUMES
> +
> diff --git
> a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c
> b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c
> index c74e1a0c0c5b..af45be3e265a 100644
> --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c
> +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c
> @@ -11,6 +11,21 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  #include   #include
> 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +// EFER register LMA bit
> +#define LMA  BIT10
> +
> +// Machine Specific Registers (MSRs)
> +#define SMMADDR_ADDRESS  0xC0010112ul #define SMMMASK_ADDRESS
> +0xC0010113ul
> +#define EFER_ADDRESS 0XC080ul
> +
> +// The mode of the CPU at the time an SMI occurs STATIC UINT8
> +mSmmSaveStateRegisterLma;
>
>  /**
>Read an SMM Save State register on the target processor.  If this
> function @@ -39,7 +54,7 @@ SmmCpuFeaturesReadSaveStateRegister (
>OUT VOID *Buffer
>)
>  {
> -  return EFI_SUCCESS;
> +  return SmramSaveStateReadRegister (CpuIndex, Register, Width,
> + Buffer);
>  }
>
>  /**
> @@ -67,7 +82,7 @@ SmmCpuFeaturesWriteSaveStateRegister (
>IN CONST VOID   *Buffer
>)
>  {
> -  return EFI_SUCCESS;
> +  return SmramSaveStateWriteRegister (CpuIndex, Register, Width,
> + Buffer);
>  }
>
>  /**
> @@ -82,6 +97,13 @@ CpuFeaturesLibInitialization (
>VOID
>)
>  {
> +  UINT32  LMAValue;
> +
> +  LMAValue = (UINT32)AsmReadMsr64 (EFER_ADDRESS) & LMA;
> +  mSmmSaveStateRegisterLma =
> EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT;
> +  if (LMAValue) {
> +mSmmSaveStateRegisterLma =
> EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT;
> +  }
>  }
>
>  /**
> @@ -117,6 +139,52 @@ SmmCpuFeaturesInitializeProcessor (
>IN CPU_HOT_PLUG_DATA  *CpuHotPlugData
>)
>  {
> +  AMD_SMRAM_SAVE_STATE_MAP  *CpuState;
> +  UINT32 

Re: [edk2-devel] [PATCH v3 1/3] Platform/AMD: Adds MinBoardPkg to support MinPlatformPkg

2023-04-03 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Sean,
Renamed the AMD/MinBoardPkg to AMD/AmdMinBoardPkg and submitted the V4 
version for review.
PR: https://github.com/tianocore/edk2-platforms/pull/75
Thanks
AbduL

-Original Message-
From: Sean Brogan 
Sent: 01 April 2023 01:50
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Ard Biesheuvel ; Leif Lindholm 
; Chang, Abner ; Michael D 
Kinney 
Subject: Re: [edk2-devel] [PATCH v3 1/3] Platform/AMD: Adds MinBoardPkg to 
support MinPlatformPkg

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


Regardless of directory path I would suggest that all "Packages" have a unique 
and descriptive name.  MinBoardPkg doesn't meet that
suggestion.   If/when the edk2 CI tools run I would expect problems/odd
behavior if two packages collide in naming.

Thanks

Sean



On 3/22/2023 11:13 PM, Abdul Lateef Attar via groups.io wrote:
> Adds initial DEC and DSC file for MinBoardPkg.
> This package provides supporting modules for AMD boards to leverage
> MinPlatformPkg framework.
>
> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>   Platform/AMD/MinBoardPkg/MinBoardPkg.dec | 19 +++
>   Platform/AMD/MinBoardPkg/MinBoardPkg.dsc | 21 +
>   2 files changed, 40 insertions(+)
>   create mode 100644 Platform/AMD/MinBoardPkg/MinBoardPkg.dec
>   create mode 100644 Platform/AMD/MinBoardPkg/MinBoardPkg.dsc
>
> diff --git a/Platform/AMD/MinBoardPkg/MinBoardPkg.dec
> b/Platform/AMD/MinBoardPkg/MinBoardPkg.dec
> new file mode 100644
> index ..23d737d196a2
> --- /dev/null
> +++ b/Platform/AMD/MinBoardPkg/MinBoardPkg.dec
> @@ -0,0 +1,19 @@
> +## @file MinBoardPkg.dec
> +#  Declaration file for AMD's MinBoardPkg.
> +#
> +#  This package supports AMD processor family based board as per the
> +MinPlatform #  Arch specification.
> +#
> +#  Copyright (c) 2023, Advanced Micro Devices, Inc. All rights reserved.
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent # #  @par
> +Specification Reference:
> +#   
> -https://tianocore-docs.github.io/edk2-MinimumPlatformSpecification/draft/ 0.7
> +##
> +
> +[Defines]
> +  DEC_SPECIFICATION  = 1.27
> +  PACKAGE_NAME   = MinBoardPkg
> +  PACKAGE_GUID   = 44F9D761-9ECB-43DD-A5AC-177E5048701B
> +  PACKAGE_VERSION= 0.1
> +
> diff --git a/Platform/AMD/MinBoardPkg/MinBoardPkg.dsc
> b/Platform/AMD/MinBoardPkg/MinBoardPkg.dsc
> new file mode 100644
> index ..8c120c0649e7
> --- /dev/null
> +++ b/Platform/AMD/MinBoardPkg/MinBoardPkg.dsc
> @@ -0,0 +1,21 @@
> +## @file
> +#  MinBoardPkg.dsc
> +#
> +#  Description file for AMD MinBoardPkg # #  Copyright (c) 2023,
> +Advanced Micro Devices, Inc. All rights reserved.
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent ##
> +
> +[Defines]
> +  DSC_SPECIFICATION   = 1.30
> +  PLATFORM_GUID   = 88F8A9AE-2FA0-4D58-A6F9-05F635C05F4E
> +  PLATFORM_NAME   = MinBoardPkg
> +  PLATFORM_VERSION= 0.1
> +  OUTPUT_DIRECTORY= Build/$(PLATFORM_NAME)
> +  BUILD_TARGETS   = DEBUG | RELEASE | NOOPT
> +  SUPPORTED_ARCHITECTURES = IA32 | X64
> +
> +[Packages]
> +  MinBoardPkg/MinBoardPkg.dec
> +


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




Re: [edk2-devel] [PATCH v4 9/9] edk2-platforms: Maintainers.txt

2023-03-25 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Oram, Isaac W 
Sent: 23 March 2023 23:07
To: Leif Lindholm ; Chang, Abner 

Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Kinney, Michael D ; 
Gao, Liming ; Nickle Wang 
Subject: RE: [PATCH v4 9/9] edk2-platforms: Maintainers.txt

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


Reviewed-by: Isaac Oram 

-Original Message-
From: Leif Lindholm 
Sent: Thursday, March 23, 2023 7:46 AM
To: abner.ch...@amd.com
Cc: devel@edk2.groups.io; Abdul Lateef Attar ; Kinney, 
Michael D ; Gao, Liming ; 
Oram, Isaac W ; Nickle Wang 
Subject: Re: [PATCH v4 9/9] edk2-platforms: Maintainers.txt

On Wed, Mar 22, 2023 at 10:48:40 +0800, abner.ch...@amd.com wrote:
> From: Abner Chang 
>
> Add maintainer and reviewer of ManageabilityPkg.
>
> Signed-off-by: Abner Chang 
> Cc: Abdul Lateef Attar 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Isaac Oram 
> Cc: Nickle Wang 
> Reviewed-by: Michael D Kinney 
> Reviewed-by: Nickle Wang 
> ---
>  Maintainers.txt | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt index
> 7471913660..1871ffaa26 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -164,6 +164,13 @@ F: Features/Intel/UserInterface/
>  M: Dandan Bi 
>  R: Liming Gao 
>
> +Features/ManageabilityPkg
> +F: Features/ManageabilityPkg/
> +M: Abner Chang 
> +M: Isaac Oram 
> +R: Abdul Lateef Attar 
> +R: Nickle Wang 

Need R-b from Isaac and Abdul.
With that:
Reviewed-by: Leif Lindholm 

> +
>  Platform/Intel
>  F: Platform/Intel/
>  M: Sai Chaganty 
> --
> 2.37.1.windows.1
>


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




Re: [edk2-devel] [PATCH v4 3/9] ManageabilityPkg: Add ManageabilityTransportLib header file

2023-03-25 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Some comments inline.

-Original Message-
From: Chang, Abner 
Sent: 22 March 2023 08:19
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Nickle Wang 
; Igor Kulchytskyy ; Attar, AbdulLateef 
(Abdul Lateef) 
Subject: [PATCH v4 3/9] ManageabilityPkg: Add ManageabilityTransportLib header 
file

From: Abner Chang 

Add ManageabilityTransportLib header file to package.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   5 +
 .../Library/ManageabilityTransportLib.h   | 336 ++
 2 files changed, 341 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 71bd8a0c80..92ba4538c0 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -17,5 +17,10 @@
 [Includes]
   Include

+[LibraryClasses]
+  ##  @libraryclass Manageability Transport Library
+  #   Manageability Transport Library definitions
+  ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h
+
 [Guids]
   gManageabilityPkgTokenSpaceGuid = { 0xBDEFFF48, 0x1C31, 0x49CD, { 0xA7, 
0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } } diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
new file mode 100644
index 00..c022b4ac5c
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLi
+++ b.h
@@ -0,0 +1,336 @@
+/** @file
+
+  This file defines the manageability transport interface library and 
functions.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent **/
+
+#ifndef MANAGEABILITY_TRANSPORT_LIB_H_
+#define MANAGEABILITY_TRANSPORT_LIB_H_
+
+#define MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MAJOR  1 #define
+MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MINOR  0
+#define MANAGEABILITY_TRANSPORT_TOKEN_VERSION
((MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MAJOR << 8) |\
+
+MANAGEABILITY_TRANSPORT_TOKEN_VERSION_MINOR)
+
+typedef struct  _MANAGEABILITY_TRANSPORT_FUNCTION_V1_0  
MANAGEABILITY_TRANSPORT_FUNCTION_V1_0;
+typedef struct  _MANAGEABILITY_TRANSPORT
MANAGEABILITY_TRANSPORT;
+typedef struct  _MANAGEABILITY_TRANSPORT_TOKEN  
MANAGEABILITY_TRANSPORT_TOKEN;
+typedef struct  _MANAGEABILITY_TRANSFER_TOKEN   
MANAGEABILITY_TRANSFER_TOKEN;
+
+///
+/// Optional transport header and trailer required /// for the
+transport interface.
+///
+typedef VOID  *MANAGEABILITY_TRANSPORT_HEADER; typedef VOID
+*MANAGEABILITY_TRANSPORT_TRAILER;
+
+///
+/// The transport interface specific hardware information.
+///
+
+typedef union {
+  UINT16IoAddress16;
+  UINT32IoAddress32;
+} MANAGEABILITY_TRANSPORT_HARDWARE_IO;
+
+///
+/// Manageability KCS protocol interface hardware information.
+///
+typedef struct {
+  BOOLEANMemoryMap;
+  MANAGEABILITY_TRANSPORT_HARDWARE_IOIoBaseAddress;
+  MANAGEABILITY_TRANSPORT_HARDWARE_IOIoDataInAddress;
+  MANAGEABILITY_TRANSPORT_HARDWARE_IOIoDataOutAddress;
+  MANAGEABILITY_TRANSPORT_HARDWARE_IOIoCommandAddress;
+  MANAGEABILITY_TRANSPORT_HARDWARE_IOIoStatusAddress;
+} MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO;
+#define MANAGEABILITY_TRANSPORT_KCS_IO_MAP_IO  FALSE
+#define MANAGEABILITY_TRANSPORT_KCS_MEMORY_MAP_IO  TRUE
+
+typedef union {
+  VOID *Pointer;
+  MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO*Kcs;
+} MANAGEABILITY_TRANSPORT_HARDWARE_INFORMATION;
+
+///
+/// Additional transport interface status.
+///
+typedef UINT32 MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS;
+#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NO_ERRORS  0x
+#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_ERROR  0x0001
+#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_READ   0x0002
+#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_WRITE
+0x0004 #define
+MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NOT_AVAILABLE  0x
+
+///
+/// Additional transport interface features.
+///
+typedef UINT32 MANAGEABILITY_TRANSPORT_CAPABILITY;
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_MULTIPLE_TRANSFER_TOKENS  0x0001
+#define MANAGEABILITY_TRANSPORT_CAPABILITY_ASYNCHRONOUS_TRANSFER 0x0002
+
+///
+/// Definitions of Manageability transport interface functions.
+/// This is a union that can accommodate the new functions ///
+introduced to the Manageability transport library in the future.
+/// The new added function must has its own
+MANAGEABILITY_TRANSPORT_FUNCTION /// structure with the incremental version 
number.
+///   e.g., 

Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-22 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Abner,
That's right, Platform/AMD/MinBoardPkg will contains all 
modules/library/drivers required for AMD boards which are based on 
MinPlatformPkg framework.
Thanks
AbduL

-Original Message-
From: Chang, Abner 
Sent: 22 March 2023 15:25
To: Attar, AbdulLateef (Abdul Lateef) ; Leif 
Lindholm 
Cc: devel@edk2.groups.io; Ard Biesheuvel ; Michael D 
Kinney 
Subject: RE: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds 
AMD/BoardPkg and AMD/PlatformPkg maintainers

[AMD Official Use Only - General]



> -Original Message-
> From: Attar, AbdulLateef (Abdul Lateef) 
> Sent: Tuesday, March 21, 2023 11:01 AM
> To: Leif Lindholm 
> Cc: devel@edk2.groups.io; Chang, Abner ; Ard
> Biesheuvel ; Michael D Kinney
> 
> Subject: RE: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> AMD/BoardPkg and AMD/PlatformPkg maintainers
>
> [AMD Official Use Only - General]
>
> Hi Leif,
> AMD/BoardPkg will implements modules specific to boards(one or
> more motherboards).
> It will not contain any module specific to Platform or Silicon, which
> are part of MinPlatformPkg.
>
> How about just Min prefix?
> AMD/MinBoardPkg (I am avoiding the Amd prefix because its already in
> AMD folder).
I am good with this naming. So we will have AMD boards that leverage 
MinPlatform under MinBoardPkg. Those boards which are not Minplatform based can 
just stay under Platforms/AMD (e.g., OverdriveBoard.), is my understanding 
correct Abdul?
Abner
>
> AMD board package for MinPlatformPkg
>  F: Platform/AMD/MinBoardPkg
>  M: Maintainer1
>  M: Maintainer2
>
> Thanks
> AbduL
>
> -Original Message-
> From: Leif Lindholm 
> Sent: 20 March 2023 23:33
> To: Attar, AbdulLateef (Abdul Lateef) 
> Cc: devel@edk2.groups.io; Chang, Abner ; Ard
> Biesheuvel ; Michael D Kinney
> 
> Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> AMD/BoardPkg and AMD/PlatformPkg maintainers
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Hi Abdul,
>
> On Mon, Mar 20, 2023 at 14:09:11 +, Attar, AbdulLateef (Abdul
> Lateef)
> wrote:
> > AMD/BoardPkg will contains the modules/drivers to support
> MinPlatformPkg framework.
> >BoardPkg will be generic across all AMD boards which are based on
> MinPlatformPkg framework.
> >It's like "edk2-platforms/Platform/Qemu/QemuOpenBoardPkg".
> >We will gradually add modules and libraries to it.
>
> So, if the purpose is exclusively to support MinPlatformPkg platforms,
> I think that should be part of the name.
> Like Platform/AMD/AmdMinPlatformPkg (for example).
>
> > AMD/PlatformPkg will contain the modules/drivers which are generic
> > to
> future AMD platform.
> >Currently we don't have complete platform, we can drop
> >PlatformPkg for now till we have complete(reasonable modules)
> >solution.
>
> It will certainly be easier to reason about what the preferred
> naming/layout should be once there is code to look at for examples.
> It may be that parts of it would live more naturally under
> Silicon/AMD, for example.
>
> > It's better to not touch existing AMD/OverdriveBoard, restructuring
> > requires changes to .dsc and .fdf files, might break backward
> > compatibility.
>
> No problem. Config files occasionally need to be revamped, but that's
> simply a mechanical exercise.
>
> > How about having just BoardPkg like below?
>
> That, too, is a completely generic name that conveys no information
> about
> *what* boards one can expect to find in there.
>
> Regards,
>
> Leif
>
> > AMD board package
> > F: Platform/AMD/BoardPkg
> > M: Maintainer1
> > M: Maintainer2
> >
> > Please let me know your thoughts.
> >
> > Thanks
> > AbduL
> >
> >
> >
> >
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: 20 March 2023 18:35
> > To: devel@edk2.groups.io; Chang, Abner 
> > Cc: Attar, AbdulLateef (Abdul Lateef) ;
> > Ard Biesheuvel ; Michael D Kinney
> > 
> > Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt:
> > Adds AMD/BoardPkg and AMD/PlatformPkg maintainers
> >
> > Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Abner,
> >
> > On Sat, Mar 18, 2023 at 09:16:17 +, Chang, Abner via groups.io wrote:
> > > I don't see any modules under OverdriveBoard, is this package
> > > still
> >
> > The code is split between Platform/AMD and Silicon/AMD/Styx, the
> > latter
> also being used by SoftIron/Overdrive1000 and LeMaker Cello (although
> that one is pretty much defunct and should probably be dropped).
> >
> > > in use? Do you still remember where is FDF and DSC come from (as
> > > there is AMD copyright 2014-2016) back to the moment when you was
> > > introduced this package?
> >
> > As the git history tells you:
> > ---
> > commit f4d38e50c0f24eb78eb003a94f583025621c63db
> > Author: Leif Lindholm 
> > Date:   Thu Aug 

Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-21 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Leif,
AMD/BoardPkg will implements modules specific to boards(one or more 
motherboards).
It will not contain any module specific to Platform or Silicon, which are part 
of MinPlatformPkg.

How about just Min prefix?
AMD/MinBoardPkg (I am avoiding the Amd prefix because its already in AMD 
folder).

AMD board package for MinPlatformPkg
 F: Platform/AMD/MinBoardPkg
 M: Maintainer1
 M: Maintainer2

Thanks
AbduL

-Original Message-
From: Leif Lindholm 
Sent: 20 March 2023 23:33
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Chang, Abner ; Ard Biesheuvel 
; Michael D Kinney 
Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds 
AMD/BoardPkg and AMD/PlatformPkg maintainers

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


Hi Abdul,

On Mon, Mar 20, 2023 at 14:09:11 +, Attar, AbdulLateef (Abdul Lateef) wrote:
> AMD/BoardPkg will contains the modules/drivers to support MinPlatformPkg 
> framework.
>BoardPkg will be generic across all AMD boards which are based on 
> MinPlatformPkg framework.
>It's like "edk2-platforms/Platform/Qemu/QemuOpenBoardPkg".
>We will gradually add modules and libraries to it.

So, if the purpose is exclusively to support MinPlatformPkg platforms, I think 
that should be part of the name.
Like Platform/AMD/AmdMinPlatformPkg (for example).

> AMD/PlatformPkg will contain the modules/drivers which are generic to future 
> AMD platform.
>Currently we don't have complete platform, we can drop
>PlatformPkg for now till we have complete(reasonable modules)
>solution.

It will certainly be easier to reason about what the preferred naming/layout 
should be once there is code to look at for examples.
It may be that parts of it would live more naturally under Silicon/AMD, for 
example.

> It's better to not touch existing AMD/OverdriveBoard, restructuring
> requires changes to .dsc and .fdf files, might break backward
> compatibility.

No problem. Config files occasionally need to be revamped, but that's simply a 
mechanical exercise.

> How about having just BoardPkg like below?

That, too, is a completely generic name that conveys no information about 
*what* boards one can expect to find in there.

Regards,

Leif

> AMD board package
> F: Platform/AMD/BoardPkg
> M: Maintainer1
> M: Maintainer2
>
> Please let me know your thoughts.
>
> Thanks
> AbduL
>
>
>
>
> -Original Message-
> From: Leif Lindholm 
> Sent: 20 March 2023 18:35
> To: devel@edk2.groups.io; Chang, Abner 
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Ard
> Biesheuvel ; Michael D Kinney
> 
> Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> AMD/BoardPkg and AMD/PlatformPkg maintainers
>
> Caution: This message originated from an External Source. Use proper caution 
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
>
> On Sat, Mar 18, 2023 at 09:16:17 +, Chang, Abner via groups.io wrote:
> > I don't see any modules under OverdriveBoard, is this package still
>
> The code is split between Platform/AMD and Silicon/AMD/Styx, the latter also 
> being used by SoftIron/Overdrive1000 and LeMaker Cello (although that one is 
> pretty much defunct and should probably be dropped).
>
> > in use? Do you still remember where is FDF and DSC come from (as
> > there is AMD copyright 2014-2016) back to the moment when you was
> > introduced this package?
>
> As the git history tells you:
> ---
> commit f4d38e50c0f24eb78eb003a94f583025621c63db
> Author: Leif Lindholm 
> Date:   Thu Aug 3 12:24:22 2017 +0100
>
> Platform,Silicon: import AMD Styx SoC support and platforms
>
> Common files for AMD Overdrive, SoftIron Overdrive 1000
> and LeMaker Cello, as well as actual platform support.
> Imported from commit efd798c1eb of
> https://git.linaro.org/uefi/OpenPlatformPkg.git
> ---
>
> and the initial commit of the platform in that repository is:
> ---
> From: Leo Duran 
> Date: Thu, 20 Aug 2015 13:30:24 -0500
>
> Subject: Platforms/AMD: add support for AMD Overdrive and Lemaker
> Cello
>
> This adds support for the AMD Seattle based Overdrive and Husky
> platforms,
> and the Lemaker Cello which is derived from it.
>
> This code was tested with upstream EDK2 commit 758ea94651.
>
> The binaries in this branch are based on SeattleFDK 1.0.0.2
> (Linaro SeattleFDK commit 4b419f2ef2)
> ---
>
> Regards,
>
> Leif
>
> >
> > Thanks
> > Abner
> >
> > > -Original Message-
> > > From: Leif Lindholm 
> > > Sent: Saturday, March 18, 2023 12:09 AM
> > > To: Attar, AbdulLateef (Abdul Lateef) 
> > > Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef)
> > > ; Ard Biesheuvel
> > > ; Chang, Abner ;
> > > Michael D Kinney 
> > > Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> > > AMD/BoardPkg and AMD/PlatformPkg maintainers
> > >
> > > Caution: 

Re: [edk2-devel] [PATCH v2 RESEND 3/4] Platform/AMD/BoarkPkg: Adds SetCacheMtrrLib library

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Thanks for reviewing, will submit V3 patch.

-Original Message-
From: Leif Lindholm 
Sent: 17 March 2023 21:30
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Ard Biesheuvel ; Chang, 
Abner ; Michael D Kinney 
Subject: Re: [PATCH v2 RESEND 3/4] Platform/AMD/BoarkPkg: Adds SetCacheMtrrLib 
library

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


Typo in subject: BoarkPkg

On Fri, Mar 17, 2023 at 12:20:06 +0530, Abdul Lateef Attar wrote:
> Adds SetCacheMtrrLib library for AMD processor based boards.
> This library sets MTRR value or various memory ranges.
>
> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>  Platform/AMD/BoardPkg/BoardPkg.dsc|  10 ++
>  .../SetCacheMtrrLib/SetCacheMtrrLib.inf   |  37 +
>  .../Library/SetCacheMtrrLib/SetCacheMtrrLib.c | 132
> ++
>  3 files changed, 179 insertions(+)
>  create mode 100644
> Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
>  create mode 100644
> Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
>
> diff --git a/Platform/AMD/BoardPkg/BoardPkg.dsc
> b/Platform/AMD/BoardPkg/BoardPkg.dsc
> index cb4065b86c60..aa0ee8287cd8 100644
> --- a/Platform/AMD/BoardPkg/BoardPkg.dsc
> +++ b/Platform/AMD/BoardPkg/BoardPkg.dsc
> @@ -18,3 +18,13 @@ [Defines]
>
>  [Packages]
>BoardPkg/BoardPkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +  MdePkg/MdePkg.dec

Sort?

> +  UefiCpuPkg/UefiCpuPkg.dec
> +
> +[LibraryClasses.common.PEIM]
> +
> +SetCacheMtrrLib|BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> +
> +[Components.IA32]
> +  BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> +

Please drop blank line at end of file.

> diff --git
> a/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> new file mode 100644
> index ..c1d3f8dc
> --- /dev/null
> +++ b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.in
> +++ f
> @@ -0,0 +1,37 @@
> +## @file
> +# Component information file for Platform SetCacheMtrr Library.
> +# This library implementation is for AMD processor based platforms.
> +#
> +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> +
> +[Defines]
> +  INF_VERSION= 1.29
> +  BASE_NAME  = PeiSetCacheMtrrLib
> +  FILE_GUID  = 1E8468E0-5EB4-4088-9B52-BFDC6E4DAE87
> +  MODULE_TYPE= PEIM
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = SetCacheMtrrLib
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  MtrrLib
> +
> +[Packages]
> +  MinPlatformPkg/MinPlatformPkg.dec
> +  MdePkg/MdePkg.dec

Sort?

> +  UefiCpuPkg/UefiCpuPkg.dec
> +
> +[Sources]
> +  SetCacheMtrrLib.c
> +
> +[Guids]
> +
> +[Pcd]
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize
> +

Please drop blank line at end of file.

/
Leif

> diff --git
> a/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
> b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
> new file mode 100644
> index ..18404405d9fa
> --- /dev/null
> +++ b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
> @@ -0,0 +1,132 @@
> +/** @file
> +
> +SetCacheMtrr library functions.
> +This library implementation is for AMD processor based platforms.
> +
> +Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved.
> +
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/**
> +  This function sets the cache MTRR values for PEI phase.
> +**/
> +VOID
> +EFIAPI
> +SetCacheMtrr (
> +  VOID
> +  )
> +{
> +  EFI_STATUS  Status;
> +
> +  Status = MtrrSetMemoryAttribute (
> + 0,
> + 0xA,
> + CacheWriteBack
> + );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Error(%r) in setting CacheWriteBack for 0-0x9\n",
> +  Status
> +  ));
> +  }
> +
> +  Status = MtrrSetMemoryAttribute (
> + 0xA,
> + 0x2,
> + CacheUncacheable
> + );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Error(%r) in setting CacheUncacheable for 0xA-0xB\n",
> +  Status
> +  ));
> +  }
> +
> +  Status = MtrrSetMemoryAttribute (
> + 0xC,
> + 0x4,
> + CacheWriteProtected
> + );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Error(%r) in setting CacheWriteProtected for 0xC-0xF\n",
> +  Status
> +  ));
> +  

Re: [edk2-devel] [PATCH v2 RESEND 2/4] Platform/AMD/PlatformPkg: Adds PciHotPlug init protocol implementation

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Leif,
Please see inline my reply [Abdul]
I'll address the remaining review comments and submit V3 version.
Thanks
AbduL
-Original Message-
From: Leif Lindholm 
Sent: 17 March 2023 21:25
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Ard Biesheuvel ; Chang, Abner 
; Michael D Kinney 
Subject: Re: [edk2-devel] [PATCH v2 RESEND 2/4] Platform/AMD/PlatformPkg: Adds 
PciHotPlug init protocol implementation

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


On Fri, Mar 17, 2023 at 12:20:05 +0530, Abdul Lateef Attar via groups.io wrote:
> Adds PCI hotplug init protocol implementation.

What are some notable aspects of this initial implementation?
[Abdul] AMD/BoardPkg and AMD/PlatformPkg will contains module/drivers 
to support MinPlatformPkg framework.
In initial implementation we will be adding modules which need different 
implementation from Intel based platforms
to adapt MinPlatformPkg, e.g. SetCacheMtrrLib library etc., as we progress more 
we will add more modules.

What groups of platforms is it intended to cover?
[Abdul] Its generic for all AMD processor based platforms based on latest(as of 
2023) MinPlatformPkg framework.

> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>  Platform/AMD/PlatformPkg/PlatformPkg.dec  |  16 +
>  Platform/AMD/PlatformPkg/PlatformPkg.dsc  |  23 ++
>  .../PlatformPkg/PciHotPlug/PciHotPlugInit.inf |  41 +++
>  .../PlatformPkg/PciHotPlug/PciHotPlugInit.c   | 340 ++
>  4 files changed, 420 insertions(+)
>  create mode 100644
> Platform/AMD/PlatformPkg/PciHotPlug/PciHotPlugInit.inf
>  create mode 100644
> Platform/AMD/PlatformPkg/PciHotPlug/PciHotPlugInit.c
>
> diff --git a/Platform/AMD/PlatformPkg/PlatformPkg.dec
> b/Platform/AMD/PlatformPkg/PlatformPkg.dec
> index 6155860979cb..1bc38d6025c3 100644
> --- a/Platform/AMD/PlatformPkg/PlatformPkg.dec
> +++ b/Platform/AMD/PlatformPkg/PlatformPkg.dec
> @@ -13,3 +13,19 @@ [Defines]
>PACKAGE_NAME   = PlatformPkg
>PACKAGE_GUID   = 38FBA311-E2AA-4620-9A90-9A23753D1878
>PACKAGE_VERSION= 0.1
> +
> +[Guids]
> +  gPlatformPkgTokenSpaceGuid = { 0x95ECA58D, 0x09B6, 0x4420, { 0xB4, 
> 0xE7, 0x01, 0x7F, 0x6A, 0x5B, 0x26, 0x0F }}
> +
> +[PcdsDynamic, PcdsDynamicEx]
> +  #
> +  # PCI HotPlug Resource Padding
> +  #
> +  # IO Resource padding in bytes, default 4KB
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadIO|0x1000|UINT
> +64|0x1000
> +  # PreFetch Memory padding in bytes, default 2MB
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadPMem|0x0020|UI
> +NT64|0x1001
> +  # Non-PreFetch Memory padding in bytes, default 1MB
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadMem|0x0010|UIN
> +T64|0x1002
> +  # PCI bus padding, number of bus to reserve, default 2 bus
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadBus|2|UINT8|0x1000
> +0003
> diff --git a/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> b/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> index 704566b9ea73..9a693070ab3f 100644
> --- a/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> +++ b/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> @@ -16,5 +16,28 @@ [Defines]
>BUILD_TARGETS   = DEBUG | RELEASE | NOOPT
>SUPPORTED_ARCHITECTURES = IA32 | X64
>
> +

Please don't add spurious whitespaces.

>  [Packages]
>PlatformPkg/PlatformPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec

I won't be maintaining this code, but I generally advocate sorting these types 
of enumerations alphabetically in order to speed up reading.

(That's not really possible for the block below.)

> +
> +[LibraryClasses.Common]
> +
> +UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEn
> +tryPoint.inf
> +
> +UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/Uefi
> +BootServicesTableLib.inf
> +
> +DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort
> +.inf
> +
> +MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> +AllocationLib.inf
> +  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> +  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> +
> +RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilter
> +LibNull.inf
> +
> +SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
> +ortLib16550.inf
> +  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> +
> +DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Ba
> +seDebugPrintErrorLevelLib.inf
> +  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> +
> +PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlat
> +formHookLibNull.inf
> +  

Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Leif,

AMD/BoardPkg will contains the modules/drivers to support MinPlatformPkg 
framework.
   BoardPkg will be generic across all AMD boards which are based on 
MinPlatformPkg framework.
   It's like "edk2-platforms/Platform/Qemu/QemuOpenBoardPkg".
   We will gradually add modules and libraries to it.

AMD/PlatformPkg will contain the modules/drivers which are generic to future 
AMD platform.
   Currently we don't have complete platform, we can drop PlatformPkg for now 
till we have complete(reasonable modules) solution.

It's better to not touch existing AMD/OverdriveBoard, restructuring requires 
changes to .dsc and .fdf files, might break backward compatibility.

How about having just BoardPkg like below?

AMD board package
F: Platform/AMD/BoardPkg
M: Maintainer1
M: Maintainer2

Please let me know your thoughts.

Thanks
AbduL




-Original Message-
From: Leif Lindholm 
Sent: 20 March 2023 18:35
To: devel@edk2.groups.io; Chang, Abner 
Cc: Attar, AbdulLateef (Abdul Lateef) ; Ard 
Biesheuvel ; Michael D Kinney 

Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds 
AMD/BoardPkg and AMD/PlatformPkg maintainers

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


Hi Abner,

On Sat, Mar 18, 2023 at 09:16:17 +, Chang, Abner via groups.io wrote:
> I don't see any modules under OverdriveBoard, is this package still

The code is split between Platform/AMD and Silicon/AMD/Styx, the latter also 
being used by SoftIron/Overdrive1000 and LeMaker Cello (although that one is 
pretty much defunct and should probably be dropped).

> in use? Do you still remember where is FDF and DSC come from (as there
> is AMD copyright 2014-2016) back to the moment when you was introduced
> this package?

As the git history tells you:
---
commit f4d38e50c0f24eb78eb003a94f583025621c63db
Author: Leif Lindholm 
Date:   Thu Aug 3 12:24:22 2017 +0100

Platform,Silicon: import AMD Styx SoC support and platforms

Common files for AMD Overdrive, SoftIron Overdrive 1000
and LeMaker Cello, as well as actual platform support.
Imported from commit efd798c1eb of
https://git.linaro.org/uefi/OpenPlatformPkg.git
---

and the initial commit of the platform in that repository is:
---
From: Leo Duran 
Date: Thu, 20 Aug 2015 13:30:24 -0500

Subject: Platforms/AMD: add support for AMD Overdrive and Lemaker Cello

This adds support for the AMD Seattle based Overdrive and Husky
platforms,
and the Lemaker Cello which is derived from it.

This code was tested with upstream EDK2 commit 758ea94651.

The binaries in this branch are based on SeattleFDK 1.0.0.2
(Linaro SeattleFDK commit 4b419f2ef2)
---

Regards,

Leif

>
> Thanks
> Abner
>
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Saturday, March 18, 2023 12:09 AM
> > To: Attar, AbdulLateef (Abdul Lateef) 
> > Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef)
> > ; Ard Biesheuvel
> > ; Chang, Abner ;
> > Michael D Kinney 
> > Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> > AMD/BoardPkg and AMD/PlatformPkg maintainers
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> > > From: Abdul Lateef Attar 
> > >
> > > Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
> > >
> > > Signed-off-by: Abdul Lateef Attar 
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Abner Chang 
> > > Cc: Michael D Kinney 
> > > ---
> > >  Maintainers.txt | 6 ++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt index
> > > 747191366070..bb8ab643e090 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
> > >  M: Ard Biesheuvel 
> > >  M: Leif Lindholm 
> > >
> > > +AMD Platform
> >
> > Annoyingly, I'm now going to ask the question I have been avoiding
> > up until now. What does "AMD Platform" mean?
> > I mean, you've placed this straight after the entry for the Seattle 
> > platforms.
> > I think the name, and package names, are too generic.
> >
> > /
> > Leif
> >
> > > +F: Platform/AMD/BoardPkg
> > > +F: Platform/AMD/PlatformPkg
> > > +M: Abner Chang 
> > > +M: Abdul Lateef Attar 
> > > +
> > >  Ampere Computing
> > >  F: Platform/Ampere
> > >  F: Silicon/Ampere
> > > --
> > > 2.25.1
> > >
>
>
> 
>
>


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




Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Leif,
How about adding a separate entry?
Currently its generic to adapt the MinPlatformPkg, later will add more specific 
platforms.

AMD board and platform
F: Platform/AMD/BoardPkg
F: Platform/AMD/PlatformPkg
M: maintainer1
M: maintainer2

AMD Seattle
F: Platform/AMD/OverdriveBoard/
F: Platform/LeMaker/CelloBoard/
F: Platform/SoftIron/
F: Silicon/AMD/Styx/
M: Ard Biesheuvel 
M: Leif Lindholm 

Thanks
AbduL

-Original Message-
From: Leif Lindholm 
Sent: 17 March 2023 21:39
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Ard Biesheuvel ; Chang, 
Abner ; Michael D Kinney 
Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and 
AMD/PlatformPkg maintainers

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


On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> From: Abdul Lateef Attar 
>
> Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
>
> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>  Maintainers.txt | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt index
> 747191366070..bb8ab643e090 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
>
> +AMD Platform

Annoyingly, I'm now going to ask the question I have been avoiding up until 
now. What does "AMD Platform" mean?
I mean, you've placed this straight after the entry for the Seattle platforms.
I think the name, and package names, are too generic.

/
Leif

> +F: Platform/AMD/BoardPkg
> +F: Platform/AMD/PlatformPkg
> +M: Abner Chang 
> +M: Abdul Lateef Attar 
> +
>  Ampere Computing
>  F: Platform/Ampere
>  F: Silicon/Ampere
> --
> 2.25.1
>


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




Re: [edk2-devel] [PATCH v2 0/4] Adds AMD/BoardPkg and AMD/PlatformPkg

2023-03-19 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Abner,
Thanks for reviewing the code, I had addressed the review comments in 
V2 version.
- Abdul
-Original Message-
From: Abdul Lateef Attar 
Sent: 17 March 2023 11:59
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Ard 
Biesheuvel ; Leif Lindholm 
; Chang, Abner ; Michael D 
Kinney 
Subject: [PATCH v2 0/4] Adds AMD/BoardPkg and AMD/PlatformPkg

Adds AMD/BoardPkg to support MinPlatformPkg framework.
Adds AMD/PlatformPkg, which provide supporting modules and libraries for AMD 
based platform.

PR: https://github.com/tianocore/edk2-platforms/pull/69

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Abner Chang 
Cc: Michael D Kinney 

Abdul Lateef Attar (4):
  Platform/AMD: Adds BoardPkg and PlatformPkg
  Platform/AMD/PlatformPkg: Adds PciHotPlug init protocol implementation
  Platform/AMD/BoarkPkg: Adds SetCacheMtrrLib library
  Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

 Platform/AMD/BoardPkg/BoardPkg.dec|  18 +
 Platform/AMD/PlatformPkg/PlatformPkg.dec  |  31 ++
 Platform/AMD/BoardPkg/BoardPkg.dsc|  30 ++
 Platform/AMD/PlatformPkg/PlatformPkg.dsc  |  43 +++
 .../SetCacheMtrrLib/SetCacheMtrrLib.inf   |  37 ++
 .../PlatformPkg/PciHotPlug/PciHotPlugInit.inf |  41 +++  
.../Library/SetCacheMtrrLib/SetCacheMtrrLib.c | 132 +++
 .../PlatformPkg/PciHotPlug/PciHotPlugInit.c   | 340 ++
 Maintainers.txt   |   6 +
 9 files changed, 678 insertions(+)
 create mode 100644 Platform/AMD/BoardPkg/BoardPkg.dec
 create mode 100644 Platform/AMD/PlatformPkg/PlatformPkg.dec
 create mode 100644 Platform/AMD/BoardPkg/BoardPkg.dsc
 create mode 100644 Platform/AMD/PlatformPkg/PlatformPkg.dsc
 create mode 100644 
Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
 create mode 100644 Platform/AMD/PlatformPkg/PciHotPlug/PciHotPlugInit.inf
 create mode 100644 
Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
 create mode 100644 Platform/AMD/PlatformPkg/PciHotPlug/PciHotPlugInit.c

--
2.25.1



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




Re: [edk2-devel] [edk2-platforms][PATCH 2/8] ManageabilityPkg: Initial package

2023-03-06 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Looks good.
Reviewed-by:  Abdul Lateef Attar 

-Original Message-
From: Chang, Abner  
Sent: Friday, March 3, 2023 1:10 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Attar, AbdulLateef (Abdul 
Lateef) ; Nickle Wang ; Igor 
Kulchytskyy 
Subject: [edk2-platforms][PATCH 2/8] ManageabilityPkg: Initial package

From: Abner Chang 

Initial commit of ManageabilityPkg

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../ManageabilityPkg/ManageabilityPkg.dec | 18 +
 .../Include/Dsc/Manageability.dsc | 16 
 .../ManageabilityPkg/ManageabilityPkg.dsc | 40 +++
 3 files changed, 74 insertions(+)
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
 create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
new file mode 100644
index 00..8a0e28f50b
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -0,0 +1,18 @@
+## @file
+# Manageabilty Package
+# This is the package provides the edk2 drivers and libraries # those 
+are related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  DEC_SPECIFICATION = 0x0001001d
+  PACKAGE_NAME  = ManageabilityPkg
+  PACKAGE_GUID  = 36310119-4FB2-4BA3-959D-74C16B849F9E
+  PACKAGE_VERSION   = 1.0
+
+[Includes]
+  Include
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
new file mode 100644
index 00..2cb63c1ca6
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -0,0 +1,16 @@
+## @file
+# Common libraries for Manageabilty Package # # Copyright (C) 2023 
+Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # This library provides the instrinsic functions generated by a given 
compiler.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
new file mode 100644
index 00..46cc215a0f
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -0,0 +1,40 @@
+## @file
+# Manageabilty Package
+# This is the package provides edk2 drivers and libraries # those are 
+related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  PLATFORM_NAME  = ManageabilityPkg
+  PLATFORM_GUID  = 7A98123A-B194-40B6-A863-A52192F6D65D
+  PLATFORM_VERSION   = 1.0
+  DSC_SPECIFICATION  = 0x0001001e
+  OUTPUT_DIRECTORY   = Build/ManageabilityPkg
+  SUPPORTED_ARCHITECTURES= IA32|X64|ARM|AARCH64|RISCV64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # MinPlatform common include currently required PCD
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
+!include Include/Dsc/Manageability.dsc
+
--
2.37.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100748): https://edk2.groups.io/g/devel/message/100748
Mute This Topic: https://groups.io/mt/97357753/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/2] BoardModulePkg: Copy device path before processing

2023-01-18 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Isaac,

Please see inline for my reply. [Abdul]

Thanks
AbduL


-Original Message-
From: Oram, Isaac W 
Sent: 18 January 2023 02:01
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Dong, Eric ; Gao, Liming 
Subject: RE: [edk2-devel] [PATCH 1/2] BoardModulePkg: Copy device path before 
processing

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


Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
Line 168: Don't we need to free buffer on this path?
[Abdul] we are freeing all allocated buffers here before returning.

Lines 655, 1083:  Please put a newline between while and the block to free 
resources.
[Abdul] will make the changes in V3 patch.

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: Tuesday, November 15, 2022 4:04 AM
To: devel@edk2.groups.io
Cc: Dong, Eric ; Gao, Liming 
Subject: [edk2-devel] [PATCH 1/2] BoardModulePkg: Copy device path before 
processing

From: Abdul Lateef Attar 

GCC compiler puts the DevicePath PCDs to the read-only section. During boot if 
try to process the device path after PtrGetPtr it throws a page fault exception.

Hence making a local copy using DuplicateDevicePath() to avoid the page fault 
exception.

Cc: Eric Dong 
Cc: Liming Gao 

Signed-off-by: Abdul Lateef Attar 
---
 .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git 
a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c 
b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
index 0bcee7c9a4ba..8700118d255a 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHook
+++ Lib.c
@@ -3,6 +3,7 @@
   implementation instance of the BDS hook library



   Copyright (c) 2019, Intel Corporation. All rights reserved.

+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+ reserved.

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



 **/

@@ -131,7 +132,7 @@ IsTrustedConsole (


   switch (ConsoleType) {

 case ConIn:

-  TrustedConsoleDevicepath = PcdGetPtr (PcdTrustedConsoleInputDevicePath);

+  TrustedConsoleDevicepath = DuplicateDevicePath (PcdGetPtr
+ (PcdTrustedConsoleInputDevicePath));

   break;

 case ConOut:

   //

@@ -147,7 +148,7 @@ IsTrustedConsole (
 TempDevicePath = NextDevicePathNode (TempDevicePath);

   }



-  TrustedConsoleDevicepath = PcdGetPtr (PcdTrustedConsoleOutputDevicePath);

+  TrustedConsoleDevicepath = DuplicateDevicePath (PcdGetPtr
+ (PcdTrustedConsoleOutputDevicePath));

   break;

 default:

   ASSERT (FALSE);

@@ -171,7 +172,9 @@ IsTrustedConsole (
   } while (TempDevicePath != NULL);



   FreePool (ConsoleDevice);

-

+  if (TrustedConsoleDevicepath != NULL) {

+FreePool (TrustedConsoleDevicepath);

+  }

   return FALSE;

 }



@@ -624,7 +627,7 @@ ConnectTrustedStorage (
   EFI_STATUSStatus;

   EFI_HANDLEDeviceHandle;



-  TrustedStorageDevicepath = PcdGetPtr (PcdTrustedStorageDevicePath);

+  TrustedStorageDevicepath = DuplicateDevicePath (PcdGetPtr
+ (PcdTrustedStorageDevicePath));

   DumpDevicePath (L"TrustedStorage", TrustedStorageDevicepath);



   TempDevicePath = TrustedStorageDevicepath;

@@ -649,6 +652,9 @@ ConnectTrustedStorage (


 FreePool (Instance);

   } while (TempDevicePath != NULL);

+  if (TrustedStorageDevicepath != NULL) {

+FreePool (TrustedStorageDevicepath);

+  }

 }





@@ -1031,7 +1037,7 @@ AddConsoleVariable (
   EFI_HANDLEGraphicsControllerHandle;

   EFI_DEVICE_PATH   *GopDevicePath;



-  TempDevicePath = ConsoleDevicePath;

+  TempDevicePath = DuplicateDevicePath (ConsoleDevicePath);

   do {

 Instance = GetNextDevicePathInstance (, );

 if (Instance == NULL) {

@@ -1074,6 +1080,9 @@ AddConsoleVariable (


 FreePool (Instance);

   } while (TempDevicePath != NULL);

+  if (TempDevicePath != NULL) {

+FreePool (TempDevicePath);

+  }

 }





--
2.25.1








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




Re: [edk2-devel] [PATCH 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

2023-01-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Maintainers,
Could you please review and merge the below patch?
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 15 November 2022 17:34
To: devel@edk2.groups.io
Cc: Eric Dong ; Liming Gao ; 
Isaac Oram 
Subject: [edk2-devel] [PATCH 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

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


 Patch 1: Fix the GCC boot time page fault exception,
  by copying PcdGetPtr to local variables.
 Patch 2: Adds PCD to hold the UEFI shell GUID value
  and description, to provide flexibility to load
  any UEFI application as UEFI shell.

PR : 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2-platforms%2Fpull%2F50data=05%7C01%7CAbdulLateef.Attar%40amd.com%7Cbe5dc1f4cbf941fa88de08dac723cf3d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638041253865897866%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=LwpBjZqUi%2BMCh60aERuXCusAPrKNYk0vbpLrg7dCYic%3Dreserved=0

Cc: Eric Dong 
Cc: Liming Gao 
CC: Isaac Oram 

Abdul Lateef Attar (2):
  BoardModulePkg: Copy device path before processing
  BoardModulePkg: Adds PCD to load UEFI Shell image

 .../Intel/MinPlatformPkg/MinPlatformPkg.dec   |  5 +
 .../BoardBdsHookLib/BoardBdsHookLib.inf   |  3 +++
 .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 ++-  
.../Library/BoardBdsHookLib/BoardBootOption.c |  8 +---
 4 files changed, 27 insertions(+), 8 deletions(-)

--
2.25.1








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




Re: [edk2-devel] [PATCH v2 4/6] UefiCpuPkg: Implements SmmSmramSaveStateLib library class

2023-01-16 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
Hi Abner,

Please see inline for my reply under [Abdul].

Thanks
AbduL
-Original Message-
From: Chang, Abner  
Sent: 15 January 2023 10:15
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Grimes, Paul ; Kirkendall, Garrett 
; Eric Dong ; Ray Ni 
; Rahul Kumar ; Gerd Hoffmann 

Subject: RE: [edk2-devel] [PATCH v2 4/6] UefiCpuPkg: Implements 
SmmSmramSaveStateLib library class

[AMD Official Use Only - General]

According to the section 4.2.3 in edk2 c coding standard spec in below link, 
the processor vendor directory must be under the processor arch directory. We 
use vendor directory because the different implementations of the same 
processor arch.
https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/edk2-CCodingStandardsSpecification-draft.pdf
So for this case, we can just have AmdSmramSaveState.c under SmramSaveStateLib\ 
according to the file naming defined in 4.3.5.4 because this library is only 
for X86 platform. 


[Abdul] SmramSaveState.c will be different for Intel's implementation, that's 
the reason added Amd directory.

After this patch set is reviewed and merged, we should have another patch set 
to update PiSmmCpuDxeSmm to use this library for SMM register access, remove 
the one in SmmCpuFeaturelib. Also update OVMF to use SmmSmramSaveStateLib. 
Migration SmmSaveState.c under PiSmmCpuDxeSmm to SmmSmramSaveStateLib for Intel 
implementation.

SmmSmramSaveStateLib implementation is AMD processor specific.
I haven't added Intel's implementation, hence cant use this library in 
PiSmmCpuDxeSmm until Intel's implementation added.
Same applies to the OVMF.

Other comments in below, 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abdul 
> Lateef Attar via groups.io
> Sent: Wednesday, January 11, 2023 2:16 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; 
> Grimes, Paul ; Kirkendall, Garrett 
> ; Chang, Abner ; Eric 
> Dong ; Ray Ni ; Rahul Kumar 
> ; Gerd Hoffmann ; Attar, 
> AbdulLateef (Abdul Lateef) 
> Subject: [edk2-devel] [PATCH v2 4/6] UefiCpuPkg: Implements 
> SmmSmramSaveStateLib library class
> 
> Caution: This message originated from an External Source. Use proper 
> caution when opening attachments, clicking links, or responding.
> 
> 
> From: Abdul Lateef Attar 
> 
> BZ:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz
> illa.tianocore.org%2Fshow_bug.cgi%3Fid%3D4182=05%7C01%7Cabner.
> chang%40amd.com%7C21622ff06cd949cc7e1608daf39b82a2%7C3dd8961fe48
> 84e608e11a82d994e183d%7C0%7C0%7C638090146492954852%7CUnknown%
> 7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
> wiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=QgHzNdcBkpCNbjGLPfx0L
> Em6ECHYowjuSryyNiWf0ww%3D=0
> 
> Implements SmmSmramSaveStateLib Library class for AMD cpu family.
> 
> Cc: Paul Grimes 
> Cc: Garrett Kirkendall 
> Cc: Abner Chang 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Rahul Kumar 
> Cc: Gerd Hoffmann 
> 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  UefiCpuPkg/UefiCpuPkg.dsc |   3 +
>  .../AmdSmmSmramSaveStateLib.inf   |  28 ++
>  .../SmmSmramSaveStateLib/SmramSaveState.h | 102 ++
>  .../SmmSmramSaveStateLib/Amd/SmramSaveState.c | 318
> ++
>  .../SmramSaveStateCommon.c| 124 +++
>  5 files changed, 575 insertions(+)
>  create mode 100644
> UefiCpuPkg/Library/SmmSmramSaveStateLib/AmdSmmSmramSaveStateLib.
> inf
>  create mode 100644
> UefiCpuPkg/Library/SmmSmramSaveStateLib/SmramSaveState.h
>  create mode 100644
> UefiCpuPkg/Library/SmmSmramSaveStateLib/Amd/SmramSaveState.c
>  create mode 100644
> UefiCpuPkg/Library/SmmSmramSaveStateLib/SmramSaveStateCommon.c
> 
> diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc 
> index f9a46089d2c7..99f7532ce00b 100644
> --- a/UefiCpuPkg/UefiCpuPkg.dsc
> +++ b/UefiCpuPkg/UefiCpuPkg.dsc
> @@ -2,6 +2,7 @@
>  #  UefiCpuPkg Package
> 
>  #
> 
>  #  Copyright (c) 2007 - 2022, Intel Corporation. All rights 
> reserved.
> 
> +#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
> +reserved.
> 
>  #
> 
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
> @@ -104,6 +105,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
> 
> MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMe
> moryAllocationLib.inf
> 
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> 
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/Smm
> CpuExceptionHandlerLib.inf
> 
> +
> +
> SmmSmramSaveStateLib|UefiCpuPkg/Library/SmmSmramSaveStateLib/Am
> dSmmSmr
> + amSaveStateLib.inf
> 
> 
> 
>  [LibraryClasses.common.MM_STANDALONE]
> 
> 
> MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Stan
> daloneMmServicesTableLib.inf
> 
> @@ -191,6 +193,7 @@ [Components.IA32, Components.X64]
>  
> 
> 
> UnitTestResultReportLib|UnitTestFrameworkPkg/Library/UnitTestResultRep
> ortLib/UnitTestResultReportLibConOut.inf
> 
>}
> 
> +
> 

Re: [edk2-devel] [PATCH v2 0/6] Adds AmdSmmCpuFeaturesLib

2023-01-13 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Ray,
I just rebase the PR and it passed all CI tests.
Hope, this is sufficient, or do I need to re-submit the patch ?
Thanks
AbduL


-Original Message-
From: Ni, Ray 
Sent: 13 January 2023 14:28
To: Laszlo Ersek ; devel@edk2.groups.io; Attar, AbdulLateef 
(Abdul Lateef) 
Cc: Grimes, Paul ; Kirkendall, Garrett 
; Chang, Abner ; Dong, Eric 
; Kumar, Rahul R ; Kinney, 
Michael D ; Gao, Liming ; 
Liu, Zhiguang ; Gerd Hoffmann 
Subject: RE: [edk2-devel] [PATCH v2 0/6] Adds AmdSmmCpuFeaturesLib

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


It seems the patch set is not based on the edk2 master branch.
Can you confirm?

> -Original Message-
> From: Laszlo Ersek 
> Sent: Thursday, January 12, 2023 9:05 PM
> To: devel@edk2.groups.io; abdat...@amd.com
> Cc: Paul Grimes ; Garrett Kirkendall
> ; Abner Chang ; Dong,
> Eric ; Ni, Ray ; Kumar, Rahul R
> ; Kinney, Michael D
> ; Gao, Liming ;
> Liu, Zhiguang ; Gerd Hoffmann
> 
> Subject: Re: [edk2-devel] [PATCH v2 0/6] Adds AmdSmmCpuFeaturesLib
>
> On 1/11/23 07:15, Abdul Lateef Attar via groups.io wrote:
> > V2 series addresses review comments from V1.
> > Adds SmmSmramSaveStateLib library
> > Removes global references across modules.
> > drops S3 support patch.
> >
> > PR: https://github.com/tianocore/edk2/pull/3882
> >
> > Cc: Paul Grimes 
> > Cc: Garrett Kirkendall 
> > Cc: Abner Chang 
> > Cc: Eric Dong 
> > Cc: Ray Ni 
> > Cc: Rahul Kumar 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Zhiguang Liu 
> >
> > Abdul Lateef Attar (6):
> >   UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code
> >   MdePkg: Adds AMD SMRAM save state map
> >   UefiCpuPkg: Adds SmmSmramSaveStateLib library class
> >   UefiCpuPkg: Implements SmmSmramSaveStateLib library class
> >   UefiCpuPkg: Initial implementation of AMD's SmmCpuFeaturesLib
> >   UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family
> >
> >  UefiCpuPkg/UefiCpuPkg.dec |   4 +
> >  UefiCpuPkg/UefiCpuPkg.dsc |  11 +
> >  .../AmdSmmCpuFeaturesLib.inf  |  39 ++
> >  .../AmdSmmSmramSaveStateLib.inf   |  28 ++
> >  .../Include/Register/Amd/SmramSaveStateMap.h  | 194 
> >  .../Include/Library/SmmSmramSaveStateLib.h|  69 +++
> >  .../SmmSmramSaveStateLib/SmramSaveState.h | 102 
> >  .../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c | 445 ++
> >  .../IntelSmmCpuFeaturesLib.c  | 128 +
> >  .../SmmCpuFeaturesLibCommon.c | 128 -
> >  .../SmmSmramSaveStateLib/Amd/SmramSaveState.c | 318 +
> >  .../SmramSaveStateCommon.c| 124 +
> >  MdePkg/MdePkg.ci.yaml |   3 +-
> >  13 files changed, 1464 insertions(+), 129 deletions(-)  create mode
> > 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
> >  create mode 100644
> > UefiCpuPkg/Library/SmmSmramSaveStateLib/AmdSmmSmramSaveStateLib.inf
> >  create mode 100644 MdePkg/Include/Register/Amd/SmramSaveStateMap.h
> >  create mode 100644
> > UefiCpuPkg/Include/Library/SmmSmramSaveStateLib.h
> >  create mode 100644
> > UefiCpuPkg/Library/SmmSmramSaveStateLib/SmramSaveState.h
> >  create mode 100644
> > UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
> >  create mode 100644
> > UefiCpuPkg/Library/SmmSmramSaveStateLib/Amd/SmramSaveState.c
> >  create mode 100644
> > UefiCpuPkg/Library/SmmSmramSaveStateLib/SmramSaveStateCommon.c
> >
>
> - Is there a feature BZ for this?
>
> There should be. Explaining the goal of the patch set belongs there.
> Plus, if there is a feature BZ like that, it can be included in the
> Proposed Features list at
>  Planning>, and then associated with the next release notes at
> .
>
> - OVMF's SmmCpuFeaturesLib (OvmfPkg/Library/SmmCpuFeaturesLib) matches
> QEMU, and QEMU uses the AMD flavor of the save state map.
>
> I don't think OVMF's library instance can be used for physical AMD
> processors whole-sale, so the library instances should remain separate.
> However, the register maps could be shared by some means, perhaps.
>
> - Please copy Gerd on UefiCpuPkg patches, per commit 0aca5901e344
> ("Maintainers.txt: designate Gerd Hoffmann as UefiCpuPkg reviewer",
> 2023-01-06).
>
> Thanks for considering.
> Laszlo



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




Re: [edk2-devel] [PATCH v1 4/5] UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family

2022-12-13 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Abner,
Thanks for quick review. I'll create a new library and submit 
the patch.
Thanks
AbduL

From: abner.chang via groups.io 
Sent: 08 December 2022 10:38
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v1 4/5] UefiCpuPkg: Implements 
SmmCpuFeaturesLib for AMD Family

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

Hi Abdul,
This is a little bit confusing because there is one SmramSaveStae.c under 
PismmCpuDxeSmm however another one is under SmmCpuFeaturesLib for AMD.
I would suggest we introduce SmramSaveState library under UefiCpuPkg/Library 
which is used by both PismmCpuDxeSmm and SmmCpuFeaturesLib. This makes the 
library reference clear without duplication.
We can have AMD SmramSaveStateLib instance and just name it as 
SmramSaveStateLib.c. That is Intel's decision if they want to move their 
implementation from PismmCpuDxeSmm to SmramSaveState or not.
Thanks
Abner

On Tue, Dec 6, 2022 at 09:23 PM, Abdul Lateef Attar wrote:
From: Abdul Lateef Attar 
mailto:abdullateef.at...@amd.com>>

BZ: 
https://bugzilla.tianocore.org/show_bug.cgi?id=4182

Implements interfaces to read and write save state
registers of AMD's processor family.
Initializes processor SMMADDR and MASK depends
on PcdSmrrEnable flag.
Program or corrects the IP once control returns from SMM.

Cc: Paul Grimes mailto:paul.gri...@amd.com>>
Cc: Garrett Kirkendall 
mailto:garrett.kirkend...@amd.com>>
Cc: Abner Chang mailto:abner.ch...@amd.com>>
Cc: Eric Dong mailto:eric.d...@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Rahul Kumar mailto:rahul1.ku...@intel.com>>
Signed-off-by: Abdul Lateef Attar 
mailto:abdullateef.at...@amd.com>>
---
.../AmdSmmCpuFeaturesLib.inf | 2 +
.../SmmCpuFeaturesLib/Amd/SmramSaveState.h | 109 +
.../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c | 97 -
.../SmmCpuFeaturesLib/Amd/SmramSaveState.c | 409 ++
4 files changed, 612 insertions(+), 5 deletions(-)
create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.c

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
index 08ac0262022f..95eb31d16ead 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
@@ -21,6 +21,8 @@ [Sources]
SmmCpuFeaturesLib.c
SmmCpuFeaturesLibCommon.c
Amd/SmmCpuFeaturesLib.c
+ Amd/SmramSaveState.c
+ Amd/SmramSaveState.h

[Packages]
MdePkg/MdePkg.dec
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
new file mode 100644
index ..290ebdbc9227
--- /dev/null
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
@@ -0,0 +1,109 @@
+/** @file
+SMRAM Save State Map header file.
+
+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef SMRAM_SAVESTATE_H_
+#define SMRAM_SAVESTATE_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// EFER register LMA bit
+#define LMA BIT10
+
+// Machine Specific Registers (MSRs)
+#define SMMADDR_ADDRESS 0xC0010112ul
+#define SMMMASK_ADDRESS 0xC0010113ul
+#define EFER_ADDRESS 0XC080ul
+
+// Macro used to simplify the lookup table entries of type 
CPU_SMM_SAVE_STATE_LOOKUP_ENTRY
+#define SMM_CPU_OFFSET(Field) OFFSET_OF (AMD_SMRAM_SAVE_STATE_MAP, Field)
+
+// Macro used to simplify the lookup table entries of type 
CPU_SMM_SAVE_STATE_REGISTER_RANGE
+#define SMM_REGISTER_RANGE(Start, End) { Start, End, End - Start + 1 }
+
+// Structure used to describe a range of registers
+typedef struct {
+ EFI_SMM_SAVE_STATE_REGISTER Start;
+ EFI_SMM_SAVE_STATE_REGISTER End;
+ UINTN Length;
+} CPU_SMM_SAVE_STATE_REGISTER_RANGE;
+
+// Structure used to build a lookup table to retrieve the widths and offsets
+// associated with each supported EFI_SMM_SAVE_STATE_REGISTER value
+
+#define SMM_SAVE_STATE_REGISTER_SMMREVID_INDEX 1
+#define SMM_SAVE_STATE_REGISTER_MAX_INDEX 2
+
+typedef struct {
+ UINT8 Width32;
+ UINT8 Width64;
+ UINT16 Offset32;
+ UINT16 Offset64Lo;
+ UINT16 Offset64Hi;
+ BOOLEAN Writeable;
+} CPU_SMM_SAVE_STATE_LOOKUP_ENTRY;
+
+/**
+ Read an SMM Save State register 

Re: [edk2-devel] [PATCH v1 5/5] UefiCpuPkg/AmdSmmCpuFeaturesLib: Handles S3 save state

2022-12-13 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Abner,
I’ll drop this patch from the patch list. We will investigate 
and submit a separate patch for handling the S3 save stage.
Thanks
AbduL

From: abner.chang via groups.io 
Sent: 08 December 2022 11:17
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v1 5/5] UefiCpuPkg/AmdSmmCpuFeaturesLib: 
Handles S3 save state

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

Apart from the comment given to 4/5, I am afraid those extern variables in C 
file is not obey the section 5.4.2.1 extern in CCS.

Regards,
Abner


Abner
On Tue, Dec 6, 2022 at 09:23 PM, Abdul Lateef Attar wrote:
---
.../AmdSmmCpuFeaturesLib.inf | 1 +
.../SmmCpuFeaturesLib/Amd/SmramSaveState.h | 19 +++
.../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c | 32 +++
3 files changed, 52 insertions(+)

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
index 95eb31d16ead..7fd559e91ad8 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
@@ -27,6 +27,7 @@ [Sources]
[Packages]
MdePkg/MdePkg.dec
UefiCpuPkg/UefiCpuPkg.dec
+ MdeModulePkg/MdeModulePkg.dec

[LibraryClasses]
BaseLib
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
index 290ebdbc9227..474a5dbd9765 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
@@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include 
#include 
#include 
+#include 

// EFER register LMA bit
#define LMA BIT10
@@ -106,4 +107,22 @@ InternalSmmCpuFeaturesWriteSaveStateRegister (
IN CONST VOID *Buffer
);

+/**
+ Initialize MP synchronization data.
+**/
+VOID
+EFIAPI
+InitializeMpSyncData (
+ VOID
+ );
+
+/**
+ Perform SMM MP sync Semaphores re-initialization in the S3 boot path.
+**/
+VOID
+EFIAPI
+SmmS3MpSemaphoreInit (
+ VOID
+ );
+
#endif
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
index 10bed4116397..b855573d9401 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
@@ -14,6 +14,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
// The mode of the CPU at the time an SMI occurs
extern UINT8 mSmmSaveStateRegisterLma;

+// SMM S3 resume state Ptr
+extern SMM_S3_RESUME_STATE *mSmmS3ResumeState;
+
/**
Read an SMM Save State register on the target processor. If this function
returns EFI_UNSUPPORTED, then the caller is responsible for reading the
@@ -441,4 +444,33 @@ SmmCpuFeaturesCompleteSmmReadyToLock (
VOID
)
{
+ if (mSmmS3ResumeState != NULL ) {
+ mSmmS3ResumeState->SmmS3ResumeEntryPoint = 
(EFI_PHYSICAL_ADDRESS)(UINTN)SmmS3MpSemaphoreInit;
+ }
+}
+
+/**
+ Perform SMM MP sync Semaphores re-initialization in the S3 boot path.
+**/
+VOID
+EFIAPI
+SmmS3MpSemaphoreInit (
+ VOID
+ )
+{
+ InitializeMpSyncData ();
+
+ DEBUG ((DEBUG_INFO, "SMM S3 Return CS = %x\n", mSmmS3ResumeState->ReturnCs));
+ DEBUG ((DEBUG_INFO, "SMM S3 Return Entry Point = %x\n", 
mSmmS3ResumeState->ReturnEntryPoint));
+ DEBUG ((DEBUG_INFO, "SMM S3 Return Context1 = %x\n", 
mSmmS3ResumeState->ReturnContext1));
+ DEBUG ((DEBUG_INFO, "SMM S3 Return Context2 = %x\n", 
mSmmS3ResumeState->ReturnContext2));
+ DEBUG ((DEBUG_INFO, "SMM S3 Return Stack Pointer = %x\n", 
mSmmS3ResumeState->ReturnStackPointer));
+
+ AsmDisablePaging64 (
+ mSmmS3ResumeState->ReturnCs,
+ (UINT32)mSmmS3ResumeState->ReturnEntryPoint,
+ (UINT32)mSmmS3ResumeState->ReturnContext1,
+ (UINT32)mSmmS3ResumeState->ReturnContext2,
+ (UINT32)mSmmS3ResumeState->ReturnStackPointer
+ );
}
--


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




Re: [edk2-devel] [tianocore-docs][PATCH V2 2/2] edk II C Coding Standard: Updates 4.2 and 4.3 sections

2022-10-19 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Looks good to me
Reviewed-by: Abdul Lateef Attar

-Original Message-
From: Chang, Abner 
Sent: 15 October 2022 17:18
To: devel@edk2.groups.io
Cc: Ray Ni ; Michael D Kinney ; 
Sunil V L ; Attar, AbdulLateef (Abdul Lateef) 
; Leif Lindholm 
Subject: [tianocore-docs][PATCH V2 2/2] edk II C Coding Standard: Updates 4.2 
and 4.3 sections

From: Abner Chang 

Updates 4.2 Directory names and 4.3 file names for the guidelines of module 
directory and file naming.

PR: 
https://github.com/tianocore-docs/edk2-CCodingStandardsSpecification/pull/2/files

Signed-off-by: Abner Chang 
Cc: Ray Ni 
Cc: Michael D Kinney 
Cc: Sunil V L 
Cc: Abdul Lateef Attar 
Cc: Leif Lindholm 
---
 4_naming_conventions/42_directory_names.md | 101 +++
 4_naming_conventions/43_file_names.md  | 108 -
 2 files changed, 208 insertions(+), 1 deletion(-)

diff --git a/4_naming_conventions/42_directory_names.md 
b/4_naming_conventions/42_directory_names.md
index 766ccb1..959a3c9 100644
--- a/4_naming_conventions/42_directory_names.md
+++ b/4_naming_conventions/42_directory_names.md
@@ -2,6 +2,7 @@
   4.2 Directory Names

   Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
+  Copyright (c) 2022, Intel Corporation. All rights reserved.

   Redistribution and use in source (original document form) and 'compiled'
   forms (converted to PDF, epub, HTML and other formats) with or without @@ 
-28,3 +29,103 @@
   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 -->
+
+## 4.2 Directory Names
+Below sections are the directory naming guidelines for EDK II modules.
+The guidelines are not just considering the the uniformity of directory
+naming, but it also provides the flexibility of directory name
+construction for the scenario of different EDK II module designs; such
+as the support for multiple processor architectures and vendors. It may
+require the further discussions between EDK II maintainers and contributors in 
order to determine the best naming of the EDK II module directory.
+
+ 4.2.1 EDKII package directory
+
+```
+Pkg
+
+REQUIRED  *
+```
+
+ 4.2.2 EDKII Module directory
+
+* The guideline below is applied to all CPU architectures support, specific 
CPU architecture and vendors support, or the implementation is shared by 
certain CPU archs:
+```
+[[]]
+  or
+[/[/]]
+
+ REQUIRED*
+   REQUIREDBase, Sec, Pei, Dxe, DxeRuntime, Mm, 
StandaloneMm, Smm,
+  Uefi.
+ OPTIONALThe  is represented with a BNF,
+   ::='Ia32' | 'X64' | 'Arm' | 'AArch64' | 
'RiscV64' |
+'LoongArch64' | 'Ebc'
+   ::= []*
+
+  Example: Ia32X64Arm or RiscV64LoongArch64
+
+  OPTIONAL*
+
+Example:
+   - SmbiosDxe/
+   - CpuDxe/# First implementation of CpuDxe.
+   - CpuDxeIa32X64Amd/  # Ia32 and X64 AMD specific implementation.
+   - CpuDxe/RiscV64/# RiscV64 specific implementation.
+   /# Common files for the RiscV64 and other archs.
+   - CpuDxe/Ia32X64/Amd/# Ia32 and X64 AMD specific implementation.
+   /# Common files for Ia32 and X64 archs.
+   /ArmAArch64/ # Arm and AArch64 implementation of CpuDxe.
+   /# Common files for the Arm, AArch64, Ia32 and 
X64.
+```
+
+* If the implementation does not have any shared code between phases (e.g.
+MdeModulePkg/Universal/PCD). The guideline below is applied to all CPU 
architectures support, specific CPU architecture and vendors support, or the 
implementation is shared by certain CPU archs:
+
+```
+/[/[/]]
+
+ REQUIRED*
+   REQUIREDBase, Sec, Pei, Dxe, DxeRuntime, Mm, 
StandaloneMm, Smm,
+  Uefi.
+ OPTIONALThe  is represented with a BNF,
+   ::='Ia32' | 'X64' | 'Arm' | 'AArch64' | 
'RiscV64' |
+'LoongArch64' | 'Ebc'
+   ::= []*
+
+  Example: Ia32X64Arm or RiscV64LoongArch64
+  OPTIONAL*
+Example:
+   Pcd/Dxe/
+```
+
+ 4.2.2 EDKII Library directory
+```
+[[]][]
+  or
+[]/[[/]]
+
+ REQUIRED Base, Sec, Pei, Dxe, DxeRuntime, Mm,
+ StandaloneMm, Smm, Uefi.
+   OPTIONAL The  is represented with a BNF,
+  ::='Ia32' | 'X64' | 'Arm' | 
'AArch64' | 'RiscV64' |
+   'LoongArch64' | 'Ebc'
+  ::= []*
+
+ Example: Ia32X64Arm or RiscV64LoongArch64
+OPTIONAL *
+  REQUIRED *
+OPTIONAL * (Typically name of PPI, Protocol, 
LibraryClass
+

Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device path

2022-10-13 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Review please

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Attar, 
AbdulLateef (Abdul Lateef) via groups.io
Sent: 16 September 2022 12:58
To: devel@edk2.groups.io; Eric Dong ; Liming Gao 

Subject: Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

[Public]

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


[Public]

Hello Maintainers, Reviewers,
Could you please review the patch?
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 13 July 2022 09:49
To: 'devel@edk2.groups.io' ; 'Eric Dong' 
; 'Liming Gao' 
Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

Maintainers, Reviewers,
 please review the patch.
Thanks
AbduL


-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 25 April 2022 12:45
To: devel@edk2.groups.io; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

Hi,
   Please review the patch.
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: 05 April 2022 11:25
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

[Public]

Hi,
   Could you please review the patch?
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 15 March 2022 10:16
To: devel@edk2.groups.io
Cc: Eric Dong ; Liming Gao 
Subject: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device 
path

[CAUTION: External Email]

(Resending patch with [edk2-platforms] prefix with correct emailid).
GCC compiler puts the DevicePath PCDs to the read-only section. During boot if 
try to process the device path after PtrGetPtr it throws a page fault exception.

Hence making a local copy using DuplicateDevicePath() to avoid the page fault 
exception.

REF : 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fabdattar%2Fedk2-platforms%2Ftree%2FBoardModulePkgdata=05%7C01%7CAbdulLateef.Attar%40amd.com%7C8ed1e10f30a44c51ed8808da97e873c5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637989321879784020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=GL91Bvyavwj0eK%2F81WXVp7LDVSu2MHJudT%2BdNIa99jU%3Dreserved=0

Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (1):
  BoardModulePkg: Copy device path before processing

 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 
++-
 1 file changed, 14 insertions(+), 5 deletions(-)

--
2.25.1














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




Re: [edk2-devel] The principles of EDK2 module reconstruction for archs

2022-09-29 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
Hi Abner,
Looks good to me.
Reviewed-by:  Abdul Lateef Attar 

Thanks
AbduL

-Original Message-
From: Chang, Abner  
Sent: 28 September 2022 20:31
To: Sunil V L ; devel@edk2.groups.io; ray...@intel.com
Cc: Kinney, Michael D ; lichao 
; Kirkendall, Garrett ; Grimes, 
Paul ; He, Jiangang ; Attar, 
AbdulLateef (Abdul Lateef) ; Leif Lindholm 
; Andrew Fish 
Subject: RE: [edk2-devel] The principles of EDK2 module reconstruction for archs

[AMD Official Use Only - General]

I just had created PR to update edkII C coding standard spec for the file and 
directory naming. We can review and confirm this update first and then go back 
to the principles of EDK2 module reconstruction for archs.
Here is the PR:
https://github.com/tianocore-docs/edk2-CCodingStandardsSpecification/pull/2

The naming rule is mainly for the new module or new file IMO. Some existing 
module may not meet the guidelines mentioned in this spec. Thus we need the 
principles of EDK2 module reconstruction on the existing module to support 
other processor archs and not impacting the existing platforms (e.g. rename the 
INF file or directory to meet the guidelines).

Sunil, seems RISC-V CpuDxe meet the guideline. Please check it.
Just feel that having  CpuDxe.c to Riscv64 folder is not quite a best solution. 
I think at least we can abstract the protocol structure and protocol 
installation under CpuDxe\ and have the arch implementation under arch folder. 
We can discuss this later after we confirming the guideline and principles.

Thanks
Abner

> -Original Message-
> From: Sunil V L 
> Sent: Wednesday, September 28, 2022 3:34 PM
> To: devel@edk2.groups.io; ray...@intel.com
> Cc: Chang, Abner ; Kinney, Michael D 
> ; lichao ; Kirkendall, 
> Garrett ; Grimes, Paul 
> ; He, Jiangang ; Attar, 
> AbdulLateef (Abdul Lateef) ; Leif Lindholm 
> ; Andrew Fish 
> Subject: Re: [edk2-devel] The principles of EDK2 module reconstruction 
> for archs
> 
> Caution: This message originated from an External Source. Use proper 
> caution when opening attachments, clicking links, or responding.
> 
> 
> On Wed, Sep 28, 2022 at 03:33:45AM +, Ni, Ray wrote:
> Hi Ray,
> >
> >   1.  When a new arch's implementation is introduced to the existing
> module which was developed for the specific arch:
> >
> >   1.  The folder reconstruction:
> >
> >   *   Create arch folder for the existing arch implementation
> > [Ray] Do you move existing arch implementation to that arch folder? 
> > It will
> break existing platforms a lot.
> >
> >   *   Create the arch folder for the new introduced arch
> > [Ray] I agree. But if we don't create arch folder for existing arch
> implementation, the pkg layout will be a mess.
> >
> > [Ray] Hard for me to understand all the principles here. Maybe we 
> > review
> existing code including to-be-upstreamed code and decide how to go.
> >
> 
> Could you please take a look below changes which is trying to add 
> RISC-V support for CpuDxe?
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftianocore%2Fedk2-
> staging%2Fcommit%2Fbba1a11be47dd091734e185afbed73ea75708749
> data=05%7C01%7Cabner.chang%40amd.com%7Ca419e6a010d34fde464b08d
> aa123e080%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63799947
> 2732494527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj
> oiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csd
> ata=Vq6pJLnn8yJrJhFZn7LfLbZzrtpG4n1VLWgAil6J38U%3Dreserved=0
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftianocore%2Fedk2-
> staging%2Fcommit%2F7fccf92a97a6d0618a20f1060e78b3687906da
> ta=05%7C01%7Cabner.chang%40amd.com%7Ca419e6a010d34fde464b08daa1
> 23e080%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63799947273
> 2494527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV
> 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata
> =xFmvUv58vh4AUAM17Qy9G5jZWFZlK2Ozt3njpG1e8%2BY%3Dreserv
> ed=0
> 
> What do you suggest with above example?
> 
> 1) Common INF for all architectures - but modify INF alone, no X86 
> folder creation.
> 
> This is what I have done in the commit above. May be of least impact 
> to existing code since it is only INF change. But like you mentioned 
> this is bit weird that X86 files will remain in root folder directly 
> along with some common files.
> 
> 2) Common INF (CpuDxe.inf) + create arch folders X86, X64, IA32, 
> RiscV64 etc
> 
> IMO, this is probably the best approach. What would be the challenges 
> with this?
> 
> 3) Separate INF for arch like CpuDxe.inf for x86, CpuDxeRiscV64.inf for 
> RISC-V.
> 
> This again probably is not a good idea.
> 
> 4) If the module/library is specific to one arch (ex: SMM(X86), 
> SBI(RISC-V)), then create separate INF.
> 
> Thanks!
> Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94534): https://edk2.groups.io/g/devel/message/94534
Mute This Topic: https://groups.io/mt/93872791/21656
Group Owner: 

Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device path

2022-09-16 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hello Maintainers, Reviewers,
Could you please review the patch?
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 13 July 2022 09:49
To: 'devel@edk2.groups.io' ; 'Eric Dong' 
; 'Liming Gao' 
Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

Maintainers, Reviewers,
 please review the patch.
Thanks
AbduL


-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 25 April 2022 12:45
To: devel@edk2.groups.io; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

Hi,
   Please review the patch.
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: 05 April 2022 11:25
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

[Public]

Hi,
   Could you please review the patch?
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 15 March 2022 10:16
To: devel@edk2.groups.io
Cc: Eric Dong ; Liming Gao 
Subject: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device 
path

[CAUTION: External Email]

(Resending patch with [edk2-platforms] prefix with correct emailid).
GCC compiler puts the DevicePath PCDs to the read-only section. During boot if 
try to process the device path after PtrGetPtr it throws a page fault exception.

Hence making a local copy using DuplicateDevicePath() to avoid the page fault 
exception.

REF : 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fabdattar%2Fedk2-platforms%2Ftree%2FBoardModulePkgdata=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cdd04fc2187754979081008da063ebd5d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637829164332474465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=MX%2FlzKO2jVyPHaaURb7b8kMyNWFAlMPZ%2B0gK%2Ffrh5xo%3Dreserved=0

Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (1):
  BoardModulePkg: Copy device path before processing

 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 
++-
 1 file changed, 14 insertions(+), 5 deletions(-)

--
2.25.1









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




Re: [edk2-devel] Hard Feature Freeze starts now for edk2-stable202208

2022-08-24 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Liming, Zhiguang,
You can revert the patch, I will re-submit the patch for the next release.
Thanks
AbduL

From: gaoliming 
Sent: 24 August 2022 12:50
To: devel@edk2.groups.io; zhiguang@intel.com; Attar, AbdulLateef (Abdul 
Lateef) 
Cc: llind...@qti.qualcomm.com; 'Andrew Fish' ; 'Kinney, 
Michael D' ; 'Demeter, Miki' 
; zhichao@intel.com
Subject: 回复: [edk2-devel] Hard Feature Freeze starts now for edk2-stable202208

[CAUTION: External Email]
Zhiguang:
 Thank you!

Abdul:
  Can you give your response before tomorrow? I need to create the stable tag 
on 2022-08-26

Thanks
Liming
发件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> 代表 Zhiguang Liu
发送时间: 2022年8月23日 13:16
收件人: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>; 'Abdul Lateef 
Attar' mailto:abdat...@amd.com>>
抄送: llind...@qti.qualcomm.com; 'Andrew Fish' 
mailto:af...@apple.com>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Demeter, Miki 
mailto:miki.deme...@intel.com>>
主题: Re: [edk2-devel] Hard Feature Freeze starts now for edk2-stable202208

Hi Liming,
I thought this won’t be an impact because it is unit test code and won’t affect 
real BIOS code.
Sorry I didn’t follow the process, and I am ok to revert it.

Thanks
Zhiguang

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of gaoliming via 
groups.io
Sent: Tuesday, August 23, 2022 1:08 PM
To: devel@edk2.groups.io; Liu, Zhiguang 
mailto:zhiguang@intel.com>>; 'Abdul Lateef Attar' 
mailto:abdat...@amd.com>>
Cc: llind...@qti.qualcomm.com; 'Andrew Fish' 
mailto:af...@apple.com>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Demeter, Miki 
mailto:miki.deme...@intel.com>>
Subject: 回复: [edk2-devel] Hard Feature Freeze starts now for edk2-stable202208

Abdul and Zhiguang:
 Now, we are still in Hard Feature Freeze phase. In this phase, there is no 
feature to be pushed. Below two changes are two features. I suggest to revert 
them for this stable tag. They can be merged again after this stable tag is 
created.

ShellPkg: Adds Local APIC parser to AcpiView

UefiCpuPkg/CpuPageTableLib/UnitTest: Add host based unit test

Thanks
Liming
发件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> 代表 gaoliming via groups.io
发送时间: 2022年8月15日 13:02
收件人: devel@edk2.groups.io; 
annou...@edk2.groups.io
抄送: 'Leif Lindholm' mailto:l...@nuviainc.com>>; 'Andrew 
Fish' mailto:af...@apple.com>>; 'Michael D Kinney' 
mailto:michael.d.kin...@intel.com>>; 'Demeter, 
Miki' mailto:miki.deme...@intel.com>>
主题: [edk2-devel] Hard Feature Freeze starts now for edk2-stable202208

Hi, all

Today, we enter into Hard Feature Freeze phase until edk2-stable202208 tag is 
created at 2022-08-26. In this phase, there is no feature to be pushed. The 
critical bug fix is still allowed.

If the patch is sent after Hard Feature Freeze, and plans to catch this stable 
tag, please add edk2-stable202208 key words in the patch title and BZ, and also 
cc to Tianocore Stewards, then Stewards can give the comments.

Below is edk2-stable202208 tag planning 
(https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning).

Date (00:00:00 UTC-8) Description
2022-05-27  Beginning of development
2022-08-08  Soft Feature Freeze
2022-08-12  Hard Feature Freeze
2022-08-26  Release

Thanks
Liming



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




Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device path

2022-07-15 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Maintainers, Reviewers,
 please review the patch.
Thanks
AbduL


-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 25 April 2022 12:45
To: devel@edk2.groups.io; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

Hi,
   Please review the patch.
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: 05 April 2022 11:25
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

[Public]

Hi,
   Could you please review the patch?
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 15 March 2022 10:16
To: devel@edk2.groups.io
Cc: Eric Dong ; Liming Gao 
Subject: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device 
path

[CAUTION: External Email]

(Resending patch with [edk2-platforms] prefix with correct emailid).
GCC compiler puts the DevicePath PCDs to the read-only section. During boot if 
try to process the device path after PtrGetPtr it throws a page fault exception.

Hence making a local copy using DuplicateDevicePath() to avoid the page fault 
exception.

REF : 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fabdattar%2Fedk2-platforms%2Ftree%2FBoardModulePkgdata=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cdd04fc2187754979081008da063ebd5d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637829164332474465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=MX%2FlzKO2jVyPHaaURb7b8kMyNWFAlMPZ%2B0gK%2Ffrh5xo%3Dreserved=0

Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (1):
  BoardModulePkg: Copy device path before processing

 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 
++-
 1 file changed, 14 insertions(+), 5 deletions(-)

--
2.25.1









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




Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device path

2022-04-25 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi,
   Please review the patch.
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: 05 April 2022 11:25
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Eric Dong ; Liming Gao 

Subject: RE: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy 
device path

[Public]

Hi,
   Could you please review the patch?
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 15 March 2022 10:16
To: devel@edk2.groups.io
Cc: Eric Dong ; Liming Gao 
Subject: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device 
path

[CAUTION: External Email]

(Resending patch with [edk2-platforms] prefix with correct emailid).
GCC compiler puts the DevicePath PCDs to the read-only section. During boot if 
try to process the device path after PtrGetPtr it throws a page fault exception.

Hence making a local copy using DuplicateDevicePath() to avoid the page fault 
exception.

REF : 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fabdattar%2Fedk2-platforms%2Ftree%2FBoardModulePkgdata=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cdd04fc2187754979081008da063ebd5d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637829164332474465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=MX%2FlzKO2jVyPHaaURb7b8kMyNWFAlMPZ%2B0gK%2Ffrh5xo%3Dreserved=0

Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (1):
  BoardModulePkg: Copy device path before processing

 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 
++-
 1 file changed, 14 insertions(+), 5 deletions(-)

--
2.25.1









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




Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device path

2022-04-05 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi,
   Could you please review the patch?
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 15 March 2022 10:16
To: devel@edk2.groups.io
Cc: Eric Dong ; Liming Gao 
Subject: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device 
path

[CAUTION: External Email]

(Resending patch with [edk2-platforms] prefix with correct emailid).
GCC compiler puts the DevicePath PCDs to the read-only section. During boot if 
try to process the device path after PtrGetPtr it throws a page fault exception.

Hence making a local copy using DuplicateDevicePath() to avoid the page fault 
exception.

REF : 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fabdattar%2Fedk2-platforms%2Ftree%2FBoardModulePkgdata=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cdd04fc2187754979081008da063ebd5d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637829164332474465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=MX%2FlzKO2jVyPHaaURb7b8kMyNWFAlMPZ%2B0gK%2Ffrh5xo%3Dreserved=0

Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (1):
  BoardModulePkg: Copy device path before processing

 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 19 
++-
 1 file changed, 14 insertions(+), 5 deletions(-)

--
2.25.1








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




Re: [edk2-devel] [PATCH v5 0/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2022-03-17 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
Gentle reminder for PR.

-Original Message-
From: Gao, Zhichao  
Sent: Monday, February 21, 2022 1:10 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Ni, Ray ; Sami Mujawar 
Subject: RE: [PATCH v5 0/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

[CAUTION: External Email]

Patchset Reviewed-by: Zhichao Gao 

Thanks,
Zhichao

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Wednesday, February 16, 2022 7:14 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Gao, Zhichao ; 
> Sami Mujawar 
> Subject: [PATCH v5 0/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield 
> parser
>
> Hi,
>   Sorry for the delayed reply.
> I had updated the patch according to the review comments.
> Please review the updated patch.
>
> REF: 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Fabdattar%2Fedk2%2Ftree%2FFadtFlagsParserV5data=04%7C01%7
> CAbdulLateef.Attar%40amd.com%7Cdbcced5d461947c4c52908d9f50d60e9%7C3dd8
> 961fe4884e608e11a82d994e183d%7C0%7C0%7C637810260090713957%7CUnknown%7C
> TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVC
> I6Mn0%3D%7C3000sdata=lqrY9GyWZTJl%2BsRa%2F223ft8ei5rKBbm36av4SQh4
> l9g%3Dreserved=0
>
>
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Sami Mujawar 
>
> Abdul Lateef Attar (2):
>   ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser
>   ShellPkg/AcpiView: PrintFormatter for FADT Flags field
>
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h  |  48
> +
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c  | 188
> 
>  
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
> | 167 +++--
>  3 files changed, 348 insertions(+), 55 deletions(-)
>
> --
> 2.25.1



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




Re: [edk2-devel] [PATCH v2 0/1] MdePkg/Include SMBIOS 3.5.0 changes

2022-02-23 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
Hi,
   Gentle reminder, Please review the patch.
Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: Friday, January 7, 2022 7:26 PM
To: devel@edk2.groups.io
Cc: Michael D Kinney ; Liming Gao 
; Zhiguang Liu 
Subject: [edk2-devel] [PATCH v2 0/1] MdePkg/Include SMBIOS 3.5.0 changes

[CAUTION: External Email]

Rebase the patch and fix the uncrustify.

Reference: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fabdattar%2Fedk2%2Ftree%2Fsmbios_3_5_0_v2data=04%7C01%7CAbdulLateef.Attar%40amd.com%7C4ecac07fa9984365a0dc08d9d1e55c29%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637771605907726617%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=83AEIB%2BmxsZrv9vXDy%2FcEYRQx30r2dZHqlaiFPnAT4I%3Dreserved=0

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 

Abdul Lateef Attar (1):
  MdePkg/Include: Smbios Specification 3.5.0 changes

 MdePkg/Include/IndustryStandard/SmBios.h | 144 +++-
 1 file changed, 140 insertions(+), 4 deletions(-)

--
2.25.1








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




Re: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2022-01-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Sami,
Why Bugzilla ticket required?
Also please see inline for my response [Abdul].
Thanks
AbduL

From: devel@edk2.groups.io  On Behalf Of Sami Mujawar via 
groups.io
Sent: 19 January 2022 22:17
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Ray Ni ; Zhichao Gao ; nd 

Subject: Re: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER 
bitfield parser

[CAUTION: External Email]

Hi Abdul,

Please also create a bugzilla ticket and add a reference to it in the commit 
message.

Regards,

Sami Mujawar

On 19/01/2022 04:44 PM, Sami Mujawar wrote:

Hi Abdul,

Thank you for providing a patch to add this feature to Acpiview.

I have some minor feedback marked inline as [SAMI].

Regards,

Sami Mujawar

On 19/12/2021 02:44 PM, Abdul Lateef Attar wrote:

Adds ParseAcpiBitFields() which is based on

ParseAcpi() and capable of parsing the bit fields.

Supports parsing of UINT8, UINT16, UINT32 and UINT64 byte data.



Cc: Ray Ni 

Cc: Zhichao Gao 

Cc: Sami Mujawar 

Signed-off-by: Abdul Lateef Attar 

---

 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h |  45 +

 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 185 


 2 files changed, 230 insertions(+)



diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

index 5c916a4720b8..83266e8ec2d3 100644

--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

@@ -2,6 +2,7 @@

   Header file for ACPI parser







   Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.



+  Copyright (c) 2021, AMD Incorporated. All rights reserved.



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



 **/







@@ -251,6 +252,11 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, 
VOID *Context);

   the field data. If the field is more complex and requires additional



   processing for formatting and representation a print formatter function



   can be specified in 'PrintFormatter'.



+



+  ParseAcpiBitFields() uses AcpiParser structure to parse the bit fields.



+  It considers Length as a number of bits that need to be parsed.



+  Also, the Offset field will be considered as starting offset of the bitfield.



+



   The PrintFormatter function may choose to use the format string



   specified by 'Format' or use its own internal format string.







@@ -264,10 +270,12 @@ typedef struct AcpiParser {





   /// The length of the field.



   /// (Byte Length column from ACPI table spec)



+  /// Length(in bits) of the bitfield if used with ParseAcpiBitFields().



   UINT32   Length;







   /// The offset of the field from the start of the table.



   /// (Byte Offset column from ACPI table spec)



+  /// The Bit offset of the field if used with ParseAcpiBitFields().



   UINT32   Offset;







   /// Optional Print() style format string for tracing the data. If not



@@ -364,6 +372,43 @@ ParseAcpi (

   IN UINT32 ParserItems



   );







+/**



+  This function is used to parse an ACPI table bitfield buffer.



+



+  The ACPI table buffer is parsed using the ACPI table parser information



+  specified by a pointer to an array of ACPI_PARSER elements. This parser



+  function iterates through each item on the ACPI_PARSER array and logs the 
ACPI table bitfields.



+



+  This function can optionally be used to parse ACPI tables and fetch specific



+  field values. The ItemPtr member of the ACPI_PARSER structure (where used)



+  is updated by this parser function to point to the selected field data



+  (e.g. useful for variable length nested fields).



+



+  @param [in] TraceTrace the ACPI fields TRUE else only parse the



+   table.



+  @param [in] Indent   Number of spaces to indent the output.



+  @param [in] AsciiNameOptional pointer to an ASCII string that describes



+   the table being parsed.



+  @param [in] Ptr  Pointer to the start of the buffer.



+  @param [in] Length   Length of the buffer pointed by Ptr.



+  @param [in] Parser   Pointer to an array of ACPI_PARSER structure that



+   describes the table being parsed.



+  @param [in] ParserItems  Number of items in the ACPI_PARSER array.



+



+  @retval Number of bits parsed.



+**/



+UINT32



+EFIAPI



+ParseAcpiBitFields (



+  IN BOOLEANTrace,



+  IN UINT32 Indent,



+  IN CONST CHAR8*AsciiName OPTIONAL,



+  IN UINT8  *Ptr,



+  IN UINT32 Length,



+  IN CONST ACPI_PARSER  *Parser,



+  IN UINT32 ParserItems



+  );



+



 /**



This is a helper macro 

Re: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2022-01-18 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only]

Hi Zhichao Gao, Ray Ni,
Could you please review the below patches and merge the changes?
Thanks
AbduL

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 07 January 2022 08:29
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Ray Ni ; Zhichao Gao ; Sami 
Mujawar 
Subject: RE: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER 
bitfield parser

Gentle reminder...please review and merge the changeset.

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 19 December 2021 20:15
To: devel@edk2.groups.io
Cc: Ray Ni ; Zhichao Gao ; Sami 
Mujawar 
Subject: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER 
bitfield parser

[CAUTION: External Email]

Adds ParseAcpiBitFields() which is based on
ParseAcpi() and capable of parsing the bit fields.
Supports parsing of UINT8, UINT16, UINT32 and UINT64 byte data.

Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Sami Mujawar 
Signed-off-by: Abdul Lateef Attar 
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h |  45 +  
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 185 

 2 files changed, 230 insertions(+)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 5c916a4720b8..83266e8ec2d3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -2,6 +2,7 @@
   Header file for ACPI parser



   Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

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

 **/



@@ -251,6 +252,11 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, 
VOID *Context);
   the field data. If the field is more complex and requires additional

   processing for formatting and representation a print formatter function

   can be specified in 'PrintFormatter'.

+

+  ParseAcpiBitFields() uses AcpiParser structure to parse the bit fields.

+  It considers Length as a number of bits that need to be parsed.

+  Also, the Offset field will be considered as starting offset of the bitfield.

+

   The PrintFormatter function may choose to use the format string

   specified by 'Format' or use its own internal format string.



@@ -264,10 +270,12 @@ typedef struct AcpiParser {


   /// The length of the field.

   /// (Byte Length column from ACPI table spec)

+  /// Length(in bits) of the bitfield if used with ParseAcpiBitFields().

   UINT32   Length;



   /// The offset of the field from the start of the table.

   /// (Byte Offset column from ACPI table spec)

+  /// The Bit offset of the field if used with ParseAcpiBitFields().

   UINT32   Offset;



   /// Optional Print() style format string for tracing the data. If not

@@ -364,6 +372,43 @@ ParseAcpi (
   IN UINT32 ParserItems

   );



+/**

+  This function is used to parse an ACPI table bitfield buffer.

+

+  The ACPI table buffer is parsed using the ACPI table parser
+ information

+  specified by a pointer to an array of ACPI_PARSER elements. This
+ parser

+  function iterates through each item on the ACPI_PARSER array and logs the 
ACPI table bitfields.

+

+  This function can optionally be used to parse ACPI tables and fetch
+ specific

+  field values. The ItemPtr member of the ACPI_PARSER structure (where
+ used)

+  is updated by this parser function to point to the selected field
+ data

+  (e.g. useful for variable length nested fields).

+

+  @param [in] TraceTrace the ACPI fields TRUE else only parse the

+   table.

+  @param [in] Indent   Number of spaces to indent the output.

+  @param [in] AsciiNameOptional pointer to an ASCII string that describes

+   the table being parsed.

+  @param [in] Ptr  Pointer to the start of the buffer.

+  @param [in] Length   Length of the buffer pointed by Ptr.

+  @param [in] Parser   Pointer to an array of ACPI_PARSER structure that

+   describes the table being parsed.

+  @param [in] ParserItems  Number of items in the ACPI_PARSER array.

+

+  @retval Number of bits parsed.

+**/

+UINT32

+EFIAPI

+ParseAcpiBitFields (

+  IN BOOLEANTrace,

+  IN UINT32 Indent,

+  IN CONST CHAR8*AsciiName OPTIONAL,

+  IN UINT8  *Ptr,

+  IN UINT32 Length,

+  IN CONST ACPI_PARSER  *Parser,

+  IN UINT32 ParserItems

+  );

+

 /**

This is a helper macro to pass parameters to the Parser functions.



diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index cb193a5ea449..94ee26f42ab9 100644
--- 

Re: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2022-01-06 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only]

Gentle reminder...please review and merge the changeset.

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: 19 December 2021 20:15
To: devel@edk2.groups.io
Cc: Ray Ni ; Zhichao Gao ; Sami 
Mujawar 
Subject: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER 
bitfield parser

[CAUTION: External Email]

Adds ParseAcpiBitFields() which is based on
ParseAcpi() and capable of parsing the bit fields.
Supports parsing of UINT8, UINT16, UINT32 and UINT64 byte data.

Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Sami Mujawar 
Signed-off-by: Abdul Lateef Attar 
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h |  45 +  
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 185 

 2 files changed, 230 insertions(+)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 5c916a4720b8..83266e8ec2d3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -2,6 +2,7 @@
   Header file for ACPI parser



   Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

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

 **/



@@ -251,6 +252,11 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, 
VOID *Context);
   the field data. If the field is more complex and requires additional

   processing for formatting and representation a print formatter function

   can be specified in 'PrintFormatter'.

+

+  ParseAcpiBitFields() uses AcpiParser structure to parse the bit fields.

+  It considers Length as a number of bits that need to be parsed.

+  Also, the Offset field will be considered as starting offset of the bitfield.

+

   The PrintFormatter function may choose to use the format string

   specified by 'Format' or use its own internal format string.



@@ -264,10 +270,12 @@ typedef struct AcpiParser {


   /// The length of the field.

   /// (Byte Length column from ACPI table spec)

+  /// Length(in bits) of the bitfield if used with ParseAcpiBitFields().

   UINT32   Length;



   /// The offset of the field from the start of the table.

   /// (Byte Offset column from ACPI table spec)

+  /// The Bit offset of the field if used with ParseAcpiBitFields().

   UINT32   Offset;



   /// Optional Print() style format string for tracing the data. If not

@@ -364,6 +372,43 @@ ParseAcpi (
   IN UINT32 ParserItems

   );



+/**

+  This function is used to parse an ACPI table bitfield buffer.

+

+  The ACPI table buffer is parsed using the ACPI table parser
+ information

+  specified by a pointer to an array of ACPI_PARSER elements. This
+ parser

+  function iterates through each item on the ACPI_PARSER array and logs the 
ACPI table bitfields.

+

+  This function can optionally be used to parse ACPI tables and fetch
+ specific

+  field values. The ItemPtr member of the ACPI_PARSER structure (where
+ used)

+  is updated by this parser function to point to the selected field
+ data

+  (e.g. useful for variable length nested fields).

+

+  @param [in] TraceTrace the ACPI fields TRUE else only parse the

+   table.

+  @param [in] Indent   Number of spaces to indent the output.

+  @param [in] AsciiNameOptional pointer to an ASCII string that describes

+   the table being parsed.

+  @param [in] Ptr  Pointer to the start of the buffer.

+  @param [in] Length   Length of the buffer pointed by Ptr.

+  @param [in] Parser   Pointer to an array of ACPI_PARSER structure that

+   describes the table being parsed.

+  @param [in] ParserItems  Number of items in the ACPI_PARSER array.

+

+  @retval Number of bits parsed.

+**/

+UINT32

+EFIAPI

+ParseAcpiBitFields (

+  IN BOOLEANTrace,

+  IN UINT32 Indent,

+  IN CONST CHAR8*AsciiName OPTIONAL,

+  IN UINT8  *Ptr,

+  IN UINT32 Length,

+  IN CONST ACPI_PARSER  *Parser,

+  IN UINT32 ParserItems

+  );

+

 /**

This is a helper macro to pass parameters to the Parser functions.



diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index cb193a5ea449..94ee26f42ab9 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -2,12 +2,14 @@
   ACPI parser



   Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

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

 **/



 #include 

 #include 

 #include 

+#include 

 #include "AcpiParser.h"

 #include "AcpiView.h"

 #include 

Re: [edk2-devel] [PATCH v3 0/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2021-12-14 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
Hi Zhichao Gao, Ray Ni, Sami Mujawar,
   Please review and create PR if looks good.
Thanks
AbduL

-Original Message-
From: Sami Mujawar  
Sent: Monday, November 22, 2021 11:24 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Ray Ni ; Zhichao Gao ; nd 

Subject: Re: [PATCH v3 0/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

[CAUTION: External Email]

Hi Abdul,

Thank you for this patch series.

This series looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 22/11/2021 10:21 AM, Abdul Lateef Attar wrote:
> Hi Sami, Zhichao,
> Addressed all review comments.
> Created two different patches, one for bitfield parser and another for 
> FADT Flags parser.
>
> Thanks
> AbduL
>
> REF : 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Fabdattar%2Fedk2%2Ftree%2FFadtFlagsParserdata=04%7C01%7CA
> bdulLateef.Attar%40amd.com%7C95999e9fce1346f1eb8608d9ade11d90%7C3dd896
> 1fe4884e608e11a82d994e183d%7C0%7C0%7C637732004653569840%7CUnknown%7CTW
> FpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6
> Mn0%3D%7C3000sdata=%2Btp2oW%2Bo3WoF7b4RnPFot3z5vggrUiwOaL%2FiPl4U
> WHY%3Dreserved=0
>
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Sami Mujawar 
> Signed-off-by: Abdul Lateef Attar  Abdul Lateef 
> Attar (2):
>ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser
>ShellPkg/AcpiView: PrintFormatter for FADT Flags field
>
>   ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h  |  
> 45 +
>   ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c  | 
> 177 
>   ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c |  
> 59 ++-
>   3 files changed, 280 insertions(+), 1 deletion(-)
>



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




Re: [edk2-devel] [edk2-test] [PATCH v1 1/1] SctPkg: Fix X64 build errors for GCC toolchain

2021-11-12 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Heinrich,
Not able to attach the patch to the below Bugzilla link (yet to create 
an account).
Hence attaching the patch with this mail.

Also find the reference branch link below.
https://github.com/abdattar/edk2-test/tree/X64_GCC_Compilation_fix

Thanks
AbduL


-Original Message-
From: devel@edk2.groups.io  On Behalf Of Heinrich 
Schuchardt via groups.io
Sent: 11 November 2021 21:08
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: G Edhaya Chandran ; Barton Gao 
; Gjertsen, Carolyn ; Samer 
El-Haj-Mahmoud ; Eric Jin ; 
Arvin Chen ; Venkatesh, Supreeth 

Subject: Re: [edk2-devel] [edk2-test] [PATCH v1 1/1] SctPkg: Fix X64 build 
errors for GCC toolchain

[CAUTION: External Email]

On 10/26/21 13:42, Abdul Lateef Attar via groups.io wrote:
> Corrects the function declaration/definition by adding EFIAPI.
> Removes duplicate functions.


Unfortunately this mail is not a valid patch:

$ wget 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchew.org%2FEDK2%2F20211026114226.30761-1-abdattar%40amd.com%2Fmboxdata=04%7C01%7CAbdulLateef.Attar%40amd.com%7C69f89e5e843d4f4c090408d9a5295496%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637722419244229218%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=O69zx8gRDRS9%2B4bGupVaKV8R%2FBDQ6fNhz00pVzb9h3w%3Dreserved=0
$ git am mbox --keep-cr
Applying: SctPkg: Fix X64 build errors for GCC toolchain
error: patch fragment without header at line 246: @@ -84,6 +85,7 @@ 
InitializeHIIStringBBTest ( Patch failed at 0001 SctPkg: Fix X64 build errors 
for GCC toolchain

Could you, please, upload the patch to
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2126data=04%7C01%7CAbdulLateef.Attar%40amd.com%7C69f89e5e843d4f4c090408d9a5295496%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637722419244239170%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=mE96wdLHZwXHoneiPcImLwvMLaohiwuYRuuaKQUzY4o%3Dreserved=0

Best regards

Heinrich






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




0001-SctPkg-Fix-X64-build-errors-for-GCC-toolchain.patch
Description: 0001-SctPkg-Fix-X64-build-errors-for-GCC-toolchain.patch


Re: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.

2021-11-04 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Code changes looks good.

Is fwts passing now? I think FWTS has wrong test case.
It expects Global system interrupt number to be zero for APIC interrupt type, 
which is wrong.
In my opinion it should check for Global system interrupt number for zero in 
case of PC-AT interrupt type.

Thanks
AbduL

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Tan, Ming via 
groups.io
Sent: Wednesday, October 27, 2021 12:27 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt 
setting.

[CAUTION: External Email]

REF: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3708data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=rvzXQBpKAzzWr0VGZZoCJyVcJBhOvzvlbdrxzEe1KQk%3Dreserved=0

The original code will cause FWTS V21.08.00 testing failed.
 spcr: SPCR PC-AT compatible IRQ 0xff is invalid
 spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device

Now modify the SpcrAcpi for following:
1. Disable the support of PC-AT compatible IRQ support.
   Now only support IO-APIC interrupt type.
2. Set irq to 0.
3. Set the GSI to the value read from PCI device cfg space 0x3C.
4. Set PCI Flags to 1.

Signed-off-by: Ming Tan 
---
  V2: Fix a typo

 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 86c40e90b8..7ad0c058c8 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -324,7 +324,9 @@ GetPciTypeInfo (
   }



   gSpcrInfo.BaseAddress.Address = BaseAddress;

-  gSpcrInfo.Irq = (UINT8) Irq;

+  gSpcrInfo.InterruptType = 
+ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;

+  gSpcrInfo.Irq = 0;

+  gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq;



   gSpcrInfo.PciDeviceId   = DeviceId;

   gSpcrInfo.PciVendorId   = VendorId;

@@ -332,6 +334,7 @@ GetPciTypeInfo (
   gSpcrInfo.PciDeviceNumber   = (UINT8) Device;

   gSpcrInfo.PciFunctionNumber = (UINT8) Function;

   gSpcrInfo.PciSegment= (UINT8) SegNum;

+  gSpcrInfo.PciFlags  = 1;



 Done:

   if (Resources != NULL) {

--
2.29.2.windows.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82732): 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F82732data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=m6rywrR9G355hZ1IHgi5XCtuYpK52Fu19aQaGZFBtbA%3Dreserved=0
Mute This Topic: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F86622293%2F6129197data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=GrAh49Txcr%2Bd9xAwq1l%2FFo6sGqZZN%2BcXX2Q1TT3ss44%3Dreserved=0
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsubdata=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=CYm4d5gMEDoei40a4lXbB6eEB%2B81It7wXuCu6maMZ5M%3Dreserved=0
 [abdat...@amd.com] -=-=-=-=-=-=



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




Re: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: Update APIC Table based on mode

2021-10-28 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Nate,
I tested on windows 2019 and RHEL 8.3 and it works fine on both OSes.
Thanks
AbduL

-Original Message-
From: Desimone, Nathaniel L  
Sent: 28 October 2021 08:19
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chiu, Chasel ; Liming Gao 
; Dong, Eric 
Subject: Re: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: 
Update APIC Table based on mode

[CAUTION: External Email]

Hi Abdul,

I would prefer to clean up the technical debt and not have the APIC NMI if we 
are in X2APIC mode. Is there any chance you could test this change with Windows 
Server 2019? As long as semi-current Windows + Linux boots I'm fine with 
merging your patch as-is.

Thanks,
Nate

On 10/27/21, 9:33 AM, "Attar, AbdulLateef (Abdul Lateef)" 
 wrote:

[Public]

Hi Nate,
I tested on real hardware with latest linux(didn't tested with older 
OSes).
Note that with X2APIC mode I don't see any issue having APIC NMI structure 
and not having NMI structure.
In both cases OS boots without any issue. Just thought that why to include 
APIC NMI structure in X2APIC mode.

Do you want me to resubmit the patch and include the APIC NMI for X2APIC 
mode?

Thanks
Abdul

-Original Message-
From: Desimone, Nathaniel L 
Sent: 27 October 2021 13:47
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Chiu, Chasel ; Liming Gao 
; Dong, Eric 
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: 
Update APIC Table based on mode

[CAUTION: External Email]

Hi Abdul,

I do agree with you that logically it seems to be the right thing to not 
install the local APIC NMI structure if we install the X2APIC NMI structure 
instead. However, I went and took a look at some of our internal closed source 
code and it appears that even on X2APIC systems we actually install both NMI 
structures. My immediate reaction was to simply consider that a bug, but I am 
worried that this might have been done to workaround some buggy and/or legacy 
OS behavior. I've been trying to find more history on it but that behavior has 
been in our codebase for a very long time. IMHO it would be extremely weird for 
an OS to support X2APIC and have some bug handling X2APIC NMI structures... but 
it is always best to check assumptions.

Can you elaborate on any testing that you have done? Have you tested this 
change on a real HW? If yes, which OS did you try booting? Have you tried any 
older OSes?

Thanks,
Nate

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: Friday, October 22, 2021 7:48 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Liming Gao ; Dong, 
Eric 
Subject: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: 
Update APIC Table based on mode

Detects the APIC mode by calling GetApicMode().
if current platform is in X2APIC mode sets the global mX2ApicEnabled.

Also install the APIC NMI structure only if platform is not in X2APIC mode.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Abdul Lateef Attar 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 35 

 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index f5c4f2c3f1a9..032903029a95 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -3,6 +3,7 @@


 Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.

 Copyright (c) Microsoft Corporation.

+Copyright (c) 2021, AMD Incorporated. All rights reserved.

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



 **/

@@ -947,21 +948,23 @@ InstallMadtFromScratch (
   //

   // Build Local APIC NMI Structures

   //

-  LocalApciNmiStruct.Type   = EFI_ACPI_6_3_LOCAL_APIC_NMI;

-  LocalApciNmiStruct.Length = sizeof 
(EFI_ACPI_6_3_LOCAL_APIC_NMI_STRUCTURE);

-  LocalApciNmiStruct.AcpiProcessorUid = 0xFF;  // Applies to all 
processors

-  LocalApciNmiStruct.Flags= 0x0005;// Flags - 
Edge-tiggered, Active High

-  LocalApciNmiStruct.LocalApicLint= 0x1;

+  if (!mX2ApicEnabled) {

+LocalApciNmiStruct.Type   = EFI_ACPI_6_3_LOCAL_APIC_NMI;

+LocalApciNmiStruct.Length = sizeof
+ (EFI_ACPI_6_3_LOCAL_APIC_NMI_STRUCTURE);

+LocalApciNmiStruct.AcpiProcessorUid = 0xFF;  // Applies to all 
processors

+LocalApciNmiStruct.Flags= 0x0005;// Flags - 
Edge-tiggered, Active High

+LocalApciNmiStruct.LocalApicLint= 0x1;



-  ASSERT (MadtStructsIndex < MaxMadtStructCount);

-  

Re: [edk2-devel] [edk2-[PATCH v1 0/2] APIC table updates

2021-10-27 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only]

Hi Nate,
I'm following below Leszlo's document to submit the patch.
Please let me know how to remove the groups.io web interface.

https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-git-guide-for-edk2-contributors-and-maintainers

Thanks
AbduL

-Original Message-
From: Desimone, Nathaniel L  
Sent: 27 October 2021 13:47
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chiu, Chasel ; Liming Gao 
; Dong, Eric 
Subject: RE: [edk2-[PATCH v1 0/2] APIC table updates

[CAUTION: External Email]

Hi Abdul,

First of all thank you for the patch series. One thing to take note of; 
unfortunately, the groups.io web interface messes up the line endings and makes 
it difficult to apply any patches sent through it. I was able to get your patch 
series to apply, but in the future, would it be possible for you to send your 
patches without using the groups.io web interface?

Thanks Again!
Nate

-Original Message-
From: Abdul Lateef Attar 
Sent: Friday, October 22, 2021 7:48 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Liming Gao ; Dong, 
Eric 
Subject: [edk2-[PATCH v1 0/2] APIC table updates

Fixes the APIC table creation based on APIC mode.
Also fixes the AcpiProcessorUid for multi-socket system.

Abdul Lateef Attar (2):
  MinPlatformPkg: Update APIC Table based on mode
  MinPlatformPkg: AcpiProcessorUid for multi-socket

 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 37 

 1 file changed, 22 insertions(+), 15 deletions(-)

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
--
2.25.1


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




Re: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: Update APIC Table based on mode

2021-10-27 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Nate,
I tested on real hardware with latest linux(didn't tested with older 
OSes).
Note that with X2APIC mode I don't see any issue having APIC NMI structure and 
not having NMI structure.
In both cases OS boots without any issue. Just thought that why to include APIC 
NMI structure in X2APIC mode.

Do you want me to resubmit the patch and include the APIC NMI for X2APIC mode?

Thanks
Abdul

-Original Message-
From: Desimone, Nathaniel L  
Sent: 27 October 2021 13:47
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Chiu, Chasel ; Liming Gao 
; Dong, Eric 
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: 
Update APIC Table based on mode

[CAUTION: External Email]

Hi Abdul,

I do agree with you that logically it seems to be the right thing to not 
install the local APIC NMI structure if we install the X2APIC NMI structure 
instead. However, I went and took a look at some of our internal closed source 
code and it appears that even on X2APIC systems we actually install both NMI 
structures. My immediate reaction was to simply consider that a bug, but I am 
worried that this might have been done to workaround some buggy and/or legacy 
OS behavior. I've been trying to find more history on it but that behavior has 
been in our codebase for a very long time. IMHO it would be extremely weird for 
an OS to support X2APIC and have some bug handling X2APIC NMI structures... but 
it is always best to check assumptions.

Can you elaborate on any testing that you have done? Have you tested this 
change on a real HW? If yes, which OS did you try booting? Have you tried any 
older OSes?

Thanks,
Nate

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: Friday, October 22, 2021 7:48 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Liming Gao ; Dong, 
Eric 
Subject: [edk2-devel] [edk2-platforms] [PATCH v1 1/2] MinPlatformPkg: Update 
APIC Table based on mode

Detects the APIC mode by calling GetApicMode().
if current platform is in X2APIC mode sets the global mX2ApicEnabled.

Also install the APIC NMI structure only if platform is not in X2APIC mode.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Abdul Lateef Attar 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 35 

 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index f5c4f2c3f1a9..032903029a95 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -3,6 +3,7 @@


 Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.

 Copyright (c) Microsoft Corporation.

+Copyright (c) 2021, AMD Incorporated. All rights reserved.

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



 **/

@@ -947,21 +948,23 @@ InstallMadtFromScratch (
   //

   // Build Local APIC NMI Structures

   //

-  LocalApciNmiStruct.Type   = EFI_ACPI_6_3_LOCAL_APIC_NMI;

-  LocalApciNmiStruct.Length = sizeof (EFI_ACPI_6_3_LOCAL_APIC_NMI_STRUCTURE);

-  LocalApciNmiStruct.AcpiProcessorUid = 0xFF;  // Applies to all processors

-  LocalApciNmiStruct.Flags= 0x0005;// Flags - Edge-tiggered, 
Active High

-  LocalApciNmiStruct.LocalApicLint= 0x1;

+  if (!mX2ApicEnabled) {

+LocalApciNmiStruct.Type   = EFI_ACPI_6_3_LOCAL_APIC_NMI;

+LocalApciNmiStruct.Length = sizeof
+ (EFI_ACPI_6_3_LOCAL_APIC_NMI_STRUCTURE);

+LocalApciNmiStruct.AcpiProcessorUid = 0xFF;  // Applies to all 
processors

+LocalApciNmiStruct.Flags= 0x0005;// Flags - Edge-tiggered, 
Active High

+LocalApciNmiStruct.LocalApicLint= 0x1;



-  ASSERT (MadtStructsIndex < MaxMadtStructCount);

-  Status = CopyStructure (

- ,

- (STRUCTURE_HEADER *) ,

- [MadtStructsIndex++]

- );

-  if (EFI_ERROR (Status)) {

-DEBUG ((DEBUG_ERROR, "CopyMadtStructure (APIC NMI) failed: %r\n", Status));

-goto Done;

+ASSERT (MadtStructsIndex < MaxMadtStructCount);

+Status = CopyStructure (

+  ,

+  (STRUCTURE_HEADER *) ,

+  [MadtStructsIndex++]

+  );

+if (EFI_ERROR (Status)) {

+  DEBUG ((DEBUG_ERROR, "CopyMadtStructure (APIC NMI) failed: %r\n", 
+ Status));

+  goto Done;

+}

   }



   //

@@ -1454,6 +1457,10 @@ InstallAcpiPlatform (
   DEBUG ((DEBUG_INFO, "mNumberOfCpus - %d\n", mNumberOfCpus));

   DEBUG ((DEBUG_INFO, "mNumberOfEnabledCPUs - %d\n", mNumberOfEnabledCPUs));



+  if (LOCAL_APIC_MODE_X2APIC == GetApicMode ()) {

+mX2ApicEnabled = TRUE;

+  }

+

   DEBUG ((DEBUG_INFO, "mX2ApicEnabled - 0x%x\n", mX2ApicEnabled));

   DEBUG ((DEBUG_INFO, "mForceX2ApicId - 0x%x\n", mForceX2ApicId));



--
2.25.1



Re: [edk2-devel] [PATCH] ShellPkg: Parse I/O APIC and x2APIC structure

2021-10-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only]

Gentle reminder to merge the code.

-Original Message-
From: Gao, Zhichao  
Sent: 09 September 2021 07:54
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Ni, Ray 
Subject: RE: [edk2-devel] [PATCH] ShellPkg: Parse I/O APIC and x2APIC structure

[CAUTION: External Email]

Reviewed-by: Zhichao Gao 

Thanks,
Zhichao

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Tuesday, August 24, 2021 11:30 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Gao, Zhichao ; 
> Abdul Lateef Attar 
> Subject: [edk2-devel] [PATCH] ShellPkg: Parse I/O APIC and x2APIC 
> structure
>
> Parse and print the below interrupt structures
>   - I/O APIC Structure
>   - Interrupt Source Override Structure
>   - Processor Local x2APIC Structure
>   - Local x2APIC NMI Structure
>
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../Parsers/Madt/MadtParser.c | 99 +++
>  1 file changed, 99 insertions(+)
>
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPars
> er.c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPars
> er.c
> index 15aa2392b6..2ba8c9ae52 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPars
> er.c
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPars
> +++ er.c
> @@ -181,6 +181,57 @@ STATIC CONST ACPI_PARSER GicITSParser[] = {
>{L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL}  };
>
> +/**
> +  An ACPI_PARSER array describing the IO APIC Structure.
> +**/
> +STATIC CONST ACPI_PARSER IoApic[] = {
> +  {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
> +  {L"I/O APIC ID", 1, 2, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Reserved", 1, 3, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"I/O APIC Address", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Global System Interrupt Base", 4, 8, L"0x%x", NULL, NULL, NULL, 
> +NULL} };
> +
> +/**
> +  An ACPI_PARSER array describing the Interrupt Source Override Structure.
> +**/
> +STATIC CONST ACPI_PARSER InterruptSourceOverride[] = {
> +  {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
> +  {L"Bus", 1, 2, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Source", 1, 3, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Global System Interrupt", 4, 4, L"0x%x", NULL, NULL, NULL, 
> +NULL},
> +  {L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL} };
> +
> +
> +/**
> +  An ACPI_PARSER array describing the Processor Local x2APIC Structure.
> +**/
> +STATIC CONST ACPI_PARSER ProcessorLocalX2Apic[] = {
> +  {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
> +  {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
> +
> +  {L"X2APIC ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},  {L"Flags", 
> + 4, 8, L"0x%x", NULL, NULL, NULL, NULL},  {L"ACPI Processor UID", 4, 
> + 12, L"0x%x", NULL, NULL, NULL, NULL} };
> +
> +/**
> +  An ACPI_PARSER array describing the Local x2APIC NMI Structure.
> +**/
> +STATIC CONST ACPI_PARSER LocalX2ApicNmi[] = {
> +  {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL},
> +  {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL},
> +  {L"Flags", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
> +
> +  {L"ACPI Processor UID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL},  
> + {L"Local x2APIC LINT#", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},  
> + {L"Reserved", 3, 9, L"0x%x%x%x", Dump3Chars, NULL, NULL, NULL} };
> +
>  /**
>An ACPI_PARSER array describing the ACPI MADT Table.
>  **/
> @@ -357,6 +408,54 @@ ParseAcpiMadt (
>  break;
>}
>
> +  case EFI_ACPI_6_3_IO_APIC: {
> +ParseAcpi (
> +  TRUE,
> +  2,
> +  "IO APIC",
> +  InterruptContollerPtr,
> +  *MadtInterruptControllerLength,
> +  PARSER_PARAMS (IoApic)
> +  );
> +break;
> +  }
> +
> +  case EFI_ACPI_6_3_INTERRUPT_SOURCE_OVERRIDE: {
> +ParseAcpi (
> +  TRUE,
> +  2,
> +  "INTERRUPT SOURCE OVERRIDE",
> +  InterruptContollerPtr,
> +  *MadtInterruptControllerLength,
> +  PARSER_PARAMS (InterruptSourceOverride)
> +  );
> +break;
> +  }
> +
> +  case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC: {
> +ParseAcpi (
> +  TRUE,
> +  2,
> +  "PROCESSOR LOCAL X2APIC",
> +  InterruptContollerPtr,
> +  *MadtInterruptControllerLength,
> +  PARSER_PARAMS (ProcessorLocalX2Apic)
> +  );
> +break;
> +  }
> +
> +  case EFI_ACPI_6_3_LOCAL_X2APIC_NMI: {
> +ParseAcpi (
> +  TRUE,
> +  2,
> +  "LOCAL x2APIC NMI",
> +  InterruptContollerPtr,
> +  *MadtInterruptControllerLength,
> +  PARSER_PARAMS (LocalX2ApicNmi)
> +  );
> +break;
> +  }
> +
>default: {
>  IncrementErrorCount ();
>