[edk2-devel] [PATCH 1/1] StandaloneMmPkg: Fix the failure to find uncompressed inner FV.

2023-10-23 Thread Xu, Wei6
The MmCoreFfsFindMmDriver only checks for encapsulated compressed FVs.
When an inner FV is uncompressed, StandaloneMmCore will miss the FV and
all the MM drivers in the FV will not be dispatched.
Add checks for uncompressed inner FV to fix this issue.

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Ray Ni 
Signed-off-by: Wei6 Xu 
---
 StandaloneMmPkg/Core/FwVol.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c
index 1f6d7714ba97..1a85d80eb9f7 100644
--- a/StandaloneMmPkg/Core/FwVol.c
+++ b/StandaloneMmPkg/Core/FwVol.c
@@ -104,6 +104,17 @@ MmCoreFfsFindMmDriver (
   break;
 }
 
+Status = FfsFindSectionData (
+   EFI_SECTION_FIRMWARE_VOLUME_IMAGE,
+   FileHeader,
+   ,
+   
+   );
+if (!EFI_ERROR (Status)) {
+  InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData;
+  MmCoreFfsFindMmDriver (InnerFvHeader);
+}
+
 Status = FfsFindSectionData (
EFI_SECTION_GUID_DEFINED,
FileHeader,
-- 
2.29.2.windows.2



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




[edk2-devel] [PATCH 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.

2023-10-23 Thread Xu, Wei6
This patch is to fix the issue that StandaloneMmCore fails to detect 
uncompressed inner FV.
PR: https://github.com/tianocore/edk2/pull/4943

Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Ray Ni 

Wei6 Xu (1):
  StandaloneMmPkg: Fix the failure to find uncompressed inner FV.

 StandaloneMmPkg/Core/FwVol.c | 11 +++
 1 file changed, 11 insertions(+)

-- 
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109985): https://edk2.groups.io/g/devel/message/109985
Mute This Topic: https://groups.io/mt/102152693/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] IpmiFeaturePkg/GenericIpmi: Support Standalone MM

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Lisa,
The patch has the format that can't be applied, neither from email or the 
message on Group.io.
Could you please check your email setting or the options used against Git 
format-patch?

Thank you
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Huang,
> Li-Xia via groups.io
> Sent: Friday, October 20, 2023 2:46 PM
> To: devel@edk2.groups.io
> Cc: Isaac Oram ; Nate DeSimone
> 
> Subject: [edk2-devel] [PATCH v1 1/1] IpmiFeaturePkg/GenericIpmi: Support
> Standalone MM
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Add Standalone Mm Generic Impi driver. And add type 'PcdsFixedAtBuild'
> for PcdIpmiSmmIoBaseAddress to access in StandaloneMm driver
>
> Cc: Isaac Oram 
> Cc: Nate DeSimone 
> Signed-off-by: Lixia Huang 
> ---
>
> Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Standa
> loneMm/StandaloneMmGenericIpmi.c   | 148 
>
> Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Standa
> loneMm/StandaloneMmGenericIpmi.inf |  52 +++
>
> Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
> |   2 +
>  3 files changed, 202 insertions(+)
>
> diff --git
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Stan
> daloneMm/StandaloneMmGenericIpmi.c
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Stan
> daloneMm/StandaloneMmGenericIpmi.c
> new file mode 100644
> index ..52d8d2abdd0d
> --- /dev/null
> +++
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Stan
> daloneMm/StandaloneMmGenericIpmi.c
> @@ -0,0 +1,148 @@
> +/** @file
>
> +  Generic StandaloneMm IPMI stack driver
>
> +
>
> +  @copyright
>
> +  Copyright 2023 Intel Corporation. 
>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +**/
>
> +
>
> +//
>
> +// Statements that include other files
>
> +//
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include 
>
> +#include "IpmiHooks.h"
>
> +#include "IpmiBmcCommon.h"
>
> +#include "IpmiBmc.h"
>
> +#include 
>
> +
>
> +IPMI_BMC_INSTANCE_DATA *mIpmiInstance;
>
> +EFI_HANDLE mHandle;
>
> +
>
> +EFI_STATUS
>
> +SmmInitializeIpmiKcsPhysicalLayer (
>
> +  VOID
>
> +  )
>
> +/*++
>
> +
>
> +Routine Description:
>
> +  Setup and initialize the BMC for the SMM phase.  In order to verify the BMC
> is functioning
>
> +  as expected, the BMC Selftest is performed.  The results are then checked
> and any errors are
>
> +  reported to the error manager.  Errors are collected throughout this 
> routine
> and reported
>
> +  just prior to installing the driver.  If there are more errors than
> MAX_SOFT_COUNT, then they
>
> +  will be ignored.
>
> +
>
> +Arguments:
>
> +  ImageHandle - Handle of this driver image
>
> +  SystemTable - Table containing standard EFI services
>
> +
>
> +Returns:
>
> +  EFI_SUCCESS - Successful driver initialization
>
> +
>
> +--*/
>
> +{
>
> +  EFI_STATUS   Status;
>
> +
>
> +  DEBUG ((DEBUG_INFO,"SmmInitializeIpmiKcsPhysicalLayer entry \n"));
>
> +
>
> +  Status = gMmst->MmAllocatePool (
>
> +EfiRuntimeServicesData,
>
> +sizeof (IPMI_BMC_INSTANCE_DATA),
>
> +(VOID **));
>
> +
>
> +  if (EFI_ERROR (Status)) {
>
> +DEBUG ((DEBUG_ERROR, "mIpmiInstance mem alloc failed - 0x%x\n",
> Status));
>
> +return Status;
>
> +  } else {
>
> +
>
> +//
>
> +// Initialize the KCS transaction timeout. Assume delay unit is 1000 us.
>
> +//
>
> +mIpmiInstance->KcsTimeoutPeriod = (BMC_KCS_TIMEOUT * 1000*1000) /
> KCS_DELAY_UNIT;
>
> +
>
> +//
>
> +// Initialize IPMI IO Base, we still use SMS IO base to get device ID and
> Seltest result since SMM IF may have different cmds supported
>
> +//
>
> +mIpmiInstance->IpmiIoBase   = FixedPcdGet16
> (PcdIpmiSmmIoBaseAddress);
>
> +mIpmiInstance->Signature= SM_IPMI_BMC_SIGNATURE;
>
> +mIpmiInstance->SlaveAddress = BMC_SLAVE_ADDRESS;
>
> +mIpmiInstance->BmcStatus= BMC_NOTREADY;
>
> +mIpmiInstance->IpmiTransport.IpmiSubmitCommand  =
> IpmiSendCommand;
>
> +mIpmiInstance->IpmiTransport.GetBmcStatus   = IpmiGetBmcStatus;
>
> +
>
> +mHandle = NULL;
>
> +Status = gMmst->MmInstallProtocolInterface (
>
> +  ,
>
> +  ,
>
> +  EFI_NATIVE_INTERFACE,
>
> +  >IpmiTransport
>
> +  );
>
> +ASSERT_EFI_ERROR (Status);
>
> +
>
> +DEBUG ((DEBUG_INFO,"SmmInitializeIpmiKcsPhysicalLayer exit \n"));
>
> +
>
> +return EFI_SUCCESS;
>
> +  }
>
> +}
>
> +
>
> +/**
>
> +  The module Entry Point of driver.
>
> +
>
> +  @param  

回复: [edk2-devel] [PATCH v1 2/3] ShellPkg: Add varpolicy dynamic shell command

2023-10-23 Thread gaoliming via groups.io
Michael:
  Will you provide standalone application for varpolicy like tftp?

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael
> Kubacki
> 发送时间: 2023年9月19日 22:33
> 收件人: devel@edk2.groups.io
> 抄送: Zhichao Gao ; Michael D Kinney
> 
> 主题: [edk2-devel] [PATCH v1 2/3] ShellPkg: Add varpolicy dynamic shell
> command
> 
> From: Michael Kubacki 
> 
> Adds a new module (dynamic shell command) to ShellPkg that lists
> variable policy information for all UEFI variables on the system.
> 
> Some other UEFI variable related functionality is also included to
> give a greater sense of platform UEFI variable state. This command
> is intended to help make variable policies more transparent and
> easier to understand and configure on a platform.
> 
> Like all dynamic shell commands, a platform only needs to include
> `VariablePolicyDynamicCommand.inf` in their flash image to have
> the command registered in their UEFI shell.
> 
> Include the following lines in platform DSC (in DXE components section):
> 
> ```
> 
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.inf {
> 
>   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>   }
> ```
> 
> Include the following line in platform FDF:
> 
> ```
> INF
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.inf
> ```
> 
> Cc: Zhichao Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki 
> ---
> 
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.c   | 1009 
> 
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.h   |   94 ++
> 
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.inf |   56 ++
> 
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.uni |   86 ++
>  ShellPkg/ShellPkg.dsc
> |1 +
>  5 files changed, 1246 insertions(+)
> 
> diff --git
> a/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePoli
> cyDynamicCommand.c
> b/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePoli
> cyDynamicCommand.c
> new file mode 100644
> index ..49993f635396
> --- /dev/null
> +++
> b/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePoli
> cyDynamicCommand.c
> @@ -0,0 +1,1009 @@
> +/** @file
> +  Main file for the "varpolicy" dynamic UEFI shell command.
> +
> +  This command can provide detailed UEFI variable policy configuration
> +  information in the UEFI shell.
> +
> +  Copyright (c) Microsoft Corporation.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include "VariablePolicyDynamicCommand.h"
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +#define VAR_POLICY_FLAG_STATS_STRL"-s"
> +#define VAR_POLICY_FLAG_POLICY_STR   L"-p"
> +#define VAR_POLICY_FLAG_VERBOSE_STR  L"-v"
> +
> +#define VAR_POLICY_CMD_MIN_ATTR_STR_LEN  64
> +
> +EFI_HII_HANDLE  mVarPolicyShellCommandHiiHandle = NULL;
> +
> +STATIC CONST SHELL_PARAM_ITEM  ParamList[] = {
> +  { VAR_POLICY_FLAG_POLICY_STR,  TypeFlag },
> +  { VAR_POLICY_FLAG_STATS_STR,   TypeFlag },
> +  { VAR_POLICY_FLAG_VERBOSE_STR, TypeFlag },
> +  { NULL,TypeMax  }
> +};
> +
> +STATIC CONST VAR_POLICY_CMD_VAR_NAMESPACE  mVarNamespaces[]
> = {
> +  {
> +VariableVendorCapsule,
> +,
> +L"Capsule"
> +  },
> +  {
> +VariableVendorCapsuleReport,
> +,
> +L"Capsule Reporting"
> +  },
> +  {
> +VariableVendorGlobal,
> +,
> +L"UEFI Global"
> +  },
> +  {
> +VariableVendorMorControl,
> +,
> +L"Memory Overwrite Request (MOR) Control Lock"
> +  }
> +};
> +
> +/**
> +  Returns UEFI variable attribute information in a string.
> +
> +  AttributesStrSize must at least be
> VAR_POLICY_CMD_MIN_ATTR_STR_LEN in length
> +  or EFI_INVALID_PARAMETER will be returned.
> +
> +  @param[in]  Attributes The UEFI variable attributes.
> +  @param[in]  AttributesStrSize  The size, in bytes, of
AttributesStr.
> +  @param[out] AttributesStr  The Unicode string for the given
> attributes.
> +
> +  @retval EFI_SUCCESS   The attributes were converted to a
> string successfully.
> +  @retval EFI_INVALID_PARAMETER The AttributesStr pointer is NULL.
> +
> +**/
> +EFI_STATUS
> +GetAttributesString (
> +  IN  UINT32  Attributes,
> +  IN  UINTN   AttributesStrSize,
> +  OUT CHAR16  *AttributesStr
> +  )
> +{
> +  if ((AttributesStr == NULL) || (AttributesStrSize <
> VAR_POLICY_CMD_MIN_ATTR_STR_LEN)) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  AttributesStr[0] = L'0';
> +  AttributesStr[1] = L'x';
> +  AttributesStr[2] = L'\0';
> +
> +  UnicodeValueToStringS (AttributesStr + 2, AttributesStrSize - 2,
> (RADIX_HEX), (INT64)Attributes, 30);
> +
> +  if (Attributes == 0) {
> +StrCatS (AttributesStr, 

回复: [edk2-devel] [PATCH v1 1/3] MdeModulePkg/VariablePolicy: Add more granular variable policy querying

2023-10-23 Thread gaoliming via groups.io
Michael:
 The change is good to me. Reviewed-by: Liming Gao


Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael
> Kubacki
> 发送时间: 2023年9月19日 22:33
> 收件人: devel@edk2.groups.io
> 抄送: Dandan Bi ; Hao A Wu ;
> Jian J Wang ; Liming Gao
> 
> 主题: [edk2-devel] [PATCH v1 1/3] MdeModulePkg/VariablePolicy: Add more
> granular variable policy querying
> 
> From: Michael Kubacki 
> 
> Introduces two new APIs to EDKII_VARIABLE_POLICY_PROTOCOL:
>   1. GetVariablePolicyInfo()
>   2. GetLockOnVariableStateVariablePolicyInfo()
> 
> These allow a caller to retrieve policy information associated with
> a UEFI variable given the variable name and vendor GUID.
> 
> GetVariablePolicyInfo() - Returns the variable policy applied to the
> UEFI variable. If the variable policy is applied toward an individual
> UEFI variable, that name can optionally be returned.
> 
> GetLockOnVariableStateVariablePolicyInfo() - Returns the Lock on
> Variable State policy applied to the UEFI variable. If the Lock on
> Variable State policy is applied to a specific variable name, that
> name can optionally be returned.
> 
> These functions can be useful for a variety of purposes such as
> auditing, testing, and functional flows.
> 
> Also fixed some variable name typos in code touched by the changes.
> 
> Cc: Dandan Bi 
> Cc: Hao A Wu 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Michael Kubacki 
> ---
>  MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c|
> 174 --
>  MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c|
> 304 +
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> |   4 +-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c |
> 346 +++-
>  MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h
> |  39 ++-
>  MdeModulePkg/Include/Library/VariablePolicyLib.h  |
> 107 ++
>  MdeModulePkg/Include/Protocol/VariablePolicy.h|
> 133 +++-
>  MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf  |   1
> +
>  8 files changed, 1062 insertions(+), 46 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> index 5de46133bb26..1448af8a 100644
> --- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> +++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> @@ -76,14 +76,20 @@ VarCheckPolicyLibMmiHandler (
>VOID *InternalCommBuffer;
>EFI_STATUS   Status;
>EFI_STATUS   SubCommandStatus;
> -  VAR_CHECK_POLICY_COMM_HEADER
> *PolicyCommmHeader;
> -  VAR_CHECK_POLICY_COMM_HEADER
> *InternalPolicyCommmHeader;
> +  VAR_CHECK_POLICY_COMM_HEADER
> *PolicyCommHeader;
> +  VAR_CHECK_POLICY_COMM_HEADER
> *InternalPolicyCommHeader;
>VAR_CHECK_POLICY_COMM_IS_ENABLED_PARAMS
> *IsEnabledParams;
>VAR_CHECK_POLICY_COMM_DUMP_PARAMS*DumpParamsIn;
>VAR_CHECK_POLICY_COMM_DUMP_PARAMS
> *DumpParamsOut;
> +  VAR_CHECK_POLICY_COMM_GET_INFO_PARAMS
> *GetInfoParamsInternal;
> +  VAR_CHECK_POLICY_COMM_GET_INFO_PARAMS
> *GetInfoParamsExternal;
> +  CHAR16
> *InternalCopyOfOutputVariableName;
> +  CHAR16
> *ExternalCopyOfOutputVariableName;
>UINT8*DumpInputBuffer;
>UINT8*DumpOutputBuffer;
> +  UINTN
> AllowedOutputVariableNameSize;
>UINTNDumpTotalPages;
> +  UINTNLocalSize;
>VARIABLE_POLICY_ENTRY*PolicyEntry;
>UINTNExpectedSize;
>UINT32   TempSize;
> @@ -122,21 +128,21 @@ VarCheckPolicyLibMmiHandler (
>//
>InternalCommBuffer = [0];
>CopyMem (InternalCommBuffer, CommBuffer, InternalCommBufferSize);
> -  PolicyCommmHeader = CommBuffer;
> -  InternalPolicyCommmHeader = InternalCommBuffer;
> +  PolicyCommHeader = CommBuffer;
> +  InternalPolicyCommHeader = InternalCommBuffer;
>// Check the revision and the signature of the comm header.
> -  if ((InternalPolicyCommmHeader->Signature !=
> VAR_CHECK_POLICY_COMM_SIG) ||
> -  (InternalPolicyCommmHeader->Revision !=
> VAR_CHECK_POLICY_COMM_REVISION))
> +  if ((InternalPolicyCommHeader->Signature !=
> VAR_CHECK_POLICY_COMM_SIG) ||
> +  (InternalPolicyCommHeader->Revision !=
> VAR_CHECK_POLICY_COMM_REVISION))
>{
>  DEBUG ((DEBUG_INFO, "%a - Signature or revision are incorrect!\n",
> __func__));
>  // We have verified the buffer is not null and have enough size to
hold
> Result field.
> -PolicyCommmHeader->Result = EFI_INVALID_PARAMETER;
> +PolicyCommHeader->Result = EFI_INVALID_PARAMETER;
>  return EFI_SUCCESS;
>}
> 
>// If we're in the middle of a paginated dump and any other command is
> sent,
>// 

Re: [edk2-devel] [PATCH v1 1/1] IpmiFeaturePkg/GenericIpmi: Support Standalone MM

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Issac is removed.

Hi Lisa,
These two packages are diverging in IPMI transport (GenricIpmi) and some other 
high level drivers such as IpmiCommandLib. I plan to take below actions.
1. Remove IpmiCommandLib from IpmiFeaturePkg, as the IPMI command support in 
ManageabilityPkg has the same functionalities with few newly added IPMI 
commands. This library is independent of IPMI transport interface.
2. Remove Frb, IpmiFru, OsWdt and SolStatus from IpmiFeaturePkg as those were 
migrated to  ManageabilityPkg already.
3. I will get back to GenericIpmi and turn it into ManageabilityPkg framework 
then remove GenericIpmi from IpmiFeaturePkg.

So I would like to take back my suggestion having you to send the patch against 
ManageabilityPkg. As the transport implementation has some gap between these 
two packages.
Thank you
Abner

> -Original Message-
> From: Huang, Li-Xia 
> Sent: Monday, October 23, 2023 1:48 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Isaac Oram ; Desimone, Nathaniel L
> ; Wu, Yidong ; Xu,
> Wei6 
> Subject: RE: [edk2-devel] [PATCH v1 1/1] IpmiFeaturePkg/GenericIpmi:
> Support Standalone MM
>
> [AMD Official Use Only - General]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
>
> Thanks for your feedback.
> Since the IPMI implementation in these two packages are diverging now, and
> my patch has some dependency with common code in IpmiFeaturePkg , it will
> be better to resend this patch after the diverging is done.
>
> Our target schedule is  '23 WW51', could you let me know what's the schedule
> for these two packages'(IpmiFeaturePkg and ManageabilityPkg) diverging?
> Thanks.
>
> Regards,
> Lisa
>
> -Original Message-
> From: Chang, Abner 
> Sent: Saturday, October 21, 2023 10:15 PM
> To: devel@edk2.groups.io; Huang, Li-Xia 
> Cc: Isaac Oram ; Desimone, Nathaniel L
> 
> Subject: RE: [edk2-devel] [PATCH v1 1/1] IpmiFeaturePkg/GenericIpmi:
> Support Standalone MM
>
> [AMD Official Use Only - General]
>
> Hi Lisa,
> Issac was no longer the maintainer of IpmiFeaturePkg as he was retired. Nate
> had sent the maintainers update for review.
> As the conversation I had with Issac, we all agreed IpmiFeaturePkg should be
> deprecated as the IPMI related drivers are now located under
> ManageabilityPkg in edk2-platforms. The IPMI implementation in these two
> packages are diverging now, which is not good.
> Could you please send this patch against ManageabilityPkg? I can help to
> review it, so does Nate as he also proposed himself as the maintainers of
> ManageabilityPkg.
>
> Thanks
> Abner
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Huang,
> > Li-Xia via groups.io
> > Sent: Friday, October 20, 2023 2:46 PM
> > To: devel@edk2.groups.io
> > Cc: Isaac Oram ; Nate DeSimone
> > 
> > Subject: [edk2-devel] [PATCH v1 1/1] IpmiFeaturePkg/GenericIpmi:
> > Support Standalone MM
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Add Standalone Mm Generic Impi driver. And add type 'PcdsFixedAtBuild'
> > for PcdIpmiSmmIoBaseAddress to access in StandaloneMm driver
> >
> > Cc: Isaac Oram 
> > Cc: Nate DeSimone 
> > Signed-off-by: Lixia Huang 
> > ---
> >
> >
> Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Standa
> > loneMm/StandaloneMmGenericIpmi.c   | 148 
> >
> >
> Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Standa
> > loneMm/StandaloneMmGenericIpmi.inf |  52 +++
> >
> >
> Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
> > |   2 +
> >  3 files changed, 202 insertions(+)
> >
> > diff --git
> >
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Stan
> > daloneMm/StandaloneMmGenericIpmi.c
> >
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Stan
> > daloneMm/StandaloneMmGenericIpmi.c
> > new file mode 100644
> > index ..52d8d2abdd0d
> > --- /dev/null
> > +++
> >
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Stan
> > daloneMm/StandaloneMmGenericIpmi.c
> > @@ -0,0 +1,148 @@
> > +/** @file
> >
> > +  Generic StandaloneMm IPMI stack driver
> >
> > +
> >
> > +  @copyright
> >
> > +  Copyright 2023 Intel Corporation. 
> >
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +**/
> >
> > +
> >
> > +//
> >
> > +// Statements that include other files
> >
> > +//
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include 
> >
> > +#include "IpmiHooks.h"
> >
> > +#include "IpmiBmcCommon.h"
> >
> > +#include "IpmiBmc.h"
> >
> > +#include 
> >
> > +
> >
> > +IPMI_BMC_INSTANCE_DATA *mIpmiInstance;
> >
> > +EFI_HANDLE   

Re: [edk2-devel] [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

For entire V3 and the additional patch 16/16,
Reviewed-by: Abner Chang 

I will do the Uncrustify check and merge this patch set once the corresponding 
edk2 changes are merged.
Thanks
Abner

> -Original Message-
> From: Konstantin Aladyshev 
> Sent: Monday, October 23, 2023 9:05 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> Lateef) ; nick...@nvidia.com; Konstantin
> Aladyshev 
> Subject: [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> The Manageability KCS transport library needs to support requests both
> from MCTP and IPMI transports. Currently the code only handles IPMI
> case correctly.
> In the MCTP case the communication should be based on the MCTP-over-KCS
> specification (DSP0254). This specification defines a special KCS
> binding header and trailer structures that need to be present in every
> MCTP message.
> The header structure contains a length field, therefore response packet
> size is not needed to be known beforehand.
> The trailer structure contains a PEC checksum that can be used to check
> itegrity of the response message.
> Modify Manageability KCS transport library code to check which message
> is processed (IPMI or MCTP) and handle each case correctly based on its
> own specification.
> This patch is a result of a joint effort from the Konstantin Aladyshev
>  and Abner Chang .
>
> Tested:
> PLDM communication between the HOST and BMC was tested with both
> components implemented via open-source software:
> - The HOST (UEFI firmware) part was based one the edk2 [1] and
> edk2-platforms [2] code,
> - The BMC part was based on the openbmc [3] distribution.
>
> The testing process and all the necessary utilities are described in
> the [4] repository.
>
> The provided changes keep IPMI over KCS stack working as reported by
> Abner Chang.
>
> [1]: https://github.com/tianocore/edk2
> [2]: https://github.com/tianocore/edk2-platforms
> [3]: https://github.com/openbmc/openbmc
> [4]: https://github.com/Kostr/PLDM
>
> Changes v2 -> v3:
>  - Add new patch that adds PLDM completion code check
>
> Changes v1 -> v2:
>  - Add new patches with corrections for the PLDM protocol. The
>   resulting communication via EDKII_PLDM_PROTOCOL was successfully
>   tested.
>
> Abner Chang (4):
>   ManageabilityPkg: Add PLDM terminus PCDs
>   PldmProtocolDxe: Correct TID argument usage
>   ManageabilityPkg/PldmProtocol: Remove PLDM command table
>   PldmSmbiosTransferDxe: Implement Set PLDM terminus ID API
>
> Konstantin Aladyshev (12):
>   ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure
>   ManageabilityPkg: Check MCTP EIDs for reserved values
>   ManageabilityPkg: Support both MCTP and IPMI in KCS tranport library
>   ManageabilityPkg: Check header fields in the MCTP response
>   ManageabilityPkg: Correct typo in MCTP destination EID field
>   ManageabilityPkg: Update the algorithm of using MCTP endpoint ID PCD
>   ManageabilityPkg: Correct value for the MCTP TAG_OWNER response bit
>   ManageabilityPkg: Don't check MCTP header fields if transfer has
> failed
>   ManageabilityPkg: Use correct constants for PLDM header checks
>   ManageabilityPkg: Return error on multiple-packet MCTP responses
>   ManageabilityPkg: Return error on PLDM header check fails
>   ManageabilityPkg: Check PLDM completion code
>
>  .../Include/Library/BasePldmProtocolLib.h |  16 +
>  .../Library/ManageabilityTransportMctpLib.h   |   9 +-
>  .../Include/Protocol/MctpProtocol.h   |  12 +-
>  .../Include/Protocol/PldmProtocol.h   |  18 +-
>  .../Protocol/PldmSmbiosTransferProtocol.h |  26 ++
>  .../Common/KcsCommon.c| 284 +++---
>  .../Dxe/ManageabilityTransportMctp.c  |   4 +-
>  .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c |  49 ++-
>  .../Dxe/PldmProtocolLib.inf   |   6 +-
>  .../ManageabilityPkg/ManageabilityPkg.dec |   6 +
>  .../MctpProtocol/Common/MctpProtocolCommon.c  | 129 +++-
>  .../Universal/MctpProtocol/Dxe/MctpProtocol.c |  51 +++-
>  .../PldmProtocol/Common/PldmProtocolCommon.c  | 148 +++--
>  .../PldmProtocol/Common/PldmProtocolCommon.h  |  25 +-
>  .../Universal/PldmProtocol/Dxe/PldmProtocol.c |  69 -
>  .../PldmProtocol/Dxe/PldmProtocolDxe.inf  |   4 -
>  .../PldmSmbiosTransferDxe.c   |  28 ++
>  17 files changed, 690 insertions(+), 194 deletions(-)
>
> --
> 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109980): https://edk2.groups.io/g/devel/message/109980
Mute This Topic: https://groups.io/mt/102134646/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] MdeModulePkg: Optimize BmExpandPartitionDevicePath

2023-10-23 Thread Gao, Zhichao
The patch looks good to me.
Reviewed-by: Zhichao Gao 

The comments of this patch and proposal would be taken care in another patch. 
Better to have a Bugzilla record for the planned change.

Thanks,
Zhichao

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Aaron
> Young
> Sent: Tuesday, October 10, 2023 11:07 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg: Optimize
> BmExpandPartitionDevicePath
> 
> Reference: https://github.com/tianocore/edk2/pull/4892
> 
> BmExpandPartitionDevicePath is called to expand "short-form" device paths
> which are commonly used with OS boot options. To expand a device path, it
> calls EfiBootManagerConnectAll to connect all the possible BlockIo devices in
> the system to search for a matching partition. However, this is sometimes
> unnecessary on certain platforms (such as OVMF/QEMU) because the boot
> devices are previously explicity connected
> (See: ConnectDevicesFromQemu).  EfiBootManagerConnectAll calls are
> extremely costly in terms of boot time and resources and should be avoided
> whenever feasible.
> 
> Therefore optimize BmExpandPartitionDevicePath to first search the existing
> BlockIo handles for a match. If a match is not found, then fallback to the
> original code to call EfiBootManagerConnectAll and search again. Thus, this
> optimization should be extremely low-risk given the fallback to previous
> behavior.
> 
> NOTE: The existing optimization in the code to use a "HDDP" variable to save
> the last matched device paths does not cover the first time a boot option is
> expanded (i.e. before the "HDDP" is created) nor when the device
> configuration has changed (resulting in the boot device moving to a different
> location in the PCI Bus/Dev hierarchy). This new optimization covers both of
> these cases on requisite platforms which explicity connect boot devices.
> 
> In our testing on OVMF/QEMU VMs with dozens of configured vnic devices,
> these extraneous calls to EfiBootManagerConnectAll from
> BmExpandPartitionDevicePath were found to cause many seconds (or even
> minutes) of additional VM boot time in some cases - due to the vnics being
> unnecessarily connected.
> 
> Cc: Zhichao Gao zhichao@intel.com
> Cc: Ray Ni ray...@intel.com
> Signed-off-by: Aaron Young 
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 90
> 
>  1 file changed, 56 insertions(+), 34 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index c3763c4483c7..7a97f7cdcc6b 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -880,6 +880,8 @@ BmExpandPartitionDevicePath (
>BOOLEAN   NeedAdjust;   EFI_DEVICE_PATH_PROTOCOL  
> *Instance;
> UINTN Size;+  BOOLEAN   MatchFound;+  
> BOOLEAN
> ConnectAllAttempted;//   // Check if there is prestore 'HDDP' variable.@@
> -974,49 +976,69 @@ BmExpandPartitionDevicePath (
>// If we get here we fail to find or 'HDDP' not exist, and now we need   
> // to
> search all devices in the system for a matched partition   //-
> EfiBootManagerConnectAll ();-  Status = gBS->LocateHandleBuffer
> (ByProtocol, , NULL, ,
> );-  if (EFI_ERROR (Status)) {-BlockIoHandleCount = 0;-
> BlockIoBuffer  = NULL;-  }--  //-  // Loop through all the device handles 
> that
> support the BLOCK_IO Protocol-  //-  for (Index = 0; Index <
> BlockIoHandleCount; Index++) {-BlockIoDevicePath =
> DevicePathFromHandle (BlockIoBuffer[Index]);-if (BlockIoDevicePath ==
> NULL) {-  continue;+  BlockIoBuffer   = NULL;+  MatchFound  =
> FALSE;+  ConnectAllAttempted = FALSE;+  do {+if (BlockIoBuffer != NULL)
> {+  FreePool (BlockIoBuffer); } -if 
> (BmMatchPartitionDevicePathNode
> (BlockIoDevicePath, (HARDDRIVE_DEVICE_PATH *)FilePath)) {-  //-  //
> Find the matched partition device path-  //-  TempDevicePath =
> AppendDevicePath (BlockIoDevicePath, NextDevicePathNode (FilePath));-
> FullPath   = BmGetNextLoadOptionDevicePath (TempDevicePath, NULL);-
> FreePool (TempDevicePath);+Status = gBS->LocateHandleBuffer
> (ByProtocol, , NULL, ,
> );+if (EFI_ERROR (Status)) {+  BlockIoHandleCount = 0;+
> BlockIoBuffer  = NULL;+} -  if (FullPath != NULL) {-
> BmCachePartitionDevicePath (, BlockIoDevicePath);+
> //+// Loop through all the device handles that support the BLOCK_IO
> Protocol+//+for (Index = 0; Index < BlockIoHandleCount; Index++) {+
> BlockIoDevicePath = DevicePathFromHandle (BlockIoBuffer[Index]);+  if
> (BlockIoDevicePath == NULL) {+continue;+  } +  if
> (BmMatchPartitionDevicePathNode (BlockIoDevicePath,
> (HARDDRIVE_DEVICE_PATH *)FilePath)) { //-// Save the matching
> Device Path so we don't need to do a connect all next time-// Failing 
> 

Re: [edk2-devel] [PATCH v1 3/3] OvmfPkg: Add varpolicy shell command

2023-10-23 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Yao,
> Jiewen
> Sent: Monday, October 23, 2023 5:44 PM
> To: mikub...@linux.microsoft.com; devel@edk2.groups.io
> Cc: Anatol Belski ; Anthony Perard
> ; Gerd Hoffmann ;
> Jianyong Wu ; Justen, Jordan L
> ; Julien Grall 
> Subject: Re: [edk2-devel] [PATCH v1 3/3] OvmfPkg: Add varpolicy shell
> command
> 
> Acked-by: Jiewen Yao 
> 
> > -Original Message-
> > From: mikub...@linux.microsoft.com 
> > Sent: Tuesday, September 19, 2023 10:33 PM
> > To: devel@edk2.groups.io
> > Cc: Anatol Belski ; Anthony Perard
> > ; Gerd Hoffmann ;
> Jianyong
> > Wu ; Yao, Jiewen ;
> Justen,
> > Jordan L ; Julien Grall 
> > Subject: [PATCH v1 3/3] OvmfPkg: Add varpolicy shell command
> >
> > From: Michael Kubacki 
> >
> > Adds the varpolicy EFI shell command to all DSC files that
> > currently include other dynamic shell commands from ShellPkg.
> >
> > This command allows variable policies to be dumped in the EFI
> > shell for convenient auditing and debug.
> >
> > Use the command in QEMU EFI shell as follows:
> >
> > - `"varpolicy"` dumps platform variables
> > - `"varpolicy -?"` shows help text
> > - `"varpolicy -b"` pages output as expected
> > - `"varpolicy -s"` shows accurate variable statistic information
> > - `"varpolicy -p"` shows accurate UEFI variable policy information
> > - `"varpolicy-v -b"` dumps all information including variable data
> hex dump
> >
> > Cc: Anatol Belski 
> > Cc: Anthony Perard 
> > Cc: Gerd Hoffmann 
> > Cc: Jianyong Wu 
> > Cc: Jiewen Yao 
> > Cc: Jordan Justen 
> > Cc: Julien Grall 
> > Signed-off-by: Michael Kubacki 
> > ---
> >  OvmfPkg/CloudHv/CloudHvX64.dsc | 4 
> >  OvmfPkg/Microvm/MicrovmX64.dsc | 4 
> >  OvmfPkg/OvmfPkgIa32.dsc| 4 
> >  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
> >  OvmfPkg/OvmfPkgX64.dsc | 4 
> >  OvmfPkg/OvmfXen.dsc| 4 
> >  6 files changed, 24 insertions(+)
> >
> > diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc
> > b/OvmfPkg/CloudHv/CloudHvX64.dsc
> > index 35942e02df93..c23c7eaf6cc2 100644
> > --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> > +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> > @@ -837,6 +837,10 @@ [Components]
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> >}
> > +
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> > amicCommand.inf {
> > +
> > +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > +  }
> >
> >
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.
> i
> > nf {
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc
> > b/OvmfPkg/Microvm/MicrovmX64.dsc
> > index 0f26f2a9a97d..ea1fa3e2963f 100644
> > --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> > +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> > @@ -849,6 +849,10 @@ [Components]
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> >}
> > +
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> > amicCommand.inf {
> > +
> > +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > +  }
> >
> >
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.
> i
> > nf {
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> > index fcd3a3fda5f2..ed3a19feebe6 100644
> > --- a/OvmfPkg/OvmfPkgIa32.dsc
> > +++ b/OvmfPkg/OvmfPkgIa32.dsc
> > @@ -915,6 +915,10 @@ [Components]
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> >}
> > +
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> > amicCommand.inf {
> > +
> > +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > +  }
> >
> >
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.
> i
> > nf {
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> > index d0ae0b996d66..16ca139b2973 100644
> > --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> > @@ -933,6 +933,10 @@ [Components.X64]
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> >}
> > +
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> > amicCommand.inf {
> > +
> > +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > +  }
> >
> >
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.
> i
> > nf {
> >  
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> > index a6811eee557e..dc1a0942aa8b 100644
> > --- a/OvmfPkg/OvmfPkgX64.dsc
> > +++ b/OvmfPkg/OvmfPkgX64.dsc
> > @@ -1001,6 +1001,10 @@ [Components]
> >  
> > 

Re: [edk2-devel] [PATCH] RedfishPkg/RedfishDiscoverDxe: remove Redfish false alarm

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, October 23, 2023 10:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [PATCH] RedfishPkg/RedfishDiscoverDxe: remove Redfish false alarm
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> - It is expected that caller receives EFI_NO_MAPPING status
> when call issues Configure() to unconfigured network interface.
> Remove this false alarm in GetSubnetInfo() function.
> - Fix typos
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../RedfishDiscoverDxe/RedfishDiscoverDxe.c  | 16 ++--
>  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> index 2f9e604f6cd6..23da3b968f6c 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> @@ -198,13 +198,17 @@ Tcp4GetSubnetInfo (
>Tcp4Option.EnableNagle   = TRUE;
>Status   = Tcp4->Configure (Tcp4, );
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information\n", __func__));
> +if (Status == EFI_NO_MAPPING) {
> +  return EFI_SUCCESS;
> +}
> +
> +DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information: %r\n",
> __func__, Status));
>  return Status;
>}
>
>Status = Tcp4->GetModeData (Tcp4, NULL, NULL, , NULL,
> NULL);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n",
> __func__));
> +DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information: %r\n",
> __func__, Status));
>  return Status;
>}
>
> @@ -267,7 +271,7 @@ Tcp6GetSubnetInfo (
>ZeroMem ((VOID *), sizeof (EFI_IP6_MODE_DATA));
>Status = Tcp6->GetModeData (Tcp6, NULL, NULL, , NULL,
> NULL);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n",
> __func__));
> +DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information: %r\n",
> __func__, Status));
>  return Status;
>}
>
> @@ -1002,13 +1006,13 @@ NetworkInterfaceGetSubnetInfo (
> Instance
> );
>  if (EFI_ERROR (Status)) {
> -  DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n",
> __func__));
> +  DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet information.\n",
> __func__));
>return Status;
>  } else {
>DEBUG ((DEBUG_MANAGEABILITY, "%a:MAC address: %s\n", __func__,
> Instance->StrMacAddr));
>if (CheckIsIpVersion6 (Instance)) {
>  if (Instance->SubnetAddrInfoIPv6Number == 0) {
> -  DEBUG ((DEBUG_ERROR, "%a: There is no Subnet infomation for IPv6
> network interface.\n", __func__));
> +  DEBUG ((DEBUG_WARN, "%a: There is no Subnet information for IPv6
> network interface.\n", __func__));
>return EFI_NOT_FOUND;
>  }
>
> @@ -1554,7 +1558,7 @@ TestForRequiredProtocols (
>);
>if (EFI_ERROR (Status)) {
>  if (Index == ListCount - 1) {
> -  DEBUG ((DEBUG_ERROR, "%a: all required protocols are found on this
> controller handle: %p.\n", __func__, ControllerHandle));
> +  DEBUG ((DEBUG_INFO, "%a: all required protocols are found on this
> controller handle: %p.\n", __func__, ControllerHandle));
>return EFI_SUCCESS;
>  }
>}
> --
> 2.17.1



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




Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: add debug message.

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

The change looks good.
Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, October 23, 2023 10:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [PATCH] RedfishPkg/RedfishPlatformConfigDxe: add debug message.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Add debug prints to show HII option name when assert happens.
> This helps developer to debug assert issue easily while Redfish
> failed to convert HII value to Redfish value.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../RedfishPlatformConfigDxe.c| 123 +-
>  1 file changed, 122 insertions(+), 1 deletion(-)
>
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> index 30d2ef351eca..cbc65ba59408 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> @@ -203,6 +203,106 @@ FindFormLinkToThis (
>return NULL;
>  }
>
> +/**
> +  Debug dump HII statement value.
> +
> +  @param[in]  ErrorLevelDEBUG macro error level
> +  @param[in]  Value HII statement value to dump
> +  @param[in]  Message   Debug message
> +
> +  @retval EFI_SUCCESS   Dump HII statement value successfully
> +  @retval OthersErrors occur
> +
> +**/
> +EFI_STATUS
> +DumpHiiStatementValue (
> +  IN UINTNErrorLevel,
> +  IN HII_STATEMENT_VALUE  *Value,
> +  IN CHAR8*Message OPTIONAL
> +  )
> +{
> +  UINT64  Data;
> +
> +  if (Value == NULL) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  switch (Value->Type) {
> +case EFI_IFR_TYPE_NUM_SIZE_8:
> +  Data = Value->Value.u8;
> +  break;
> +case EFI_IFR_TYPE_NUM_SIZE_16:
> +  Data = Value->Value.u16;
> +  break;
> +case EFI_IFR_TYPE_NUM_SIZE_32:
> +  Data = Value->Value.u32;
> +  break;
> +case EFI_IFR_TYPE_NUM_SIZE_64:
> +  Data = Value->Value.u64;
> +  break;
> +case EFI_IFR_TYPE_BOOLEAN:
> +  Data = (Value->Value.b ? 1 : 0);
> +  break;
> +default:
> +  DEBUG ((ErrorLevel, "%a: unsupported type: 0x%x\n", __func__, Value-
> >Type));
> +  return EFI_UNSUPPORTED;
> +  }
> +
> +  if (IS_EMPTY_STRING (Message)) {
> +DEBUG ((ErrorLevel, "0x%lx\n", Data));
> +  } else {
> +DEBUG ((ErrorLevel, "%a: 0x%lx\n", Message, Data));
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/**
> +  Debug dump HII statement prompt string.
> +
> +  @param[in]  ErrorLevelDEBUG macro error level
> +  @param[in]  HiiHandle HII handle instance
> +  @param[in]  HiiStatement  HII statement
> +  @param[in]  Message   Debug message
> +
> +  @retval EFI_SUCCESS   Dump HII statement string successfully
> +  @retval OthersErrors occur
> +
> +**/
> +EFI_STATUS
> +DumpHiiStatementPrompt (
> +  IN UINTN   ErrorLevel,
> +  IN EFI_HII_HANDLE  HiiHandle,
> +  IN HII_STATEMENT   *HiiStatement,
> +  IN CHAR8   *Message OPTIONAL
> +  )
> +{
> +  EFI_STRING  String;
> +
> +  if ((HiiHandle == NULL) || (HiiStatement == NULL)) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  if (HiiStatement->Prompt == 0) {
> +return EFI_NOT_FOUND;
> +  }
> +
> +  String = HiiGetString (HiiHandle, HiiStatement->Prompt, NULL);
> +  if (String == NULL) {
> +return EFI_NOT_FOUND;
> +  }
> +
> +  if (IS_EMPTY_STRING (Message)) {
> +DEBUG ((ErrorLevel, "%s\n", String));
> +  } else {
> +DEBUG ((ErrorLevel, "%a: %s\n", Message, String));
> +  }
> +
> +  FreePool (String);
> +
> +  return EFI_SUCCESS;
> +}
> +
>  /**
>Build the menu path to given statement instance. It is caller's
>responsibility to free returned string buffer.
> @@ -890,6 +990,7 @@ HiiValueToRedfishNumeric (
>break;
>  default:
>RedfishValue->Type = RedfishValueTypeUnknown;
> +  DEBUG ((DEBUG_ERROR, "%a: Unsupported value type: 0x%x\n",
> __func__, Value->Type));
>break;
>}
>
> @@ -1187,6 +1288,11 @@ HiiValueToRedfishValue (
>  case EFI_IFR_ONE_OF_OP:
>StringId = HiiValueToOneOfOptionStringId (HiiStatement, Value);
>if (StringId == 0) {
> +//
> +// Print prompt string of HII statement for ease of debugging
> +//
> +DumpHiiStatementPrompt (DEBUG_ERROR, HiiHandle, HiiStatement,
> "Can not find string ID");
> +DumpHiiStatementValue (DEBUG_ERROR, Value, "Current value");
>  ASSERT (FALSE);
>  Status = EFI_DEVICE_ERROR;
>  break;
> @@ -1254,6 +1360,10 @@ HiiValueToRedfishValue (
>  case EFI_IFR_ORDERED_LIST_OP:
>StringIdArray = HiiValueToOrderedListOptionStringId (HiiStatement,
> );
>if 

Re: [edk2-devel] [PATCH v2 08/12] RedfishPkg: CI: Add PrEval entry

2023-10-23 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Joey Vagedes 
> Sent: Tuesday, October 24, 2023 1:52 AM
> To: devel@edk2.groups.io
> Cc: Abner Chang ; Nickle Wang ;
> Igor Kulchytskyy 
> Subject: [PATCH v2 08/12] RedfishPkg: CI: Add PrEval entry
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Joey Vagedes 
> 
> Adds a PrEval entry to the package's ci.yaml file which is used to verify if 
> the
> package uses a particular library instance when that library instance file 
> (INF) is
> updated.
> 
> When a library instance file (INF) is updated, PrEval will review each 
> package's
> DSC as described in the ci.yaml file to determine if the package uses said 
> library
> instance. If the package does use the library instance, it will be built and 
> tested to
> ensure the package is not broken from the change.
> 
> Cc: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Joey Vagedes 
> 
> Reviewed-by: Abner Chang  ---
>  RedfishPkg/RedfishPkg.ci.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml 
> index
> 96133f8c288d..69b6bf39f5ce 100644
> --- a/RedfishPkg/RedfishPkg.ci.yaml
> +++ b/RedfishPkg/RedfishPkg.ci.yaml
> @@ -5,6 +5,9 @@
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  ##
> 
>  {
> 
> +"PrEval": {
> 
> +"DscPath": "RedfishPkg.dsc",
> 
> +},
> 
>  "LicenseCheck": {
> 
>  "IgnoreFiles": []
> 
>  },
> 
> --
> 2.34.1



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




[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, October 24, 2023 #cal-reminder

2023-10-23 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, October 24, 2023
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

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

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

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

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

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

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

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

*Or call in (audio only)*

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

Phone Conference ID: 774 638 21#

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

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


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




Re: [edk2-devel] [PATCH v2 05/12] EmbeddedPkg: CI: Add PrEval entry

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Joey Vagedes 
> Sent: Tuesday, October 24, 2023 1:52 AM
> To: devel@edk2.groups.io
> Cc: Leif Lindholm ; Ard Biesheuvel
> ; Chang, Abner ;
> Daniel Schaefer 
> Subject: [PATCH v2 05/12] EmbeddedPkg: CI: Add PrEval entry
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> From: Joey Vagedes 
>
> Adds a PrEval entry to the package's ci.yaml file which is used to
> verify if the package uses a particular library instance when that
> library instance file (INF) is updated.
>
> When a library instance file (INF) is updated, PrEval will review each
> package's DSC as described in the ci.yaml file to determine if the
> package uses said library instance. If the package does use the library
> instance, it will be built and tested to ensure the package is not
> broken from the change.
>
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Cc: Abner Chang 
> Cc: Daniel Schaefer 
> Signed-off-by: Joey Vagedes 
>
> Reviewed-by: Abner Chang 
> ---
>  EmbeddedPkg/EmbeddedPkg.ci.yaml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/EmbeddedPkg/EmbeddedPkg.ci.yaml
> b/EmbeddedPkg/EmbeddedPkg.ci.yaml
> index 21f30108a29f..96a60a6f8b4d 100644
> --- a/EmbeddedPkg/EmbeddedPkg.ci.yaml
> +++ b/EmbeddedPkg/EmbeddedPkg.ci.yaml
> @@ -6,6 +6,9 @@
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  ##
>
>  {
>
> +"PrEval": {
>
> +"DscPath": "EmbeddedPkg.dsc",
>
> +},
>
>  ## options defined .pytool/Plugin/LicenseCheck
>
>  "LicenseCheck": {
>
>  "IgnoreFiles": []
>
> --
> 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109973): https://edk2.groups.io/g/devel/message/109973
Mute This Topic: https://groups.io/mt/102140973/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 08/12] RedfishPkg: CI: Add PrEval entry

2023-10-23 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Joey Vagedes 
> Sent: Tuesday, October 24, 2023 1:52 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Nickle Wang
> ; Igor Kulchytskyy 
> Subject: [PATCH v2 08/12] RedfishPkg: CI: Add PrEval entry
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> From: Joey Vagedes 
>
> Adds a PrEval entry to the package's ci.yaml file which is used to
> verify if the package uses a particular library instance when that
> library instance file (INF) is updated.
>
> When a library instance file (INF) is updated, PrEval will review each
> package's DSC as described in the ci.yaml file to determine if the
> package uses said library instance. If the package does use the library
> instance, it will be built and tested to ensure the package is not
> broken from the change.
>
> Cc: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Joey Vagedes 
>
> Reviewed-by: Abner Chang  ---
>  RedfishPkg/RedfishPkg.ci.yaml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml
> index 96133f8c288d..69b6bf39f5ce 100644
> --- a/RedfishPkg/RedfishPkg.ci.yaml
> +++ b/RedfishPkg/RedfishPkg.ci.yaml
> @@ -5,6 +5,9 @@
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  ##
>
>  {
>
> +"PrEval": {
>
> +"DscPath": "RedfishPkg.dsc",
>
> +},
>
>  "LicenseCheck": {
>
>  "IgnoreFiles": []
>
>  },
>
> --
> 2.34.1



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




Re: [edk2-devel] [PATCH] IntelSiliconPkg/Vtd: fix incorrect number of arguments

2023-10-23 Thread Huang, Jenny
Reviewed by Jenny Huang 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sheng, W
Sent: Wednesday, September 27, 2023 6:55 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Huang, Jenny 
Subject: [edk2-devel] [PATCH] IntelSiliconPkg/Vtd: fix incorrect number of 
arguments

Fix incorrect number of arguments in VtdLibDumpSetAttribute().

Signed-off-by: Sheng Wei 
Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jenny Huang 
---
 .../Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c 
b/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c
index 1e65115c..84eb6287 100644
--- 
a/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c
+++ 
b/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c
@@ -1300,6 +1300,7 @@ VtdLibDumpSetAttribute (
  SetAttributeInfo->SourceId.Uint16,

  SetAttributeInfo->DeviceAddress,

  SetAttributeInfo->Length,

+ SetAttributeInfo->IoMmuAccess,

  SetAttributeInfo->Status));

 }

 

-- 
2.26.2.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109132): https://edk2.groups.io/g/devel/message/109132
Mute This Topic: https://groups.io/mt/101630645/2558558
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [w.sh...@intel.com]
-=-=-=-=-=-=




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




Re: [edk2-devel] [PATCH] IntelSiliconPkg/VTd: Print Flags field in DeviceScopeEntry

2023-10-23 Thread Huang, Jenny
Reviewed by Jenny Huang 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sheng, W
Sent: Wednesday, October 11, 2023 1:37 AM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Huang, Jenny 
Subject: [edk2-devel] [PATCH] IntelSiliconPkg/VTd: Print Flags field in 
DeviceScopeEntry

Flags field is defined in Device Scope Structure since VT-d spec 4.0.
Print Device Scope Structure Flags field when dump DMAR table.

Change-Id: I37365ea4c1e6cfa0a1842a583076136b7d2c
Signed-off-by: Sheng Wei 
Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jenny Huang 
---
 .../Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c 
b/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c
index 1e65115cb..d58c4cdcf 100644
--- 
a/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c
+++ 
b/Silicon/Intel/IntelSiliconPkg/Library/IntelVTdPeiDxeLib/IntelVTdPeiDxeLib.c
@@ -137,6 +137,10 @@ VtdLibDumpDmarDeviceScopeEntry (
 "  Length . 0x%02x\n",

 DmarDeviceScopeEntry->Length

 ));

+  VTDLIB_DEBUG ((DEBUG_INFO,

+"  Flags .. 0x%02x\n",

+DmarDeviceScopeEntry->Flags

+));

   VTDLIB_DEBUG ((DEBUG_INFO,

 "  Enumeration ID . 0x%02x\n",

 DmarDeviceScopeEntry->EnumerationId

-- 
2.26.2.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109519): https://edk2.groups.io/g/devel/message/109519
Mute This Topic: https://groups.io/mt/101892832/2558558
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [w.sh...@intel.com]
-=-=-=-=-=-=




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




回复: [edk2-devel] [PATCH 1/1] BaseTools: trim warning to error

2023-10-23 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Yuwei Chen
> 发送时间: 2023年9月22日 14:47
> 收件人: devel@edk2.groups.io
> 抄送: Rebecca Cran ; Liming Gao
> ; Bob Feng 
> 主题: [edk2-devel] [PATCH 1/1] BaseTools: trim warning to error
> 
> As the error is changed to warning, Trim.py will skip the build
> error when the source code have exactly issue.
> This patch change warning to error to opens the checking.
> 
> Cc: Rebecca Cran 
> Cc: Liming Gao 
> Cc: Bob Feng 
> Signed-off-by: Yuwei Chen 
> ---
>  BaseTools/Source/Python/Trim/Trim.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Trim/Trim.py
> b/BaseTools/Source/Python/Trim/Trim.py
> index c479f7d2b2e7..416935df5e90 100644
> --- a/BaseTools/Source/Python/Trim/Trim.py
> +++ b/BaseTools/Source/Python/Trim/Trim.py
> @@ -281,10 +281,10 @@ def DoInclude(Source, Indent='', IncludePathList=[],
> LocalSearchPath=None, Inclu
>  F = File.readlines()
>  break
>  else:
> -EdkLogger.warn("Trim", "Failed to find include file %s" %
> Source)
> +EdkLogger.error("Trim", "Failed to find include file %s" %
> Source)
>  return []
>  except:
> -EdkLogger.warn("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
> +EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
>  return []
> 
> 
> --
> 2.27.0.windows.1
> 
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH v1 1/1] Maintainers.txt: Add .pytool maintainers to BaseTools/Plugin

2023-10-23 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael
> Kubacki
> 发送时间: 2023年10月24日 8:15
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng ; Liming Gao
> ; Michael D Kinney
> ; Rebecca Cran ; Sean
> Brogan ; Yuwei Chen 
> 主题: [edk2-devel] [PATCH v1 1/1] Maintainers.txt: Add .pytool maintainers
> to BaseTools/Plugin
> 
> From: Michael Kubacki 
> 
> Plugins can be placed either in .pytool/Plugin (CI plugin) or
> BaseTools/Plugin (build plugin).
> 
> Since most of the .pytool maintainers already review many of the
> plugins placed there, the same maintainers are added for the Plugin
> directory in BaseTools to increase the total number of maintainers
> for plugin changes.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Rebecca Cran 
> Cc: Sean Brogan 
> Cc: Yuwei Chen 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Notes:
> This was discussed in the October 23, 2023 Tianocore Tools and CI
> meeting. Three of the BaseTools/Plugin maintainers were present
> (Michael Kinney, Michael Kubacki, Sean Brogan) and the BaseTools
> maintainer Yuwei Chen.
> 
> Liming Gao, if you'd prefer to not be added to the BaseTools/Plugin
> list, please let me know and I'll remove you from this patch.
> 
>  Maintainers.txt | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index e4689bdd9102..077f6d4ac1fb 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -175,6 +175,13 @@ M: Liming Gao  [lgao4]
>  R: Bob Feng  [BobCF]
>  R: Yuwei Chen  [YuweiChen1110]
> 
> +BaseTools: Plugins
> +F: BaseTools/Plugin/
> +M: Sean Brogan  [spbrogan]
> +M: Michael Kubacki  [makubacki]
> +R: Michael D Kinney  [mdkinney]
> +R: Liming Gao  [lgao4]
> +
>  CryptoPkg
>  F: CryptoPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/CryptoPkg
> --
> 2.42.0.windows.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#109962):
> https://edk2.groups.io/g/devel/message/109962
> Mute This Topic: https://groups.io/mt/102148545/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109968): https://edk2.groups.io/g/devel/message/109968
Mute This Topic: https://groups.io/mt/102149181/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 04/14] OvmfPkg: Add ImagePropertiesRecordLib Instance

2023-10-23 Thread Yao, Jiewen
Acked-by: Jiewen Yao 

> -Original Message-
> From: Taylor Beebe 
> Sent: Saturday, August 5, 2023 3:47 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L ; Gerd
> Hoffmann 
> Subject: [PATCH v4 04/14] OvmfPkg: Add ImagePropertiesRecordLib Instance
> 
> From: Taylor Beebe 
> 
> Add an instance of ImagePropertiesRecordLib which will be used by the
> DXE Core.
> 
> Signed-off-by: Taylor Beebe 
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Gerd Hoffmann 
> ---
>  OvmfPkg/AmdSev/AmdSevX64.dsc| 1 +
>  OvmfPkg/Bhyve/BhyveX64.dsc  | 1 +
>  OvmfPkg/CloudHv/CloudHvX64.dsc  | 1 +
>  OvmfPkg/IntelTdx/IntelTdxX64.dsc| 1 +
>  OvmfPkg/Microvm/MicrovmX64.dsc  | 1 +
>  OvmfPkg/OvmfPkgIa32.dsc | 1 +
>  OvmfPkg/OvmfPkgIa32X64.dsc  | 1 +
>  OvmfPkg/OvmfPkgX64.dsc  | 1 +
>  OvmfPkg/OvmfXen.dsc | 1 +
>  OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 1 +
>  10 files changed, 10 insertions(+)
> 
> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc
> b/OvmfPkg/AmdSev/AmdSevX64.dsc
> index 2c6ed7c9745f..e8c954a97956 100644
> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> @@ -171,6 +171,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncrypt
> TdxLib.inf
>PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/I
> magePropertiesRecordLib.inf
> 
>  !if $(SOURCE_DEBUG_ENABLE) == TRUE
> 
> PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug
> /PeCoffExtraActionLibDebug.inf
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index 82c60ace1bbd..ee349e105787 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -173,6 +173,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncrypt
> TdxLib.inf
>PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/I
> magePropertiesRecordLib.inf
> 
> 
> CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize
> dDisplayLib.inf
> 
> FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib
> .inf
> diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc
> b/OvmfPkg/CloudHv/CloudHvX64.dsc
> index e000deed9e4d..91816a10996f 100644
> --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> @@ -182,6 +182,7 @@ [LibraryClasses]
> 
> MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptS
> evLib.inf
>PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/I
> magePropertiesRecordLib.inf
>  !if $(SMM_REQUIRE) == FALSE
>LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
>  !endif
> diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> index 193657ff2d61..bee98e798717 100644
> --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> @@ -171,6 +171,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncrypt
> TdxLib.inf
>PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/I
> magePropertiesRecordLib.inf
> 
>LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
> 
> CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize
> dDisplayLib.inf
> diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc
> b/OvmfPkg/Microvm/MicrovmX64.dsc
> index 2f7585639374..38e0af6ae101 100644
> --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> @@ -185,6 +185,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncrypt
> TdxLib.inf
>PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/I
> magePropertiesRecordLib.inf
> 
>  !if $(SOURCE_DEBUG_ENABLE) == TRUE
> 
> PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug
> /PeCoffExtraActionLibDebug.inf
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index ed36935770f3..84807b3ffee9 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -187,6 +187,7 @@ [LibraryClasses]
> 
> 

Re: [edk2-devel] [PATCH v1 3/3] OvmfPkg: Add varpolicy shell command

2023-10-23 Thread Yao, Jiewen
Acked-by: Jiewen Yao 

> -Original Message-
> From: mikub...@linux.microsoft.com 
> Sent: Tuesday, September 19, 2023 10:33 PM
> To: devel@edk2.groups.io
> Cc: Anatol Belski ; Anthony Perard
> ; Gerd Hoffmann ; Jianyong
> Wu ; Yao, Jiewen ; Justen,
> Jordan L ; Julien Grall 
> Subject: [PATCH v1 3/3] OvmfPkg: Add varpolicy shell command
> 
> From: Michael Kubacki 
> 
> Adds the varpolicy EFI shell command to all DSC files that
> currently include other dynamic shell commands from ShellPkg.
> 
> This command allows variable policies to be dumped in the EFI
> shell for convenient auditing and debug.
> 
> Use the command in QEMU EFI shell as follows:
> 
> - `"varpolicy"` dumps platform variables
> - `"varpolicy -?"` shows help text
> - `"varpolicy -b"` pages output as expected
> - `"varpolicy -s"` shows accurate variable statistic information
> - `"varpolicy -p"` shows accurate UEFI variable policy information
> - `"varpolicy-v -b"` dumps all information including variable data hex dump
> 
> Cc: Anatol Belski 
> Cc: Anthony Perard 
> Cc: Gerd Hoffmann 
> Cc: Jianyong Wu 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Julien Grall 
> Signed-off-by: Michael Kubacki 
> ---
>  OvmfPkg/CloudHv/CloudHvX64.dsc | 4 
>  OvmfPkg/Microvm/MicrovmX64.dsc | 4 
>  OvmfPkg/OvmfPkgIa32.dsc| 4 
>  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
>  OvmfPkg/OvmfPkgX64.dsc | 4 
>  OvmfPkg/OvmfXen.dsc| 4 
>  6 files changed, 24 insertions(+)
> 
> diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc
> b/OvmfPkg/CloudHv/CloudHvX64.dsc
> index 35942e02df93..c23c7eaf6cc2 100644
> --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> @@ -837,6 +837,10 @@ [Components]
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>}
> +
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> amicCommand.inf {
> +
> +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +  }
> 
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.i
> nf {
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc
> b/OvmfPkg/Microvm/MicrovmX64.dsc
> index 0f26f2a9a97d..ea1fa3e2963f 100644
> --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> @@ -849,6 +849,10 @@ [Components]
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>}
> +
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> amicCommand.inf {
> +
> +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +  }
> 
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.i
> nf {
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index fcd3a3fda5f2..ed3a19feebe6 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -915,6 +915,10 @@ [Components]
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>}
> +
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> amicCommand.inf {
> +
> +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +  }
> 
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.i
> nf {
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index d0ae0b996d66..16ca139b2973 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -933,6 +933,10 @@ [Components.X64]
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>}
> +
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> amicCommand.inf {
> +
> +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +  }
> 
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.i
> nf {
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index a6811eee557e..dc1a0942aa8b 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -1001,6 +1001,10 @@ [Components]
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>}
> +
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDyn
> amicCommand.inf {
> +
> +  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +  }
> 
> OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.i
> nf {
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
> index ccd3a873c714..0063245b5659 100644
> --- a/OvmfPkg/OvmfXen.dsc
> +++ b/OvmfPkg/OvmfXen.dsc
> @@ -722,6 +722,10 @@ [Components]
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>}
> +
> 

Re: 回复: 回复: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs

2023-10-23 Thread Taylor Beebe
Ah, I switched my EDK2 mailing list email to this one a couple of months 
ago after


this series was sent. I'll update them in the PR.


Thanks for the heads-up :)

-Taylor

On 10/23/2023 5:14 PM, Kinney, Michael D wrote:


Hi Taylor,

I did notice that the Signed-off-by tags in some of the commit 
messages do not look right.


Signed-off-by: Taylor Beebe 

Please make sure those are updated.

Thanks,

Mike




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

2023-10-23 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 


> -Original Message-
> From: mikub...@linux.microsoft.com 
> Sent: Monday, October 23, 2023 5:15 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming
> ; Kinney, Michael D
> ; Rebecca Cran ; Sean
> Brogan ; Chen, Christine
> 
> Subject: [PATCH v1 1/1] Maintainers.txt: Add .pytool maintainers to
> BaseTools/Plugin
> 
> From: Michael Kubacki 
> 
> Plugins can be placed either in .pytool/Plugin (CI plugin) or
> BaseTools/Plugin (build plugin).
> 
> Since most of the .pytool maintainers already review many of the
> plugins placed there, the same maintainers are added for the Plugin
> directory in BaseTools to increase the total number of maintainers
> for plugin changes.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Rebecca Cran 
> Cc: Sean Brogan 
> Cc: Yuwei Chen 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Notes:
> This was discussed in the October 23, 2023 Tianocore Tools and CI
> meeting. Three of the BaseTools/Plugin maintainers were present
> (Michael Kinney, Michael Kubacki, Sean Brogan) and the BaseTools
> maintainer Yuwei Chen.
> 
> Liming Gao, if you'd prefer to not be added to the
> BaseTools/Plugin
> list, please let me know and I'll remove you from this patch.
> 
>  Maintainers.txt | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index e4689bdd9102..077f6d4ac1fb 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -175,6 +175,13 @@ M: Liming Gao  [lgao4]
>  R: Bob Feng  [BobCF]
>  R: Yuwei Chen  [YuweiChen1110]
> 
> +BaseTools: Plugins
> +F: BaseTools/Plugin/
> +M: Sean Brogan  [spbrogan]
> +M: Michael Kubacki  [makubacki]
> +R: Michael D Kinney  [mdkinney]
> +R: Liming Gao  [lgao4]
> +
>  CryptoPkg
>  F: CryptoPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/CryptoPkg
> --
> 2.42.0.windows.2



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




Re: [edk2-devel] [PATCH v1 0/3] Add Variable Policy Audit and Shell Command

2023-10-23 Thread Gao, Zhichao
Hi Michael,

I cannot find the shellpkg change of this patch set. Can you share your poll 
request for review?

Thanks,
Zhichao

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> Kubacki
> Sent: Tuesday, October 24, 2023 2:16 AM
> To: devel@edk2.groups.io
> Cc: Anatol Belski ; Anthony Perard
> ; Bi, Dandan ; Gerd
> Hoffmann ; Wu, Hao A ; Wang,
> Jian J ; Jianyong Wu ; Yao,
> Jiewen ; Justen, Jordan L
> ; Julien Grall ; Gao, Liming
> ; Kinney, Michael D
> ; Gao, Zhichao 
> Subject: Re: [edk2-devel] [PATCH v1 0/3] Add Variable Policy Audit and Shell
> Command
> 
> A reminder to review this series.
> 
> Regards,
> Michael
> 
> On 9/19/2023 10:32 AM, Michael Kubacki wrote:
> > From: Michael Kubacki 
> >
> > Adds a new module (dynamic shell command) to ShellPkg that lists
> > variable policy information for all UEFI variables on the system.
> >
> > Some other UEFI variable related functionality is also included to
> > give a greater sense of platform UEFI variable state.
> >
> > Like all dynamic shell commands, a platform only needs to include
> > VariablePolicyDynamicCommand.inf in their flash image to have the
> > command registered in their UEFI shell.
> >
> > The shell command is added to OvmfPkg so it is available in an easily
> > obtainable virtual platform.
> >
> > This is being made available to ease auditing and enabling of UEFI
> > variable policy to encourage its adoption for securing UEFI variables.
> >
> > ---
> >
> > Command Help:
> >
> > Lists UEFI variable policy information.
> >
> > VARPOLICY [-p] [-s] [-v]
> >
> >-p - The policy flag will print variable policy info for each variable.
> >
> >-s - The stats flag will print overall UEFI variable policy statistics.
> >
> >-v - The verbose flag indicates all known information should be printed.
> >
> > This includes a dump of the corresponding UEFI variable data in
> > addition to all other UEFI variable policy information.
> >
> > EXAMPLES:
> >
> >* To dump all active UEFI variables:
> >  fs0:\> varpolicy
> >
> >* To include UEFI variable policy information:
> >  varpolicy -p
> >
> >* To include UEFI variable statistics:
> >  varpolicy -s
> >
> > Press ENTER to continue or 'Q' break:
> >
> > ---
> >
> > Images showing example output are available in the PR:
> > https://github.com/tianocore/edk2/pull/4835
> >
> > Cc: Anatol Belski 
> > Cc: Anthony Perard 
> > Cc: Dandan Bi 
> > Cc: Gerd Hoffmann 
> > Cc: Hao A Wu 
> > Cc: Jian J Wang 
> > Cc: Jianyong Wu 
> > Cc: Jiewen Yao 
> > Cc: Jordan Justen 
> > Cc: Julien Grall 
> > Cc: Liming Gao 
> > Cc: Michael D Kinney 
> > Cc: Zhichao Gao 
> >
> > Michael Kubacki (3):
> >MdeModulePkg/VariablePolicy: Add more granular variable policy
> >  querying
> >ShellPkg: Add varpolicy dynamic shell command
> >OvmfPkg: Add varpolicy shell command
> >
> >   MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> |  174 +++-
> >   MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
> |  304 ++
> >   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> |4 +-
> >   MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c
> |  346 ++-
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.c   | 1009 
> >   MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h
> |   39 +-
> >   MdeModulePkg/Include/Library/VariablePolicyLib.h  
> > |
> 107 +++
> >   MdeModulePkg/Include/Protocol/VariablePolicy.h
> > |
> 133 ++-
> >   MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
> |1 +
> >   OvmfPkg/CloudHv/CloudHvX64.dsc
> > |4 +
> >   OvmfPkg/Microvm/MicrovmX64.dsc
> > |4 +
> >   OvmfPkg/OvmfPkgIa32.dsc   
> > |4 +
> >   OvmfPkg/OvmfPkgIa32X64.dsc
> > |4 +
> >   OvmfPkg/OvmfPkgX64.dsc
> > |4 +
> >   OvmfPkg/OvmfXen.dsc   
> > |4 +
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.h   |   94 ++
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.inf |   56 ++
> >
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.uni |   86 ++
> >   ShellPkg/ShellPkg.dsc 
> > |1 +
> >   19 files changed, 2332 insertions(+), 46 deletions(-)
> >   create mode 100644
> ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicy
> DynamicCommand.c
> >   create mode 100644
> 

Re: 回复: 回复: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs

2023-10-23 Thread Michael D Kinney
Hi Taylor,

I did notice that the Signed-off-by tags in some of the commit messages do not 
look right.


Signed-off-by: Taylor Beebe mailto:t...@taylorbeebe.com>>

Please make sure those are updated.

Thanks,

Mike



From: Taylor Beebe 
Sent: Friday, October 13, 2023 3:43 PM
To: 'Ard Biesheuvel' ; Ni, Ray ; 'Leif 
Lindholm' ; Yao, Jiewen ; 
'Sami Mujawar' ; 'Gerd Hoffmann' ; 
'Andrew Fish' ; Justen, Jordan L ; 
Kumar, Rahul R ; Dong, Eric ; 
devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: 回复: 回复: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib 
and Fix MAT Bugs


Thank you Liming :)

Patches 2, 3, 4, 5, and 11 still need reviews -- 4 of them are just adding the 
new library to the package DSC files.



This bug has cost me a significant amount of hours to debug, fix, and 
unit-test. I have been

specific in the cases which cause issues and demonstrated the problem via 
testing yet this

patch has now been in flight for over 2 months. In fact, there have been no 
significant functional

changes to the series since it was originally submitted almost 3 months ago. I 
complied with

Ray's request to reshuffle the commit structure to ease the review burden but 
am still

waiting for feedback or even acknowledgement that it's being looked at.



Everyone in the "To" line of this email has the authority to push this toward 
the finish line.

Can I please get some help?

Reference: Add ImagePropertiesRecordLib and Fix MAT Bugs by TaylorBeebe · Pull 
Request #4900 · tianocore/edk2 
(github.com)

Bugzilla: 4492 – MAT Logic Incorrectly Reports Runtime Images 
(tianocore.org)

-Taylor
On 10/10/2023 7:14 PM, gaoliming via groups.io wrote:
Taylor:
 Thanks for your detail information. I understand more in the detail. The 
changes is good to me. Reviewed-by: Liming Gao 


Thanks
Liming
发件人: devel@edk2.groups.io 
 代表 Taylor Beebe
发送时间: 2023年10月9日 3:21
收件人: devel@edk2.groups.io; 
gaolim...@byosoft.com.cn; 'Ard Biesheuvel' 

抄送: 'Andrew Fish' ; 'Ard Biesheuvel' 
; 'Dandan Bi' 
; 'Eric Dong' 
; 'Gerd Hoffmann' 
; 'Guo Dong' 
; 'Gua Guo' 
; 'James Lu' 
; 'Jian J Wang' 
; 'Jiewen Yao' 
; 'Jordan Justen' 
; 'Leif Lindholm' 
; 'Rahul Kumar' 
; 'Ray Ni' 
; 'Sami Mujawar' 
; 'Sean Rhodes' 

主题: Re: 回复: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix 
MAT Bugs


On 10/6/2023 10:57 PM, gaoliming via groups.io wrote:

Taylor:

  I agree to add new ImagePropertiesRecordLib library for DxeCore and SmmCore. 
The impact is that platform needs to update their DSC with new library.



  Frankly, I have not understood MAT code in detail. So, I have no comments on 
this part.



  Last, what test have been done to verify the current functionality?

TLDR: Patch 8 adds the unit test which invokes the lions share of the new 
library. The remaining functional changes were tested by output comparison.



To provide context on how best to review this series, where the functional 
changes are, and how they were validated, here's a breakdown of each patch:

Patch 1: Add the ImagePropertiesRecordLib definition and "blank" implementation.

Patches 2-5: Add instances of the library to the platform DSC files.

Patch 6: Updates the logic in Dxe/Misc/MemoryAttributesTable.c to use 
parameters passed in instead of referencing directly the global variables.

This functionally changes nothing but allows the logic to be 
moved to a library.

Patch 7: Move the Dxe/Misc/MemoryAttributesTable.c Image Properties Record 
manipulation logic to ImagePropertiesRecordLib -- still no functional changes.

 FUNCTIONAL CHANGES START 

Patch 8: Add ImagePropertiesRecordLibHostBasedUnitTest which tests the logic 
now in ImagePropertiesRecordLib and 3/4 of the tests fail to show that the 
logic is incorrect.

   The test calls into the SplitTable() routine which is the most 
complex and invokes almost every other function in ImagePropertiesRecordLib.

Patch 9: Fixes the issues in the logic resulting in 
ImagePropertiesRecordLibHostBasedUnitTest passing fully. The fixes change some 
logic in SpitTable() and SplitRecord() (which are tested by the unit test)

   And increases the buffer size for the split table in 
Dxe/Misc/MemoryAttributesTable.c to 

Re: [edk2-devel] [PATCH v4 05/14] UefiPayloadPkg: Add ImagePropertiesRecordLib Instance

2023-10-23 Thread Guo, Gua
Reviewed-by: Gua Guo 

From: Kinney, Michael D 
Sent: Tuesday, October 24, 2023 8:09:16 AM
To: devel@edk2.groups.io ; t...@taylorbeebe.com 

Cc: Dong, Guo ; Rhodes, Sean ; Lu, 
James ; Guo, Gua ; Kinney, Michael D 

Subject: RE: [edk2-devel] [PATCH v4 05/14] UefiPayloadPkg: Add 
ImagePropertiesRecordLib Instance

Hi Taylor,

I see there have been no reviews from the package maintainers for this
small update to some DSC files.  You can use my Rb for this patch
as a steward.

Reviewed-by: Michael D Kinney 

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Taylor
> Beebe
> Sent: Friday, August 4, 2023 12:47 PM
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Rhodes, Sean
> ; Lu, James ; Guo, Gua
> 
> Subject: [edk2-devel] [PATCH v4 05/14] UefiPayloadPkg: Add
> ImagePropertiesRecordLib Instance
>
> From: Taylor Beebe 
>
> Add an instance of ImagePropertiesRecordLib which will be used by the
> DXE Core.
>
> Signed-off-by: Taylor Beebe 
> Cc: Guo Dong 
> Cc: Sean Rhodes 
> Cc: James Lu 
> Cc: Gua Guo 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 47812048ddcf..8d237b23339a 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -277,6 +277,7 @@ [LibraryClasses]
>#
>
> DebugPrintErrorLevelLib|UefiPayloadPkg/Library/DebugPrintErrorLevelLib
> Hob/DebugPrintErrorLevelLibHob.inf
>
> PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLi
> bNull.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
>  !if $(SOURCE_DEBUG_ENABLE) == TRUE
>
> PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibD
> ebug/PeCoffExtraActionLibDebug.inf
>
> DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLi
> bSerialPort/DebugCommunicationLibSerialPort.inf
> --
> 2.41.0.windows.3
>
>
>
> 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109960): https://edk2.groups.io/g/devel/message/109960
Mute This Topic: https://groups.io/mt/100553435/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 05/14] UefiPayloadPkg: Add ImagePropertiesRecordLib Instance

2023-10-23 Thread Michael D Kinney
Hi Taylor,

I see there have been no reviews from the package maintainers for this
small update to some DSC files.  You can use my Rb for this patch
as a steward.

Reviewed-by: Michael D Kinney 

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Taylor
> Beebe
> Sent: Friday, August 4, 2023 12:47 PM
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Rhodes, Sean
> ; Lu, James ; Guo, Gua
> 
> Subject: [edk2-devel] [PATCH v4 05/14] UefiPayloadPkg: Add
> ImagePropertiesRecordLib Instance
> 
> From: Taylor Beebe 
> 
> Add an instance of ImagePropertiesRecordLib which will be used by the
> DXE Core.
> 
> Signed-off-by: Taylor Beebe 
> Cc: Guo Dong 
> Cc: Sean Rhodes 
> Cc: James Lu 
> Cc: Gua Guo 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 47812048ddcf..8d237b23339a 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -277,6 +277,7 @@ [LibraryClasses]
>#
> 
> DebugPrintErrorLevelLib|UefiPayloadPkg/Library/DebugPrintErrorLevelLib
> Hob/DebugPrintErrorLevelLibHob.inf
> 
> PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLi
> bNull.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
>  !if $(SOURCE_DEBUG_ENABLE) == TRUE
> 
> PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibD
> ebug/PeCoffExtraActionLibDebug.inf
> 
> DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLi
> bSerialPort/DebugCommunicationLibSerialPort.inf
> --
> 2.41.0.windows.3
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v4 04/14] OvmfPkg: Add ImagePropertiesRecordLib Instance

2023-10-23 Thread Michael D Kinney
Hi Taylor,

I see there have been no reviews from the package maintainers for this
small update to some DSC files.  You can use my Rb for this patch
as a steward.

Reviewed-by: Michael D Kinney 

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Taylor
> Beebe
> Sent: Friday, August 4, 2023 12:47 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L ;
> Gerd Hoffmann 
> Subject: [edk2-devel] [PATCH v4 04/14] OvmfPkg: Add
> ImagePropertiesRecordLib Instance
> 
> From: Taylor Beebe 
> 
> Add an instance of ImagePropertiesRecordLib which will be used by the
> DXE Core.
> 
> Signed-off-by: Taylor Beebe 
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Gerd Hoffmann 
> ---
>  OvmfPkg/AmdSev/AmdSevX64.dsc| 1 +
>  OvmfPkg/Bhyve/BhyveX64.dsc  | 1 +
>  OvmfPkg/CloudHv/CloudHvX64.dsc  | 1 +
>  OvmfPkg/IntelTdx/IntelTdxX64.dsc| 1 +
>  OvmfPkg/Microvm/MicrovmX64.dsc  | 1 +
>  OvmfPkg/OvmfPkgIa32.dsc | 1 +
>  OvmfPkg/OvmfPkgIa32X64.dsc  | 1 +
>  OvmfPkg/OvmfPkgX64.dsc  | 1 +
>  OvmfPkg/OvmfXen.dsc | 1 +
>  OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 1 +
>  10 files changed, 10 insertions(+)
> 
> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc
> b/OvmfPkg/AmdSev/AmdSevX64.dsc
> index 2c6ed7c9745f..e8c954a97956 100644
> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> @@ -171,6 +171,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTd
> xLib.inf
> 
> PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.
> inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.
> inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
> 
>  !if $(SOURCE_DEBUG_ENABLE) == TRUE
> 
> PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibD
> ebug/PeCoffExtraActionLibDebug.inf
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index 82c60ace1bbd..ee349e105787 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -173,6 +173,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTd
> xLib.inf
> 
> PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.
> inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.
> inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
> 
> 
> CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customi
> zedDisplayLib.inf
> 
> FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBl
> tLib.inf
> diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc
> b/OvmfPkg/CloudHv/CloudHvX64.dsc
> index e000deed9e4d..91816a10996f 100644
> --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> @@ -182,6 +182,7 @@ [LibraryClasses]
> 
> MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSev
> Lib.inf
> 
> PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.
> inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.
> inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
>  !if $(SMM_REQUIRE) == FALSE
>LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
>  !endif
> diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> index 193657ff2d61..bee98e798717 100644
> --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> @@ -171,6 +171,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTd
> xLib.inf
> 
> PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.
> inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.
> inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
> 
>LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf
> 
> CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customi
> zedDisplayLib.inf
> diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc
> b/OvmfPkg/Microvm/MicrovmX64.dsc
> index 2f7585639374..38e0af6ae101 100644
> --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> @@ -185,6 +185,7 @@ [LibraryClasses]
> 
> MemEncryptTdxLib|OvmfPkg/Library/BaseMemEncryptTdxLib/BaseMemEncryptTd
> xLib.inf
> 
> PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.
> inf
> 
> DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.
> inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
> 
>  !if $(SOURCE_DEBUG_ENABLE) == TRUE
> 
> PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibD
> ebug/PeCoffExtraActionLibDebug.inf
> 

Re: [edk2-devel] [PATCH v4 03/14] EmulatorPkg: Add ImagePropertiesRecordLib Instance

2023-10-23 Thread Michael D Kinney
Hi Taylor,

I see there have been no reviews from the package maintainers for this
small update to some DSC files.  You can use my Rb for this patch
as a steward.

Reviewed-by: Michael D Kinney 

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Taylor
> Beebe
> Sent: Friday, August 4, 2023 12:47 PM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Ni, Ray 
> Subject: [edk2-devel] [PATCH v4 03/14] EmulatorPkg: Add
> ImagePropertiesRecordLib Instance
> 
> From: Taylor Beebe 
> 
> Add an instance of ImagePropertiesRecordLib which will be used by the
> DXE Core.
> 
> Signed-off-by: Taylor Beebe 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> ---
>  EmulatorPkg/EmulatorPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
> index b44435d7e6ee..e18eeca884a5 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -126,6 +126,7 @@ [LibraryClasses]
>SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
>ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> 
> FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
> 
>  !if $(SECURE_BOOT_ENABLE) == TRUE
>RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
> --
> 2.41.0.windows.3
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v4 02/14] ArmVirtPkg: Add ImagePropertiesRecordLib Instance

2023-10-23 Thread Michael D Kinney
Hi Taylor,

I see there have been no reviews from the package maintainers for this
small update to some DSC files.  You can use my Rb for this patch
as a steward.

Reviewed-by: Michael D Kinney 

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Taylor
> Beebe
> Sent: Friday, August 4, 2023 12:47 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Leif Lindholm
> ; Sami Mujawar ; Gerd
> Hoffmann 
> Subject: [edk2-devel] [PATCH v4 02/14] ArmVirtPkg: Add
> ImagePropertiesRecordLib Instance
> 
> From: Taylor Beebe 
> 
> Add an instance of ImagePropertiesRecordLib which will be used by the
> DXE Core.
> 
> Signed-off-by: Taylor Beebe 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Sami Mujawar 
> Cc: Gerd Hoffmann 
> ---
>  ArmVirtPkg/ArmVirt.dsc.inc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 2443e8351c99..b299028b9f51 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -52,6 +52,7 @@ [LibraryClasses.common]
> 
> IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
> 
> UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompr
> essLib.inf
>CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
> +
> ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib
> /ImagePropertiesRecordLib.inf
> 
>UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
>HobLib|ArmVirtPkg/Library/ArmVirtDxeHobLib/ArmVirtDxeHobLib.inf
> --
> 2.41.0.windows.3
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v3 0/7] Use CodeQL CLI

2023-10-23 Thread Michael D Kinney
Acked-by: Michael D Kinney 

> -Original Message-
> From: Michael Kubacki 
> Sent: Monday, October 23, 2023 11:13 AM
> To: devel@edk2.groups.io; Feng, Bob C ; Gao,
> Liming ; Kinney, Michael D
> ; Rebecca Cran ; Sean
> Brogan ; Chen, Christine
> 
> Subject: Re: [edk2-devel] [PATCH v3 0/7] Use CodeQL CLI
> 
> Another reminder. It would be nice to get this merged soon so actual
> code fixes can follow.
> 
> Thanks,
> Michael
> 
> On 10/19/2023 9:07 PM, Michael Kubacki wrote:
> > A reminder to review this series. It's been on the mailing list for
> a
> > few weeks now.
> >
> > Thanks,
> > Michael
> >
> > On 10/17/2023 9:04 PM, Michael Kubacki wrote:
> >> From: Michael Kubacki 
> >>
> >> CodeQL currently runs via the codeql-analysis.yml GitHub workflow
> >> which uses the github/codeql-action/init@v2 action (pre-build)
> >> and the github/codeql-action/analyze@v2 action (post-build) to
> >> setup the CodeQL environment and extract results.
> >>
> >> This infrastructure is removed in preparation for a new design that
> >> will directly run the CodeQL CLI as part of the build. This will
> >> allow CodeQL to be run locally as part of the normal build process
> >> with results that match 1:1 with CI builds.
> >>
> >> The CodeQL CLI design is automatically driven by a set of CodeQL
> >> plugins:
> >>
> >>    1. `CodeQlBuildPlugin` - Used to produce a CodeQL database from
> a
> >>    build.
> >>    2. `CodeQlAnalyzePlugin` - Used to analyze a CodeQL database.
> >>
> >> This approach offers the following advantages:
> >>
> >>    1. Provides exactly the same results locally as on a CI server.
> >>    2. Integrates very well into IDEs such as VS Code.
> >>    3. Very simple to use - just use normal Stuart update and build
> >>   commands.
> >>    4. Very simple to understand - minimally wraps the official
> CodeQL
> >>   CLI.
> >>    5. Very simple to integrate - works like any other Stuart build
> >>   plugin.
> >>    6. Portable - not tied to Azure DevOps specific, GitHub
> specific,
> >>   or other host infrastructure.
> >>    7. Versioned - the query and filters are versioned in source
> >>   control so easy to find and track.
> >>
> >> The appropriate CodeQL CLI is downloaded for the host OS by passing
> >> the `--codeql` argument to the update command.
> >>
> >>    `stuart_update -c .pytool/CISettings.py --codeql`
> >>
> >> After that, CodeQL can be run in a build by similarly passing the
> >> `--codeql` argument to the build command. For example:
> >>
> >>    `stuart_ci_build -c .pytool/CISettings.py --codeql`
> >>
> >> Going forward, CI will simply use those commands in CodeQL builds
> >> to get results instead of the CodeQL GitHub actions.
> >>
> >> When `--codeql` is specified in the build command, each package
> will
> >> contain two main artifacts in the Build directory.
> >>
> >>    1. The CodeQL database for the package
> >>    2. The CodeQL SARIF (result) file for the package
> >>
> >> The CodeQL database (1) can be used to run queries against without
> >> rebuilding any code. The SARIF result file (2) is the result of
> >> running enabled queries against the database.
> >>
> >> SARIF stands for Static Analysis Results Interchange Format and it
> >> is an industry standard format for output from static analysis
> tools.
> >>
> >> https://sarifweb.azurewebsites.net/
> >>
> >> The SARIF file can be opened with any standard SARIF file viewer
> >> such as this one for VS Code:
> >>
> >> https://marketplace.visualstudio.com/items?itemName=MS-
> SarifVSCode.sarif-viewer
> >>
> >> That includes the ability to jump directly to issues in the source
> >> code file with relevant code highlighted and suggestions included.
> >>
> >> This means that after simply adding `--codeql` to the normal build
> >> commands, a database will be present for future querying and a
> SARIF
> >> result file will be present to allow the developer to immediately
> >> start fixing issues.
> >>
> >> More details about the location of these and usage is in the
> >> BaseTools/Plugin/CodeQL/Readme.md included in this patch series.
> >>
> >> The CI process pushes the SARIF file to GitHub Code Scanning so the
> >> results are generated exactly the same way they are locally.
> >>
> >> All build logs and the SARIF file for each package are uploaded to
> >> the GitHub action run as artifacts. If a CodeQL issue is found, a
> >> developer can download the SARIF file directly from the GitHub
> action
> >> run to fix the problem without needing to rebuild locally.
> >>
> >> An example run of these changes showing the packages built and
> output
> >> logs and SARIF files is available here:
> >>
> >> https://github.com/tianocore/edk2/actions/runs/6317077528
> >>
> >> The series enables a new set of CodeQL queries that helps find
> useful
> >> issues in the codebase. So, new CodeQL results will appear in the
> edk2
> >> GitHub Code Scanning area after the change. It is expected that the
> >> community will work together 

[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, October 23, 2023 #cal-notice

2023-10-23 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, October 23, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

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

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

*Description:*

TianoCore community,

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

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

Anyone is welcome to join.

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

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


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




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, October 23, 2023 #cal-reminder

2023-10-23 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, October 23, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

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

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

*Description:*

TianoCore community,

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

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

Anyone is welcome to join.

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

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


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




Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.

2023-10-23 Thread Pedro Falcato
On Mon, Oct 23, 2023 at 3:18 PM Nickle Wang via groups.io
 wrote:
>
> There are two definitions for below functions in RedfishCrtLib.h. Create
> this change to remote duplicated functions.
> Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
> strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> Cc: Mike Maslenkin 
> ---
>  RedfishPkg/Include/Library/RedfishCrtLib.h | 81 +-
>  1 file changed, 1 insertion(+), 80 deletions(-)
>
> diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h 
> b/RedfishPkg/Include/Library/RedfishCrtLib.h
> index 23c6acfca33e..80f0e10de8e7 100644
> --- a/RedfishPkg/Include/Library/RedfishCrtLib.h
> +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
> @@ -3,6 +3,7 @@
>
>Copyright (c) 2019, Intel Corporation. All rights reserved.
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Can we take it easy with the copyright lines? This patch has literally
no additions apart from this copyright line, how can someone ever
claim copyright over this patch...

-- 
Pedro


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




Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.

2023-10-23 Thread Mike Maslenkin
On Mon, Oct 23, 2023 at 5:18 PM Nickle Wang  wrote:
>
> There are two definitions for below functions in RedfishCrtLib.h. Create
> this change to remote duplicated functions.
> Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
> strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> Cc: Mike Maslenkin 
> ---
>  RedfishPkg/Include/Library/RedfishCrtLib.h | 81 +-
>  1 file changed, 1 insertion(+), 80 deletions(-)
>
> diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h 
> b/RedfishPkg/Include/Library/RedfishCrtLib.h
> index 23c6acfca33e..80f0e10de8e7 100644
> --- a/RedfishPkg/Include/Library/RedfishCrtLib.h
> +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
> @@ -3,6 +3,7 @@
>
>Copyright (c) 2019, Intel Corporation. All rights reserved.
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -172,20 +173,6 @@ free(
>void *
>);
>
> -void   *
> -memset (
> -  void *,
> -  int,
> -  size_t
> -  );
> -
> -int
> -memcmp  (
> -  const void *,
> -  const void *,
> -  size_t
> -  );
> -
>  int
>  isdigit (
>int
> @@ -216,27 +203,6 @@ isalnum (
>int
>);
>
> -void   *
> -memcpy (
> -  void *,
> -  const void *,
> -  size_t
> -  );
> -
> -void   *
> -memset (
> -  void *,
> -  int,
> -  size_t
> -  );
> -
> -void   *
> -memchr (
> -  const void *,
> -  int,
> -  size_t
> -  );
> -
>  int
>  memcmp  (
>const void *,
> @@ -251,12 +217,6 @@ memmove(
>size_t
>);
>
> -int
> -strcmp  (
> -  const char *,
> -  const char *
> -  );
> -
>  int
>  strncmp (
>const char *,
> @@ -275,24 +235,6 @@ strlen  (
>const char *
>);
>
> -char   *
> -strcat (
> -  char *,
> -  const char *
> -  );
> -
> -char   *
> -strchr (
> -  const char *,
> -  int
> -  );
> -
> -int
> -strcasecmp  (
> -  const char *,
> -  const char *
> -  );
> -
>  int
>  strncasecmp (
>const char *,
> @@ -300,21 +242,6 @@ strncasecmp (
>size_t
>);
>
> -char   *
> -strncpy(
> -  char *,
> -  size_t,
> -  const char *,
> -  size_t
> -  );
> -
> -int
> -strncmp (
> -  const char *,
> -  const char *,
> -  size_t
> -  );
> -
>  char   *
>  strrchr(
>const char *,
> @@ -328,12 +255,6 @@ strtoul (
>int
>);
>
> -char *
> -strstr  (
> -  const char  *s1,
> -  const char  *s2
> -  );
> -
>  long
>  strtol  (
>const char *,
> --
> 2.17.1
>

Hi Nickle

double declaration of 'strcpy' is still there.

Best regards,
Mike.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109951): https://edk2.groups.io/g/devel/message/109951
Mute This Topic: https://groups.io/mt/102136148/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] DynamicTablesPkg/AmlLib: Enumerate memory attributes

2023-10-23 Thread Sami Mujawar

I had to add an entry to satisfy the CI spell checker.

With that,

Merged as ec7f73436646..309450db268c

Regards,

Sami Mujawar

On 23/10/2023 06:12 pm, Sami Mujawar via groups.io wrote:

Hi Jeshua,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 05/10/2023 05:38 pm, Jeshua Smith wrote:

AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable
and MemoryRangeType parameters treat specific values as having
specific meanings as defined by the spec. This change adds enums to map
those meanings to their corresponding values.

Signed-off-by: Jeshua Smith 
---

Notes:
  v2: based on comments from Pierre Gondois
   - Added documentation reference
   - Changed enum type and member names to closer align with 
documentation

   - Changed enum member names to CamelCase
   - Added *Max members to enums
   - Updated the signatures of relevant functions to use the enum types
 instead of UNIT8

  .../Include/Library/AmlLib/AmlLib.h   | 49 +--
  .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c    | 12 ++---
  .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   |  8 +--
  3 files changed, 55 insertions(+), 14 deletions(-)

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

index 510c79a399..71e8539b30 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -59,6 +59,47 @@ typedef void *AML_DATA_NODE_HANDLE;
    #endif // AML_HANDLE
  +/** Memory attributes, _MEM (2 bits)
+
+  Possible values are:
+    0-The memory is non-cacheable
+    1-The memory is cacheable (DEPRECATED)
+    2-The memory is cacheable and supports
+  write combining (DEPRECATED)
+    3-The memory is cacheable and prefetchable
+
+  @par Reference(s):
+  - ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"
+
+**/
+typedef enum {
+  AmlMemoryNonCacheable  = 0,
+  AmlMemoryCacheable = 1,
+  AmlMemoryCacheableWriteCombine = 2,
+  AmlMemoryCacheablePrefetch = 3,
+  AmlMemoryCacheablityMax    = 4
+} AML_MEMORY_ATTRIBUTES_MEM;
+
+/** Memory attributes, _MTP (2 bits)
+
+  Possible values are:
+    0-AddressRangeMemory
+    1-AddressRangeReserved
+    2-AddressRangeACPI
+    3-AddressRangeNVS
+
+  @par Reference(s):
+  - ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"
+
+**/
+typedef enum {
+  AmlAddressRangeMemory   = 0,
+  AmlAddressRangeReserved = 1,
+  AmlAddressRangeACPI = 2,
+  AmlAddressRangeNVS  = 3,
+  AmlAddressRangeMax  = 4
+} AML_MEMORY_ATTRIBUTES_MTP;
+
  /** Parse the definition block.
      The function parses the whole AML blob. It starts with the ACPI 
DSDT/SSDT

@@ -578,7 +619,7 @@ AmlCodeGenRdDWordMemory (
    IN    BOOLEAN IsPosDecode,
    IN    BOOLEAN IsMinFixed,
    IN    BOOLEAN IsMaxFixed,
-  IN    UINT8 Cacheable,
+  IN    AML_MEMORY_ATTRIBUTES_MEM Cacheable,
    IN    BOOLEAN IsReadWrite,
    IN    UINT32 AddressGranularity,
    IN    UINT32 AddressMinimum,
@@ -587,7 +628,7 @@ AmlCodeGenRdDWordMemory (
    IN    UINT32 RangeLength,
    IN    UINT8 ResourceSourceIndex,
    IN  CONST CHAR8 *ResourceSource,
-  IN    UINT8 MemoryRangeType,
+  IN    AML_MEMORY_ATTRIBUTES_MTP MemoryRangeType,
    IN    BOOLEAN IsTypeStatic,
    IN    AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
    OUT   AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
@@ -809,7 +850,7 @@ AmlCodeGenRdQWordMemory (
    IN    BOOLEAN IsPosDecode,
    IN    BOOLEAN IsMinFixed,
    IN    BOOLEAN IsMaxFixed,
-  IN    UINT8 Cacheable,
+  IN    AML_MEMORY_ATTRIBUTES_MEM Cacheable,
    IN    BOOLEAN IsReadWrite,
    IN    UINT64 AddressGranularity,
    IN    UINT64 AddressMinimum,
@@ -818,7 +859,7 @@ AmlCodeGenRdQWordMemory (
    IN    UINT64 RangeLength,
    IN    UINT8 ResourceSourceIndex,
    IN  CONST CHAR8 *ResourceSource,
-  IN    UINT8 MemoryRangeType,
+  IN    AML_MEMORY_ATTRIBUTES_MTP MemoryRangeType,
    IN    BOOLEAN IsTypeStatic,
    IN    AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
    OUT   AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 


index 9ddaddc198..72873709aa 100644
--- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c

@@ -566,7 +566,7 @@ GeneratePciCrs (
 IsPosDecode,
 TRUE,
 TRUE,
-   TRUE,
+   AmlMemoryCacheable,
 TRUE,
 0,
 AddrMapInfo->PciAddress,
@@ -575,7 +575,7 @@ GeneratePciCrs (
 AddrMapInfo->AddressSize,
 0,

Re: [edk2-devel] [PATCH v3 0/7] Use CodeQL CLI

2023-10-23 Thread Michael Kubacki
Another reminder. It would be nice to get this merged soon so actual 
code fixes can follow.


Thanks,
Michael

On 10/19/2023 9:07 PM, Michael Kubacki wrote:
A reminder to review this series. It's been on the mailing list for a 
few weeks now.


Thanks,
Michael

On 10/17/2023 9:04 PM, Michael Kubacki wrote:

From: Michael Kubacki 

CodeQL currently runs via the codeql-analysis.yml GitHub workflow
which uses the github/codeql-action/init@v2 action (pre-build)
and the github/codeql-action/analyze@v2 action (post-build) to
setup the CodeQL environment and extract results.

This infrastructure is removed in preparation for a new design that
will directly run the CodeQL CLI as part of the build. This will
allow CodeQL to be run locally as part of the normal build process
with results that match 1:1 with CI builds.

The CodeQL CLI design is automatically driven by a set of CodeQL
plugins:

   1. `CodeQlBuildPlugin` - Used to produce a CodeQL database from a
   build.
   2. `CodeQlAnalyzePlugin` - Used to analyze a CodeQL database.

This approach offers the following advantages:

   1. Provides exactly the same results locally as on a CI server.
   2. Integrates very well into IDEs such as VS Code.
   3. Very simple to use - just use normal Stuart update and build
  commands.
   4. Very simple to understand - minimally wraps the official CodeQL
  CLI.
   5. Very simple to integrate - works like any other Stuart build
  plugin.
   6. Portable - not tied to Azure DevOps specific, GitHub specific,
  or other host infrastructure.
   7. Versioned - the query and filters are versioned in source
  control so easy to find and track.

The appropriate CodeQL CLI is downloaded for the host OS by passing
the `--codeql` argument to the update command.

   `stuart_update -c .pytool/CISettings.py --codeql`

After that, CodeQL can be run in a build by similarly passing the
`--codeql` argument to the build command. For example:

   `stuart_ci_build -c .pytool/CISettings.py --codeql`

Going forward, CI will simply use those commands in CodeQL builds
to get results instead of the CodeQL GitHub actions.

When `--codeql` is specified in the build command, each package will
contain two main artifacts in the Build directory.

   1. The CodeQL database for the package
   2. The CodeQL SARIF (result) file for the package

The CodeQL database (1) can be used to run queries against without
rebuilding any code. The SARIF result file (2) is the result of
running enabled queries against the database.

SARIF stands for Static Analysis Results Interchange Format and it
is an industry standard format for output from static analysis tools.

https://sarifweb.azurewebsites.net/

The SARIF file can be opened with any standard SARIF file viewer
such as this one for VS Code:

https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer

That includes the ability to jump directly to issues in the source
code file with relevant code highlighted and suggestions included.

This means that after simply adding `--codeql` to the normal build
commands, a database will be present for future querying and a SARIF
result file will be present to allow the developer to immediately
start fixing issues.

More details about the location of these and usage is in the
BaseTools/Plugin/CodeQL/Readme.md included in this patch series.

The CI process pushes the SARIF file to GitHub Code Scanning so the
results are generated exactly the same way they are locally.

All build logs and the SARIF file for each package are uploaded to
the GitHub action run as artifacts. If a CodeQL issue is found, a
developer can download the SARIF file directly from the GitHub action
run to fix the problem without needing to rebuild locally.

An example run of these changes showing the packages built and output
logs and SARIF files is available here:

https://github.com/tianocore/edk2/actions/runs/6317077528

The series enables a new set of CodeQL queries that helps find useful
issues in the codebase. So, new CodeQL results will appear in the edk2
GitHub Code Scanning area after the change. It is expected that the
community will work together to prioritize and resolve issues to improve
the quality of the codebase.

V3 Changes:

1. Add a "Resolution Guidelines" section to the CodeQL plugin readme
    file based on feedback in the October 16, 2023 Tianocore Tools &
    CI meeting to capture some notes useful in solving issues in the
    file.

V2 Changes:

1. Enable CodeQL audit mode. This is because a new patch also enables
    queries that will result in unresolved issues so audit mode is needed
    for the build to succeed.
2. Enable new CodeQL queries. This will enable new CodeQL queries so the
    issues are easier to find and track.

Links and refernces:

   - CodeQL Overview:
 https://codeql.github.com/docs/codeql-overview/
   - CodeQL open-source queries:
 https://github.com/github/codeql
   - CodeQL CLI:
 

[edk2-devel] [PATCH v2 12/12] IntelFsp2WrapperPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Chen Gang C 
Cc: Star Zeng 
Cc: Ted Kuo 
Cc: Ashraf Ali S 
Cc: Susovan Mohapatra 
Signed-off-by: Joey Vagedes 

Reviewed-by: Nate DeSimone 
---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml
index 45cb5a7d6f32..2d32bc65b415 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "IntelFsp2WrapperPkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



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




[edk2-devel] [PATCH v2 10/12] MdePkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Joey Vagedes 

Reviewed-by: Liming Gao 
---
 MdePkg/MdePkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml
index f024b48685ef..8d9c63b0e535 100644
--- a/MdePkg/MdePkg.ci.yaml
+++ b/MdePkg/MdePkg.ci.yaml
@@ -8,6 +8,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "MdePkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": [
-- 
2.34.1



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




[edk2-devel] [PATCH v2 11/12] MdeModulePkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Joey Vagedes 

Reviewed-by: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.ci.yaml 
b/MdeModulePkg/MdeModulePkg.ci.yaml
index f69989087b4c..669f54e33c0d 100644
--- a/MdeModulePkg/MdeModulePkg.ci.yaml
+++ b/MdeModulePkg/MdeModulePkg.ci.yaml
@@ -7,6 +7,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "MdeModulePkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



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




[edk2-devel] [PATCH v2 08/12] RedfishPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Joey Vagedes 

Reviewed-by: Abner Chang https://edk2.groups.io/g/devel/message/109943
Mute This Topic: https://groups.io/mt/102140976/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 07/12] IntelFsp2Pkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Ray Han Lim Ng 
Cc: Star Zeng 
Cc: Ted Kuo 
Cc: Ashraf Ali S 
Cc: Susovan Mohapatra 
Signed-off-by: Joey Vagedes 

Reviewed-by: Nate DeSimone 
---
 IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml 
b/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml
index 95d18cfcde1f..bd6f4cc961b0 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "IntelFsp2Pkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



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




[edk2-devel] [PATCH v2 06/12] FmpDevicePkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Joey Vagedes 

Reviewed-by: Liming Gao 
---
 FmpDevicePkg/FmpDevicePkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/FmpDevicePkg/FmpDevicePkg.ci.yaml 
b/FmpDevicePkg/FmpDevicePkg.ci.yaml
index 1b3e2187356d..1e687a53fa8f 100644
--- a/FmpDevicePkg/FmpDevicePkg.ci.yaml
+++ b/FmpDevicePkg/FmpDevicePkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "FmpDevicePkg.dsc",
+},
 "LicenseCheck": {
 "IgnoreFiles": []
 },
-- 
2.34.1



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




[edk2-devel] [PATCH v2 05/12] EmbeddedPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Abner Chang 
Cc: Daniel Schaefer 
Signed-off-by: Joey Vagedes 

Reviewed-by: Abner Chang 
---
 EmbeddedPkg/EmbeddedPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/EmbeddedPkg/EmbeddedPkg.ci.yaml b/EmbeddedPkg/EmbeddedPkg.ci.yaml
index 21f30108a29f..96a60a6f8b4d 100644
--- a/EmbeddedPkg/EmbeddedPkg.ci.yaml
+++ b/EmbeddedPkg/EmbeddedPkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "EmbeddedPkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



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




[edk2-devel] [PATCH v2 04/12] DynamicTablesPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Sami Mujawar 
Cc: Alexei Fedorov 
Cc: Pierre Gondois 
Signed-off-by: Joey Vagedes 

Reviewed-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml 
b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
index 5addf8626841..f37842f65246 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
+++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
@@ -5,6 +5,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "DynamicTablesPkg.dsc",
+},
 "EccCheck": {
 ## Exception sample looks like below:
 ## "ExceptionList": [
-- 
2.34.1



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




[edk2-devel] [PATCH v2 03/12] CryptoPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Jiewen Yao 
Cc: Yi Li 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Signed-off-by: Joey Vagedes 

Reviewed-by: Yi Li 
---
 CryptoPkg/CryptoPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml
index 47f29759676d..4cec206477bc 100644
--- a/CryptoPkg/CryptoPkg.ci.yaml
+++ b/CryptoPkg/CryptoPkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "CryptoPkg.dsc",
+},
 "LicenseCheck": {
 "IgnoreFiles": [
 # These directories contain auto-generated OpenSSL content
-- 
2.34.1



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




[edk2-devel] [PATCH v2 00/12] *** Update Edk2-pytools to latest versions ***

2023-10-23 Thread Joey Vagedes via groups.io
**Update: Version 2 of this patch series contains only packages that have
reviewed this change. This patch series is ready to be merged. Maintainers of
other packages may add these changes in a follow up patch series.

Updates Edk2-pytools to the latest versions, which introduces a new Policy
for detecting which packages must be built given a set of changes. This policy
is used when a library class instance INF is changed. When this occurs, it will
review the PrEval:DscPath provided in the CI YAML file and determine if the
package uses the library instance or not. If it does, it will build and test
the package.

Due to these changes, each package must now include an entry in it's CI YAML
file (PrEval:DscPath). If the package does not provide this entry, this policy
will be skipped.


Cc: Jiewen Yao 
Cc: Yi Li 
Cc: Sami Mujawar 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Ray Han Lim Ng 
Cc: Jian J Wang 
Cc: Liming Gao 


Joey Vagedes (12):
  Edk2: edk2-pytools: Update to latest versions
  UnitTestFrameworkPkg: CI: Add PrEval entry
  CryptoPkg: CI: Add PrEval entry
  DynamicTablesPkg: CI: Add PrEval entry
  EmbeddedPkg: CI: Add PrEval entry
  FmpDevicePkg: CI: Add PrEval entry
  IntelFsp2Pkg: CI: Add PrEval entry
  RedfishPkg: CI: Add PrEval entry
  PrmPkg: CI: Add PrEval entry
  MdePkg: CI: Add PrEval entry
  MdeModulePkg: CI: Add PrEval entry
  IntelFsp2WrapperPkg: CI: Add PrEval entry

 CryptoPkg/CryptoPkg.ci.yaml   | 3 +++
 DynamicTablesPkg/DynamicTablesPkg.ci.yaml | 3 +++
 EmbeddedPkg/EmbeddedPkg.ci.yaml   | 3 +++
 FmpDevicePkg/FmpDevicePkg.ci.yaml | 3 +++
 IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml | 3 +++
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml   | 3 +++
 MdeModulePkg/MdeModulePkg.ci.yaml | 3 +++
 MdePkg/MdePkg.ci.yaml | 3 +++
 PrmPkg/PrmPkg.ci.yaml | 3 +++
 RedfishPkg/RedfishPkg.ci.yaml | 3 +++
 UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml | 3 +++
 pip-requirements.txt  | 4 ++--
 12 files changed, 35 insertions(+), 2 deletions(-)

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109935): https://edk2.groups.io/g/devel/message/109935
Mute This Topic: https://groups.io/mt/102140967/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] DynamicTablesPkg/AmlLib: Enumerate memory attributes

2023-10-23 Thread Sami Mujawar

Hi Jeshua,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 05/10/2023 05:38 pm, Jeshua Smith wrote:

AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable
and MemoryRangeType parameters treat specific values as having
specific meanings as defined by the spec. This change adds enums to map
those meanings to their corresponding values.

Signed-off-by: Jeshua Smith 
---

Notes:
  v2: based on comments from Pierre Gondois
   - Added documentation reference
   - Changed enum type and member names to closer align with documentation
   - Changed enum member names to CamelCase
   - Added *Max members to enums
   - Updated the signatures of relevant functions to use the enum types
 instead of UNIT8

  .../Include/Library/AmlLib/AmlLib.h   | 49 +--
  .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c| 12 ++---
  .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   |  8 +--
  3 files changed, 55 insertions(+), 14 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 510c79a399..71e8539b30 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -59,6 +59,47 @@ typedef void *AML_DATA_NODE_HANDLE;
  
  #endif // AML_HANDLE
  
+/** Memory attributes, _MEM (2 bits)

+
+  Possible values are:
+0-The memory is non-cacheable
+1-The memory is cacheable (DEPRECATED)
+2-The memory is cacheable and supports
+  write combining (DEPRECATED)
+3-The memory is cacheable and prefetchable
+
+  @par Reference(s):
+  - ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"
+
+**/
+typedef enum {
+  AmlMemoryNonCacheable  = 0,
+  AmlMemoryCacheable = 1,
+  AmlMemoryCacheableWriteCombine = 2,
+  AmlMemoryCacheablePrefetch = 3,
+  AmlMemoryCacheablityMax= 4
+} AML_MEMORY_ATTRIBUTES_MEM;
+
+/** Memory attributes, _MTP (2 bits)
+
+  Possible values are:
+0-AddressRangeMemory
+1-AddressRangeReserved
+2-AddressRangeACPI
+3-AddressRangeNVS
+
+  @par Reference(s):
+  - ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"
+
+**/
+typedef enum {
+  AmlAddressRangeMemory   = 0,
+  AmlAddressRangeReserved = 1,
+  AmlAddressRangeACPI = 2,
+  AmlAddressRangeNVS  = 3,
+  AmlAddressRangeMax  = 4
+} AML_MEMORY_ATTRIBUTES_MTP;
+
  /** Parse the definition block.
  
The function parses the whole AML blob. It starts with the ACPI DSDT/SSDT

@@ -578,7 +619,7 @@ AmlCodeGenRdDWordMemory (
INBOOLEAN IsPosDecode,
INBOOLEAN IsMinFixed,
INBOOLEAN IsMaxFixed,
-  INUINT8 Cacheable,
+  INAML_MEMORY_ATTRIBUTES_MEM Cacheable,
INBOOLEAN IsReadWrite,
INUINT32 AddressGranularity,
INUINT32 AddressMinimum,
@@ -587,7 +628,7 @@ AmlCodeGenRdDWordMemory (
INUINT32 RangeLength,
INUINT8 ResourceSourceIndex,
IN  CONST CHAR8 *ResourceSource,
-  INUINT8 MemoryRangeType,
+  INAML_MEMORY_ATTRIBUTES_MTP MemoryRangeType,
INBOOLEAN IsTypeStatic,
INAML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
OUT   AML_DATA_NODE_HANDLE*NewRdNode  OPTIONAL
@@ -809,7 +850,7 @@ AmlCodeGenRdQWordMemory (
INBOOLEAN IsPosDecode,
INBOOLEAN IsMinFixed,
INBOOLEAN IsMaxFixed,
-  INUINT8 Cacheable,
+  INAML_MEMORY_ATTRIBUTES_MEM Cacheable,
INBOOLEAN IsReadWrite,
INUINT64 AddressGranularity,
INUINT64 AddressMinimum,
@@ -818,7 +859,7 @@ AmlCodeGenRdQWordMemory (
INUINT64 RangeLength,
INUINT8 ResourceSourceIndex,
IN  CONST CHAR8 *ResourceSource,
-  INUINT8 MemoryRangeType,
+  INAML_MEMORY_ATTRIBUTES_MTP MemoryRangeType,
INBOOLEAN IsTypeStatic,
INAML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
OUT   AML_DATA_NODE_HANDLE*NewRdNode  OPTIONAL
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 9ddaddc198..72873709aa 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -566,7 +566,7 @@ GeneratePciCrs (
 IsPosDecode,
 TRUE,
 TRUE,
-   TRUE,
+   AmlMemoryCacheable,
 TRUE,
 0,
 AddrMapInfo->PciAddress,
@@ -575,7 +575,7 @@ GeneratePciCrs (
 AddrMapInfo->AddressSize,
 0,
 NULL,
-   0,
+   AmlAddressRangeMemory,
 TRUE,
 CrsNode,
 NULL
@@ -588,7 +588,7 @@ 

Re: [edk2-devel] [PATCH 0/2] DynamicTablesPkg/TableHelperLib updates

2023-10-23 Thread Sami Mujawar

Merged as c591395f4ab5..ec7f73436646

Thanks.

Regards,

Sami Mujawar


On 23/10/2023 05:55 pm, Sami Mujawar via groups.io wrote:

Hi Jeshua,

Thank you for these fixes.

For this series,

Reviewed-by: Sami Mujawar 

I have now queued this up for merging.

Regards,

Sami Mujawar

On 06/10/2023 05:28 pm, Jeshua Smith wrote:
While using the ConfigurationManagerObjectParser to dump objects and 
debug

adding new objects, I noticed some bugs and deficiencies. This series is
intended to address those.

Jeshua Smith (2):
   DynamicTablesPkg/TableHelperLib: Fix and improve text handling
   DynamicTablesPkg/TableHelperLib: Enhance error handling

  .../ConfigurationManagerObjectParser.c    | 223 ++
  1 file changed, 176 insertions(+), 47 deletions(-)










-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109933): https://edk2.groups.io/g/devel/message/109933
Mute This Topic: https://groups.io/mt/101801382/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] DynamicTablesPkg/TableHelperLib updates

2023-10-23 Thread Sami Mujawar

Hi Jeshua,

Thank you for these fixes.

For this series,

Reviewed-by: Sami Mujawar 

I have now queued this up for merging.

Regards,

Sami Mujawar

On 06/10/2023 05:28 pm, Jeshua Smith wrote:

While using the ConfigurationManagerObjectParser to dump objects and debug
adding new objects, I noticed some bugs and deficiencies. This series is
intended to address those.

Jeshua Smith (2):
   DynamicTablesPkg/TableHelperLib: Fix and improve text handling
   DynamicTablesPkg/TableHelperLib: Enhance error handling

  .../ConfigurationManagerObjectParser.c| 223 ++
  1 file changed, 176 insertions(+), 47 deletions(-)




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




Re: [edk2-devel] [PATCH v3 00/11] Update MADT for ACPI 6.5, and add TRBE & ETE support

2023-10-23 Thread Jeshua Smith via groups.io
This series has received:
Reviewed-by: Pierre Gondois 

And also For 1-2,12-13:
Reviewed-by: Leif Lindholm 

Can this be merged?

-Original Message-
From: Pierre Gondois 
Sent: Friday, September 22, 2023 8:51 AM
To: Sami Mujawar ; devel@edk2.groups.io
Cc: ardb+tianoc...@kernel.org; quic_llind...@quicinc.com; 
michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; zhiguang@intel.com; 
zhichao@intel.com; anshuman.khand...@arm.com; matteo.carl...@arm.com; 
akanksha.ja...@arm.com; sibel.allin...@arm.com; Jeshua Smith 
; n...@arm.com
Subject: Re: [PATCH v3 00/11] Update MADT for ACPI 6.5, and add TRBE & ETE 
support

External email: Use caution opening links or attachments


Hi Sami,
Thanks for the update:
Reviewed-by: Pierre Gondois 

Regards,
Pierre

On 9/22/23 16:35, Sami Mujawar wrote:
> This patch series provides the following updates:
> - The patches 1 & 2 add the new fields introduced
>in MADT (APIC table) by ACPI 6.5 and the patch
>7/11 updates the Acpiview MADT parser accordingly.
> - The patches 3, 4 & 5 adds TRBE support to the MADT
>table generator in DynamicTablesPkg.
> - Patch 6/11 updates the FADT ACPI revision to 6.5.
> - The patches 8, 9 & 10 add support to generate ETE
>device nodes.
> - The 3rd last last patch series fixes a bug wherein
>the CPC token was incorrectly referenced.
> - The last 2 patches in the series introduce helper
>functions to detect if TRBE and ETE features are
>supported.
>
> Updates from v2 patch series:
> - Updated patch 5 to removed superfluous initialisation
>of TRBE interrupt field for ACPI 6.4.
> - Patch 12/13 introduces a helper function in ArmLib to
>detect if TRBE is supported.
> - Patch 13/13 introduces a helper function in ArmLib to
>detect if ETE is supported.
>
> Updates from v1 patch series:
>- Fixed issue with setting TRBE interrupt in patch 5/11.
>
> The changes can be seen at:
> https://github.com/samimujawar/edk2/tree/2620_ete_dev_fvp_v3
>
> Sami Mujawar (13):
>MdePkg: MADT: Add Online capable flag in GICC
>MdePkg: MADT: Add TRBE interrupt to GICC
>DynamicTablesPkg: Add TRBE interrupt to GICC object
>DynamicTablesPkg: Add TRBE interrupt to GICC object parser
>DynamicTablesPkg: Update MADT generator for ACPI 6.5
>DynamicTablesPkg: Update FADT generator to ACPI 6.5
>ShellPkg: Acpiview: Update MADT parser for TRBE interrupt
>DynamicTablesPkg: Add an ET info object to Arm namespace
>DynamicTablesPkg: Add an ET info object parser
>DynamicTablesPkg: Add ETE device to CPU node in AML
>DynamicTablesPkg: Fix referencing of CPC token
>ArmPkg/ArmLib: Add ArmHasTrbe () helper function
>ArmPkg/ArmLib: Add ArmHasEte () helper function
>
>   ArmPkg/Include/Chipset/AArch64.h
>|   4 +
>   ArmPkg/Include/Library/ArmLib.h 
>|  25 +++
>   ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c  
>|  31 
>   DynamicTablesPkg/Include/ArmNameSpaceObjects.h  
>|  32 +++-
>   DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
>| 108 +--
>   DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
>|  79 
>   
> DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
>  | 188 +++-
>   
> DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
>  |  11 +-
>   
> DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>   |  11 +-
>   MdePkg/Include/IndustryStandard/Acpi65.h
>|   4 +-
>   ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c  
>|  48 -
>   11 files changed, 442 insertions(+), 99 deletions(-)
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109931): https://edk2.groups.io/g/devel/message/109931
Mute This Topic: https://groups.io/mt/101522262/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] DynamicTablesPkg/TableHelperLib updates

2023-10-23 Thread Jeshua Smith via groups.io
The patches in this series have both individually received:
Reviewed-by: Pierre Gondois 

Can this be merged?

-Original Message-
From: Jeshua Smith  
Sent: Friday, October 6, 2023 10:28 AM
To: devel@edk2.groups.io
Cc: sami.muja...@arm.com; pierre.gond...@arm.com; Jeshua Smith 

Subject: [PATCH 0/2] DynamicTablesPkg/TableHelperLib updates

While using the ConfigurationManagerObjectParser to dump objects and debug 
adding new objects, I noticed some bugs and deficiencies. This series is 
intended to address those.

Jeshua Smith (2):
  DynamicTablesPkg/TableHelperLib: Fix and improve text handling
  DynamicTablesPkg/TableHelperLib: Enhance error handling

 .../ConfigurationManagerObjectParser.c| 223 ++
 1 file changed, 176 insertions(+), 47 deletions(-)

--
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109930): https://edk2.groups.io/g/devel/message/109930
Mute This Topic: https://groups.io/mt/101801382/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] DynamicTablesPkg/AmlLib: Enumerate memory attributes

2023-10-23 Thread Jeshua Smith via groups.io
Can this be merged?

-Original Message-
From: Pierre Gondois 
Sent: Tuesday, October 10, 2023 1:31 AM
To: Jeshua Smith ; devel@edk2.groups.io
Cc: sami.muja...@arm.com; quic_llind...@quicinc.com; ardb+tianoc...@kernel.org
Subject: Re: [PATCH v2] DynamicTablesPkg/AmlLib: Enumerate memory attributes

External email: Use caution opening links or attachments


Hi Jeshua,
Thanks for the v2,

Reviewed-by: Pierre Gondois 

Sami:
There was also a tag from Leif:
https://edk2.groups.io/g/devel/message/109285

Regards,
Pierre

On 10/5/23 18:38, Jeshua Smith wrote:
> AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable and
> MemoryRangeType parameters treat specific values as having specific
> meanings as defined by the spec. This change adds enums to map those
> meanings to their corresponding values.
>
> Signed-off-by: Jeshua Smith 
> ---
>
> Notes:
>   v2: based on comments from Pierre Gondois
>- Added documentation reference
>- Changed enum type and member names to closer align with documentation
>- Changed enum member names to CamelCase
>- Added *Max members to enums
>- Updated the signatures of relevant functions to use the enum types
>  instead of UNIT8
>
>   .../Include/Library/AmlLib/AmlLib.h   | 49 +--
>   .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c| 12 ++---
>   .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   |  8 +--
>   3 files changed, 55 insertions(+), 14 deletions(-)
>
> diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> index 510c79a399..71e8539b30 100644
> --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> @@ -59,6 +59,47 @@ typedef void *AML_DATA_NODE_HANDLE;
>
>   #endif // AML_HANDLE
>
> +/** Memory attributes, _MEM (2 bits)
> +
> +  Possible values are:
> +0-The memory is non-cacheable
> +1-The memory is cacheable (DEPRECATED)
> +2-The memory is cacheable and supports
> +  write combining (DEPRECATED)
> +3-The memory is cacheable and prefetchable
> +
> +  @par Reference(s):
> +  - ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"
> +
> +**/
> +typedef enum {
> +  AmlMemoryNonCacheable  = 0,
> +  AmlMemoryCacheable = 1,
> +  AmlMemoryCacheableWriteCombine = 2,
> +  AmlMemoryCacheablePrefetch = 3,
> +  AmlMemoryCacheablityMax= 4
> +} AML_MEMORY_ATTRIBUTES_MEM;
> +
> +/** Memory attributes, _MTP (2 bits)
> +
> +  Possible values are:
> +0-AddressRangeMemory
> +1-AddressRangeReserved
> +2-AddressRangeACPI
> +3-AddressRangeNVS
> +
> +  @par Reference(s):
> +  - ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"
> +
> +**/
> +typedef enum {
> +  AmlAddressRangeMemory   = 0,
> +  AmlAddressRangeReserved = 1,
> +  AmlAddressRangeACPI = 2,
> +  AmlAddressRangeNVS  = 3,
> +  AmlAddressRangeMax  = 4
> +} AML_MEMORY_ATTRIBUTES_MTP;
> +
>   /** Parse the definition block.
>
> The function parses the whole AML blob. It starts with the ACPI
> DSDT/SSDT @@ -578,7 +619,7 @@ AmlCodeGenRdDWordMemory (
> INBOOLEAN IsPosDecode,
> INBOOLEAN IsMinFixed,
> INBOOLEAN IsMaxFixed,
> -  INUINT8 Cacheable,
> +  INAML_MEMORY_ATTRIBUTES_MEM Cacheable,
> INBOOLEAN IsReadWrite,
> INUINT32 AddressGranularity,
> INUINT32 AddressMinimum,
> @@ -587,7 +628,7 @@ AmlCodeGenRdDWordMemory (
> INUINT32 RangeLength,
> INUINT8 ResourceSourceIndex,
> IN  CONST CHAR8 *ResourceSource,
> -  INUINT8 MemoryRangeType,
> +  INAML_MEMORY_ATTRIBUTES_MTP MemoryRangeType,
> INBOOLEAN IsTypeStatic,
> INAML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
> OUT   AML_DATA_NODE_HANDLE*NewRdNode  OPTIONAL
> @@ -809,7 +850,7 @@ AmlCodeGenRdQWordMemory (
> INBOOLEAN IsPosDecode,
> INBOOLEAN IsMinFixed,
> INBOOLEAN IsMaxFixed,
> -  INUINT8 Cacheable,
> +  INAML_MEMORY_ATTRIBUTES_MEM Cacheable,
> INBOOLEAN IsReadWrite,
> INUINT64 AddressGranularity,
> INUINT64 AddressMinimum,
> @@ -818,7 +859,7 @@ AmlCodeGenRdQWordMemory (
> INUINT64 RangeLength,
> INUINT8 ResourceSourceIndex,
> IN  CONST CHAR8 *ResourceSource,
> -  INUINT8 MemoryRangeType,
> +  INAML_MEMORY_ATTRIBUTES_MTP MemoryRangeType,
> INBOOLEAN IsTypeStatic,
> INAML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
> OUT   AML_DATA_NODE_HANDLE*NewRdNode  OPTIONAL
> diff --git
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerat
> or.c
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerat
> or.c
> index 9ddaddc198..72873709aa 100644
> ---
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerat
> or.c
> +++ 

Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: multiple definitions of strncpy.

2023-10-23 Thread Nickle Wang via groups.io
Hi Mike,

Sorry for the delay. I remove all duplicated definitions in RedfishCrtLib.h. 
Please check new patch file here: https://edk2.groups.io/g/devel/message/109925

Thanks,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Nickle Wang
> via groups.io
> Sent: Thursday, August 3, 2023 2:08 PM
> To: Mike Maslenkin ; devel@edk2.groups.io; Abner
> Chang 
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: multiple 
> definitions
> of strncpy.
> 
> External email: Use caution opening links or attachments
> 
> 
> Thanks for your review, Mike!
> 
> I am ok to remove all duplicated declarations in this file. @Abner Chang, any
> concern?
> 
> Thanks,
> Nickle
> 
> > -Original Message-
> > From: Mike Maslenkin 
> > Sent: Saturday, July 22, 2023 8:28 PM
> > To: devel@edk2.groups.io; Nickle Wang 
> > Cc: Abner Chang ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: multiple
> > definitions of strncpy.
> >
> > External email: Use caution opening links or attachments
> >
> >
> > There is no usage of strncpy with signature (char *, size_t, char *).
> > I would suggest to remove this declaration at all.
> > BTW there are duplicated declaration for memcmp, memset, strncmp.
> >
> > On Sat, Jul 22, 2023 at 11:18 AM Nickle Wang via groups.io
> >  wrote:
> > >
> > > There are two definitions for strncpy() function in RedfishCrtLib.h
> > >
> > > Signed-off-by: Nickle Wang 
> > > Cc: Abner Chang 
> > > Cc: Igor Kulchytskyy 
> > > Cc: Nick Ramirez 
> > > ---
> > >  RedfishPkg/Include/Library/RedfishCrtLib.h | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h
> > > b/RedfishPkg/Include/Library/RedfishCrtLib.h
> > > index 23c6acfca33e..a2c17d1b03fc 100644
> > > --- a/RedfishPkg/Include/Library/RedfishCrtLib.h
> > > +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
> > > @@ -3,6 +3,7 @@
> > >
> > >Copyright (c) 2019, Intel Corporation. All rights reserved.
> > >(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> > > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> > >
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > @@ -304,8 +305,7 @@ char   *
> > >  strncpy(
> > >char *,
> > >size_t,
> > > -  const char *,
> > > -  size_t
> > > +  const char *
> > >);
> > >
> > >  int
> > > --
> > > 2.17.1
> > >
> > >
> > >
> > >
> > >
> > >
> 
> 
> 
> 



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




[edk2-devel] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: add debug message.

2023-10-23 Thread Nickle Wang via groups.io
Add debug prints to show HII option name when assert happens.
This helps developer to debug assert issue easily while Redfish
failed to convert HII value to Redfish value.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishPlatformConfigDxe.c| 123 +-
 1 file changed, 122 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index 30d2ef351eca..cbc65ba59408 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -203,6 +203,106 @@ FindFormLinkToThis (
   return NULL;
 }
 
+/**
+  Debug dump HII statement value.
+
+  @param[in]  ErrorLevelDEBUG macro error level
+  @param[in]  Value HII statement value to dump
+  @param[in]  Message   Debug message
+
+  @retval EFI_SUCCESS   Dump HII statement value successfully
+  @retval OthersErrors occur
+
+**/
+EFI_STATUS
+DumpHiiStatementValue (
+  IN UINTNErrorLevel,
+  IN HII_STATEMENT_VALUE  *Value,
+  IN CHAR8*Message OPTIONAL
+  )
+{
+  UINT64  Data;
+
+  if (Value == NULL) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  switch (Value->Type) {
+case EFI_IFR_TYPE_NUM_SIZE_8:
+  Data = Value->Value.u8;
+  break;
+case EFI_IFR_TYPE_NUM_SIZE_16:
+  Data = Value->Value.u16;
+  break;
+case EFI_IFR_TYPE_NUM_SIZE_32:
+  Data = Value->Value.u32;
+  break;
+case EFI_IFR_TYPE_NUM_SIZE_64:
+  Data = Value->Value.u64;
+  break;
+case EFI_IFR_TYPE_BOOLEAN:
+  Data = (Value->Value.b ? 1 : 0);
+  break;
+default:
+  DEBUG ((ErrorLevel, "%a: unsupported type: 0x%x\n", __func__, 
Value->Type));
+  return EFI_UNSUPPORTED;
+  }
+
+  if (IS_EMPTY_STRING (Message)) {
+DEBUG ((ErrorLevel, "0x%lx\n", Data));
+  } else {
+DEBUG ((ErrorLevel, "%a: 0x%lx\n", Message, Data));
+  }
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Debug dump HII statement prompt string.
+
+  @param[in]  ErrorLevelDEBUG macro error level
+  @param[in]  HiiHandle HII handle instance
+  @param[in]  HiiStatement  HII statement
+  @param[in]  Message   Debug message
+
+  @retval EFI_SUCCESS   Dump HII statement string successfully
+  @retval OthersErrors occur
+
+**/
+EFI_STATUS
+DumpHiiStatementPrompt (
+  IN UINTN   ErrorLevel,
+  IN EFI_HII_HANDLE  HiiHandle,
+  IN HII_STATEMENT   *HiiStatement,
+  IN CHAR8   *Message OPTIONAL
+  )
+{
+  EFI_STRING  String;
+
+  if ((HiiHandle == NULL) || (HiiStatement == NULL)) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  if (HiiStatement->Prompt == 0) {
+return EFI_NOT_FOUND;
+  }
+
+  String = HiiGetString (HiiHandle, HiiStatement->Prompt, NULL);
+  if (String == NULL) {
+return EFI_NOT_FOUND;
+  }
+
+  if (IS_EMPTY_STRING (Message)) {
+DEBUG ((ErrorLevel, "%s\n", String));
+  } else {
+DEBUG ((ErrorLevel, "%a: %s\n", Message, String));
+  }
+
+  FreePool (String);
+
+  return EFI_SUCCESS;
+}
+
 /**
   Build the menu path to given statement instance. It is caller's
   responsibility to free returned string buffer.
@@ -890,6 +990,7 @@ HiiValueToRedfishNumeric (
   break;
 default:
   RedfishValue->Type = RedfishValueTypeUnknown;
+  DEBUG ((DEBUG_ERROR, "%a: Unsupported value type: 0x%x\n", __func__, 
Value->Type));
   break;
   }
 
@@ -1187,6 +1288,11 @@ HiiValueToRedfishValue (
 case EFI_IFR_ONE_OF_OP:
   StringId = HiiValueToOneOfOptionStringId (HiiStatement, Value);
   if (StringId == 0) {
+//
+// Print prompt string of HII statement for ease of debugging
+//
+DumpHiiStatementPrompt (DEBUG_ERROR, HiiHandle, HiiStatement, "Can not 
find string ID");
+DumpHiiStatementValue (DEBUG_ERROR, Value, "Current value");
 ASSERT (FALSE);
 Status = EFI_DEVICE_ERROR;
 break;
@@ -1254,6 +1360,10 @@ HiiValueToRedfishValue (
 case EFI_IFR_ORDERED_LIST_OP:
   StringIdArray = HiiValueToOrderedListOptionStringId (HiiStatement, 
);
   if (StringIdArray == NULL) {
+//
+// Print prompt string of HII statement for ease of debugging
+//
+DumpHiiStatementPrompt (DEBUG_ERROR, HiiHandle, HiiStatement, "Can not 
get string ID array");
 ASSERT (FALSE);
 Status = EFI_DEVICE_ERROR;
 break;
@@ -1261,13 +1371,24 @@ HiiValueToRedfishValue (
 
   RedfishValue->Value.StringArray = AllocatePool (sizeof (CHAR8 *) * 
Count);
   if (RedfishValue->Value.StringArray == NULL) {
+//
+// Print prompt string of HII statement for ease of debugging
+//
+DumpHiiStatementPrompt (DEBUG_ERROR, HiiHandle, HiiStatement, "Can not 
allocate memory");
 ASSERT (FALSE);
 Status = EFI_OUT_OF_RESOURCES;
 break;
   }
 
   

[edk2-devel] [PATCH] RedfishPkg/RedfishDiscoverDxe: remove Redfish false alarm

2023-10-23 Thread Nickle Wang via groups.io
- It is expected that caller receives EFI_NO_MAPPING status
when call issues Configure() to unconfigured network interface.
Remove this false alarm in GetSubnetInfo() function.
- Fix typos

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishDiscoverDxe/RedfishDiscoverDxe.c  | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c 
b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index 2f9e604f6cd6..23da3b968f6c 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -198,13 +198,17 @@ Tcp4GetSubnetInfo (
   Tcp4Option.EnableNagle   = TRUE;
   Status   = Tcp4->Configure (Tcp4, );
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information\n", __func__));
+if (Status == EFI_NO_MAPPING) {
+  return EFI_SUCCESS;
+}
+
+DEBUG ((DEBUG_ERROR, "%a: Can't get subnet information: %r\n", __func__, 
Status));
 return Status;
   }
 
   Status = Tcp4->GetModeData (Tcp4, NULL, NULL, , NULL, NULL);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n", 
__func__));
+DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information: %r\n", 
__func__, Status));
 return Status;
   }
 
@@ -267,7 +271,7 @@ Tcp6GetSubnetInfo (
   ZeroMem ((VOID *), sizeof (EFI_IP6_MODE_DATA));
   Status = Tcp6->GetModeData (Tcp6, NULL, NULL, , NULL, NULL);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information\n", 
__func__));
+DEBUG ((DEBUG_ERROR, "%a: Can't get IP mode data information: %r\n", 
__func__, Status));
 return Status;
   }
 
@@ -1002,13 +1006,13 @@ NetworkInterfaceGetSubnetInfo (
Instance
);
 if (EFI_ERROR (Status)) {
-  DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n", __func__));
+  DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet information.\n", 
__func__));
   return Status;
 } else {
   DEBUG ((DEBUG_MANAGEABILITY, "%a:MAC address: %s\n", __func__, 
Instance->StrMacAddr));
   if (CheckIsIpVersion6 (Instance)) {
 if (Instance->SubnetAddrInfoIPv6Number == 0) {
-  DEBUG ((DEBUG_ERROR, "%a: There is no Subnet infomation for IPv6 
network interface.\n", __func__));
+  DEBUG ((DEBUG_WARN, "%a: There is no Subnet information for IPv6 
network interface.\n", __func__));
   return EFI_NOT_FOUND;
 }
 
@@ -1554,7 +1558,7 @@ TestForRequiredProtocols (
   );
   if (EFI_ERROR (Status)) {
 if (Index == ListCount - 1) {
-  DEBUG ((DEBUG_ERROR, "%a: all required protocols are found on this 
controller handle: %p.\n", __func__, ControllerHandle));
+  DEBUG ((DEBUG_INFO, "%a: all required protocols are found on this 
controller handle: %p.\n", __func__, ControllerHandle));
   return EFI_SUCCESS;
 }
   }
-- 
2.17.1



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




[edk2-devel] [PATCH] RedfishPkg/RedfishCrtLib: remove multiple definitions.

2023-10-23 Thread Nickle Wang via groups.io
There are two definitions for below functions in RedfishCrtLib.h. Create
this change to remote duplicated functions.
Function list: strcmp(), strncmp(), strncpy(), strcat(), strchr(),
strcasecmp(), strstr(), memcmp(), memset(), memcpy() and memchr().

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Cc: Mike Maslenkin 
---
 RedfishPkg/Include/Library/RedfishCrtLib.h | 81 +-
 1 file changed, 1 insertion(+), 80 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h 
b/RedfishPkg/Include/Library/RedfishCrtLib.h
index 23c6acfca33e..80f0e10de8e7 100644
--- a/RedfishPkg/Include/Library/RedfishCrtLib.h
+++ b/RedfishPkg/Include/Library/RedfishCrtLib.h
@@ -3,6 +3,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -172,20 +173,6 @@ free(
   void *
   );
 
-void   *
-memset (
-  void *,
-  int,
-  size_t
-  );
-
-int
-memcmp  (
-  const void *,
-  const void *,
-  size_t
-  );
-
 int
 isdigit (
   int
@@ -216,27 +203,6 @@ isalnum (
   int
   );
 
-void   *
-memcpy (
-  void *,
-  const void *,
-  size_t
-  );
-
-void   *
-memset (
-  void *,
-  int,
-  size_t
-  );
-
-void   *
-memchr (
-  const void *,
-  int,
-  size_t
-  );
-
 int
 memcmp  (
   const void *,
@@ -251,12 +217,6 @@ memmove(
   size_t
   );
 
-int
-strcmp  (
-  const char *,
-  const char *
-  );
-
 int
 strncmp (
   const char *,
@@ -275,24 +235,6 @@ strlen  (
   const char *
   );
 
-char   *
-strcat (
-  char *,
-  const char *
-  );
-
-char   *
-strchr (
-  const char *,
-  int
-  );
-
-int
-strcasecmp  (
-  const char *,
-  const char *
-  );
-
 int
 strncasecmp (
   const char *,
@@ -300,21 +242,6 @@ strncasecmp (
   size_t
   );
 
-char   *
-strncpy(
-  char *,
-  size_t,
-  const char *,
-  size_t
-  );
-
-int
-strncmp (
-  const char *,
-  const char *,
-  size_t
-  );
-
 char   *
 strrchr(
   const char *,
@@ -328,12 +255,6 @@ strtoul (
   int
   );
 
-char *
-strstr  (
-  const char  *s1,
-  const char  *s2
-  );
-
 long
 strtol  (
   const char *,
-- 
2.17.1



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




[edk2-devel] [PATCH edk2-platforms v3 16/16] ManageabilityPkg: Check PLDM completion code

2023-10-23 Thread Konstantin Aladyshev
Every PLDM response contains 1 byte Completion code which is needed
to be checked against SUCCESS value which means that the PLDM command
was accepted and completed normally.
If it is not equal to that value it is necessary to return error status
so the caller would know that Response buffer is invalid.

Signed-off-by: Konstantin Aladyshev 
---
 .../Universal/PldmProtocol/Common/PldmProtocolCommon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
index 04f250e57c..2f2f76603e 100644
--- 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
@@ -293,7 +293,8 @@ CommonPldmSubmitCommand (
   (ResponseHeader->PldmHeader.RequestBit != 
PLDM_MESSAGE_HEADER_IS_RESPONSE) ||
   (ResponseHeader->PldmHeader.InstanceId != mPldmRequestInstanceId) ||
   (ResponseHeader->PldmHeader.PldmType != PldmType) ||
-  (ResponseHeader->PldmHeader.PldmTypeCommandCode != PldmCommand))
+  (ResponseHeader->PldmHeader.PldmTypeCommandCode != PldmCommand) ||
+  (ResponseHeader->PldmCompletionCode != PLDM_COMPLETION_CODE_SUCCESS))
   {
 DEBUG ((DEBUG_ERROR, "PLDM integrity check of response data is 
failed.\n"));
 DEBUG ((DEBUG_ERROR, "Datagram = %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.DatagramBit, (!PLDM_MESSAGE_HEADER_IS_DATAGRAM)));
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 15/16] PldmSmbiosTransferDxe: Implement Set PLDM terminus ID API

2023-10-23 Thread Konstantin Aladyshev
From: Abner Chang 

Currently all PLDM functions inside the PLDM_SMBIOS_TRANSFER_PROTOCOL
use PLDM terminus PCDs for the MCTP addressing.
Add additional function to the protocol API to provide user a way to
use custom TIDs.

Signed-off-by: Abner Chang 
Signed-off-by: Konstantin Aladyshev 
---
 .../Protocol/PldmSmbiosTransferProtocol.h | 26 +
 .../PldmSmbiosTransferDxe.c   | 28 +++
 2 files changed, 54 insertions(+)

diff --git 
a/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h 
b/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h
index 7903e12726..8b23d39682 100644
--- a/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h
+++ b/Features/ManageabilityPkg/Include/Protocol/PldmSmbiosTransferProtocol.h
@@ -23,6 +23,31 @@ typedef struct  _EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL 
EDKII_PLDM_SMBIOS_TRANSFER_
 #define EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION
((EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION_MAJOR << 8) |\

EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_VERSION_MINOR)
 
+/**
+  This function sets PLDM SMBIOS transfer source and destination
+  PLDM terminus ID.
+
+  @param [in]   This   EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instance.
+  @param [in]   SourceId   PLDM source teminus ID.
+   Set to PLDM_TERMINUS_ID_UNASSIGNED means use
+   platform default PLDM terminus ID.
+   
(gManageabilityPkgTokenSpaceGuid.PcdPldmSourceTerminusId)
+  @param [in]   DestinationId  PLDM destination teminus ID.
+   Set to PLDM_TERMINUS_ID_UNASSIGNED means use
+   platform default PLDM terminus ID.
+   
(gManageabilityPkgTokenSpaceGuid.PcdPldmDestinationEndpointId)
+
+  @retval   EFI_SUCCESSGet SMBIOS table metadata Successfully.
+  @retval   EFI_INVALID_PARAMETER  Invalid value of source or destination
+   PLDM terminus ID.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PLDM_GET_SMBIOS_TRANSFER_TERMINUS_ID)(
+  IN  UINT8  SourceId,
+  IN  UINT8  DestinationId
+  );
+
 /**
   This function gets SMBIOS table metadata.
 
@@ -151,6 +176,7 @@ EFI_STATUS
 // EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL
 //
 typedef struct {
+  PLDM_GET_SMBIOS_TRANSFER_TERMINUS_IDSetPldmSmbiosTransferTerminusId;
   PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATAGetSmbiosStructureTableMetaData;
   PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATASetSmbiosStructureTableMetaData;
   PLDM_GET_SMBIOS_STRUCTURE_TABLE GetSmbiosStructureTable;
diff --git 
a/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTransferDxe.c
 
b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTransferDxe.c
index fdf033f0b1..357a7d49e4 100644
--- 
a/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTransferDxe.c
+++ 
b/Features/ManageabilityPkg/Universal/PldmSmbiosTransferDxe/PldmSmbiosTransferDxe.c
@@ -25,6 +25,33 @@
 
 UINT32  SetSmbiosStructureTableHandle;
 
+/**
+  This function sets PLDM SMBIOS transfer source and destination
+  PLDM terminus ID.
+
+  @param [in]   This   EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL instance.
+  @param [in]   SourceId   PLDM source teminus ID.
+   Set to PLDM_TERMINUS_ID_UNASSIGNED means use
+   platform default PLDM terminus ID.
+   
(gManageabilityPkgTokenSpaceGuid.PcdPldmSourceTerminusId)
+  @param [in]   DestinationId  PLDM destination teminus ID.
+   Set to PLDM_TERMINUS_ID_UNASSIGNED means use
+   platform default PLDM terminus ID.
+   
(gManageabilityPkgTokenSpaceGuid.PcdPldmDestinationEndpointId)
+
+  @retval   EFI_SUCCESSGet SMBIOS table metadata Successfully.
+  @retval   EFI_INVALID_PARAMETER  Invalid value of source or destination
+   PLDM terminus ID.
+**/
+EFI_STATUS
+SetPldmSmbiosTransferTerminusId (
+  IN  UINT8  SourceId,
+  IN  UINT8  DestinationId
+  )
+{
+  return PldmSetTerminus(SourceId, DestinationId);
+}
+
 /**
   Get the full size of SMBIOS structure including optional strings that follow 
the formatted structure.
 
@@ -457,6 +484,7 @@ GetSmbiosStructureByHandle (
 }
 
 EDKII_PLDM_SMBIOS_TRANSFER_PROTOCOL_V1_0  mPldmSmbiosTransferProtocolV10 = {
+  SetPldmSmbiosTransferTerminusId,
   GetSmbiosStructureTableMetaData,
   SetSmbiosStructureTableMetaData,
   GetSmbiosStructureTable,
-- 
2.34.1



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

[edk2-devel] [PATCH edk2-platforms v3 12/16] PldmProtocolDxe: Correct TID argument usage

2023-10-23 Thread Konstantin Aladyshev
From: Abner Chang 

Currently the PLDM source/destination TID arguments for the PldmSubmit
function are not actually used in any way in the underlying MCTP
communication. The code just uses MCTP source/destination EID PCDs. So
we have to restructure code to actually use provided PLDM TIDs.
On the other case the PldmSubmitCommand function from the
PldmProtocolLib doesn't even accept the source/destination TID
arguments.
To address both these facts correct TID argument usage in the following
way:
- by default the TID values are taken from the built-time PCDs,
- user have an ability to provide custom TIDs either via PldmSubmit
function arguments or by calling PldmSetTerminus API.

Signed-off-by: Abner Chang 
Signed-off-by: Konstantin Aladyshev 
---
 .../Include/Library/BasePldmProtocolLib.h | 16 ++
 .../Include/Protocol/PldmProtocol.h   | 18 +++---
 .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c | 49 +++-
 .../Dxe/PldmProtocolLib.inf   |  6 +-
 .../PldmProtocol/Common/PldmProtocolCommon.c  | 28 +++---
 .../PldmProtocol/Common/PldmProtocolCommon.h  | 22 +---
 .../Universal/PldmProtocol/Dxe/PldmProtocol.c | 56 ---
 .../PldmProtocol/Dxe/PldmProtocolDxe.inf  |  4 --
 8 files changed, 162 insertions(+), 37 deletions(-)

diff --git a/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h 
b/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
index 5523ac3a4d..a698197263 100644
--- a/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
+++ b/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
@@ -9,6 +9,22 @@
 #ifndef EDKII_PLDM_PROTOCOL_LIB_H_
 #define EDKII_PLDM_PROTOCOL_LIB_H_
 
+/**
+  This function sets the PLDM source termius and destination terminus
+  ID for SMBIOS PLDM transfer.
+
+  @param[in] SourceId   PLDM source teminus ID.
+  @param[in] DestinationId  PLDM destination teminus ID.
+
+  @retval EFI_SUCCESSThe terminus is set successfully.
+  @retval EFI_INVALID_PARAMETER  The terminus is set unsuccessfully.
+**/
+EFI_STATUS
+PldmSetTerminus (
+  IN  UINT8   SourceId,
+  IN  UINT8   DestinationId
+);
+
 /**
   This service enables submitting commands via EDKII PLDM protocol.
 
diff --git a/Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h 
b/Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h
index 651997e1ad..02efb3015a 100644
--- a/Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h
+++ b/Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h
@@ -26,13 +26,15 @@ typedef struct  _EDKII_PLDM_PROTOCOL EDKII_PLDM_PROTOCOL;
 /**
   This service enables submitting commands via EDKII PLDM protocol.
 
-  @param[in] This  EDKII_PLDM_PROTOCOL instance.
-  @param[in] PldmType  PLDM message type.
-  @param[in] Command   PLDM Command of PLDM message type.
-  @param[in] RequestData   Command Request Data.
-  @param[in] RequestDataSize   Size of Command Request Data.
-  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
-  @param[in, out]ResponseDataSize  Size of Command Response Data.
+  @param[in] This   EDKII_PLDM_PROTOCOL instance.
+  @param[in] PldmType   PLDM message type.
+  @param[in] CommandPLDM Command of PLDM message 
type.
+  @param[in] PldmTerminusSourceId   PLDM source teminus ID.
+  @param[in] PldmTerminusDestinationId  PLDM destination teminus ID.
+  @param[in] RequestDataCommand Request Data.
+  @param[in] RequestDataSizeSize of Command Request Data.
+  @param[out]ResponseData   Command Response Data. The 
completion code is the first byte of response data.
+  @param[in, out]ResponseDataSize   Size of Command Response Data.
 
   @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
   @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
@@ -49,6 +51,8 @@ EFI_STATUS
   IN EDKII_PLDM_PROTOCOL  *This,
   IN UINT8PldmType,
   IN UINT8Command,
+  IN UINT8PldmTerminusSourceId,
+  IN UINT8PldmTerminusDestinationId,
   IN UINT8*RequestData,
   IN UINT32   RequestDataSize,
   OUTUINT8*ResponseData,
diff --git 
a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.c 
b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.c
index 267bd8fbc1..37231b0756 100644
--- 
a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.c
+++ 

[edk2-devel] [PATCH edk2-platforms v3 13/16] ManageabilityPkg/PldmProtocol: Remove PLDM command table

2023-10-23 Thread Konstantin Aladyshev
From: Abner Chang 

In case of the PLDM/MCTP communication response size doesn't have to be
known beforehand, the caller just need to provide the buffer big enough
to accomodate the response.
Remove PLDM command table for retrieving the response payload size and
correct the code to fix the response buffer size handling.
Also update the message for error conditions.

Signed-off-by: Abner Chang 
Signed-off-by: Konstantin Aladyshev 
---
 .../PldmProtocol/Common/PldmProtocolCommon.c  | 100 +++---
 .../PldmProtocol/Common/PldmProtocolCommon.h  |   3 +
 .../Universal/PldmProtocol/Dxe/PldmProtocol.c |  13 ++-
 3 files changed, 31 insertions(+), 85 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
index ea3d4a22b2..bc72ce07b3 100644
--- 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
@@ -21,42 +21,6 @@
 extern CHAR16  *mTransportName;
 extern UINT8   mPldmRequestInstanceId;
 
-PLDM_MESSAGE_PACKET_MAPPING  PldmMessagePacketMappingTable[] = {
-  { PLDM_TYPE_SMBIOS, PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA_COMMAND_CODE, 
sizeof (PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA_RESPONSE_FORMAT) },
-  { PLDM_TYPE_SMBIOS, PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA_COMMAND_CODE, 
sizeof (PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA_RESPONSE_FORMAT) },
-  { PLDM_TYPE_SMBIOS, PLDM_SET_SMBIOS_STRUCTURE_TABLE_COMMAND_CODE,  
sizeof (PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST_FORMAT)   }
-};
-
-/**
-  This function returns the expected full size of PLDM response message.
-
-  @param[in] PldmTypePLDM message type.
-  @param[in] PldmCommand PLDM command of this PLDM type.
-
-  @retval  Zero   No matched entry for this PldmType/PldmCommand.
-  @retval  None-zero  Size of full packet is returned.
-**/
-UINT32
-GetFullPacketResponseSize (
-  IN UINT8  PldmType,
-  IN UINT8  PldmCommand
-  )
-{
-  INT16Index;
-  PLDM_MESSAGE_PACKET_MAPPING  *ThisEntry;
-
-  ThisEntry = PldmMessagePacketMappingTable;
-  for (Index = 0; Index < (sizeof (PldmMessagePacketMappingTable)/ sizeof 
(PLDM_MESSAGE_PACKET_MAPPING)); Index++) {
-if ((PldmType == ThisEntry->PldmType) && (PldmCommand == 
ThisEntry->PldmCommand)) {
-  return ThisEntry->ResponseSize;
-}
-
-ThisEntry++;
-  }
-
-  return 0;
-}
-
 /**
   This functions setup the final header/body/trailer packets for
   the acquired transport interface.
@@ -267,10 +231,10 @@ CommonPldmSubmitCommand (
   TransferToken.TransmitPackage.TransmitTimeoutInMillisecond = 
MANAGEABILITY_TRANSPORT_NO_TIMEOUT;
 
   // Set receive packet.
-  FullPacketResponseDataSize = GetFullPacketResponseSize (PldmType, 
PldmCommand);
-  if (FullPacketResponseDataSize == 0) {
-DEBUG ((DEBUG_ERROR, "  No mapping entry in PldmMessagePacketMappingTable 
for PLDM Type:%d Command %d\n", PldmType, PldmCommand));
-ASSERT (FALSE);
+  if (ResponseData == NULL && *ResponseDataSize == 0) {
+FullPacketResponseDataSize = sizeof (PLDM_RESPONSE_HEADER);
+  } else {
+FullPacketResponseDataSize = *ResponseDataSize + sizeof 
(PLDM_RESPONSE_HEADER);
   }
 
   FullPacketResponseData = (UINT8 *)AllocateZeroPool 
(FullPacketResponseDataSize);
@@ -306,6 +270,7 @@ CommonPldmSubmitCommand (
 );
   //
   // Check the response size.
+  //
   if (TransferToken.ReceivePackage.ReceiveSizeInByte < sizeof 
(PLDM_RESPONSE_HEADER)) {
 DEBUG ((
   DEBUG_MANAGEABILITY_INFO,
@@ -315,21 +280,13 @@ CommonPldmSubmitCommand (
   TransferToken.ReceivePackage.ReceiveSizeInByte,
   FullPacketResponseDataSize
   ));
-if (ResponseDataSize != NULL) {
-  if (*ResponseDataSize > TransferToken.ReceivePackage.ReceiveSizeInByte) {
-*ResponseDataSize = TransferToken.ReceivePackage.ReceiveSizeInByte;
-  }
-}
-
-if (ResponseData != NULL) {
-  CopyMem ((VOID *)ResponseData, (VOID *)FullPacketResponseData, 
*ResponseDataSize);
-}
-
+HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, 
TransferToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");
 goto ErrorExit;
   }
 
   //
   // Check the integrity of response. data.
+  //
   ResponseHeader = (PLDM_RESPONSE_HEADER *)FullPacketResponseData;
   if ((ResponseHeader->PldmHeader.DatagramBit != 
(!PLDM_MESSAGE_HEADER_IS_DATAGRAM)) ||
   (ResponseHeader->PldmHeader.RequestBit != 
PLDM_MESSAGE_HEADER_IS_RESPONSE) ||
@@ -343,22 +300,16 @@ CommonPldmSubmitCommand (
 DEBUG ((DEBUG_ERROR, "Instance ID  = %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.InstanceId, mPldmRequestInstanceId));
 DEBUG ((DEBUG_ERROR, "Pldm Type= %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.PldmType, PldmType));
 DEBUG ((DEBUG_ERROR, "  

[edk2-devel] [PATCH edk2-platforms v3 14/16] ManageabilityPkg: Return error on PLDM header check fails

2023-10-23 Thread Konstantin Aladyshev
Currently PldmSubmit command returns EFI_SUCCESS even if the response
header checks have failed.
Correct the code to return errors in such cases.

Signed-off-by: Konstantin Aladyshev 
---
 .../Universal/PldmProtocol/Common/PldmProtocolCommon.c   | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
index bc72ce07b3..04f250e57c 100644
--- 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
@@ -241,7 +241,7 @@ CommonPldmSubmitCommand (
   if (FullPacketResponseData == NULL) {
 DEBUG ((DEBUG_ERROR, "  Not enough memory for 
FullPacketResponseDataSize.\n"));
 Status = EFI_OUT_OF_RESOURCES;
-goto ErrorExit2;
+goto ErrorExit;
   }
 
   // Print out PLDM packet.
@@ -281,6 +281,7 @@ CommonPldmSubmitCommand (
   FullPacketResponseDataSize
   ));
 HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, 
TransferToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");
+Status = EFI_DEVICE_ERROR;
 goto ErrorExit;
   }
 
@@ -303,6 +304,7 @@ CommonPldmSubmitCommand (
 DEBUG ((DEBUG_ERROR, "Pldm Completion Code = 0x%x\n", 
ResponseHeader->PldmCompletionCode));
 
 HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, 
TransferToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");
+Status = EFI_DEVICE_ERROR;
 goto ErrorExit;
   }
 
@@ -319,6 +321,7 @@ CommonPldmSubmitCommand (
   ));
 
 HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, 
TransferToken.ReceivePackage.ReceiveSizeInByte, "Failed response payload\n");
+Status = EFI_DEVICE_ERROR;
 goto ErrorExit;
   }
 
@@ -332,6 +335,7 @@ CommonPldmSubmitCommand (
   ResponseHeader->PldmCompletionCode
   ));
 HelperManageabilityDebugPrint ((VOID *)FullPacketResponseData, 
GET_PLDM_MESSAGE_PAYLOAD_SIZE(TransferToken.ReceivePackage.ReceiveSizeInByte), 
"Failed response payload\n");
+Status = EFI_DEVICE_ERROR;
 goto ErrorExit;
   }
 
@@ -350,13 +354,12 @@ CommonPldmSubmitCommand (
 
   // Return transfer status.
   //
-ErrorExit:
   Status = TransferToken.TransferStatus;
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: Failed to send PLDM command over %s\n", 
__func__, mTransportName));
   }
 
-ErrorExit2:
+ErrorExit:
   if (PldmTransportHeader != NULL) {
 FreePool ((VOID *)PldmTransportHeader);
   }
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 11/16] ManageabilityPkg: Add PLDM terminus PCDs

2023-10-23 Thread Konstantin Aladyshev
From: Abner Chang 

Add PLDM source and destination terminus IDs for transmiting PLDM
message.

Signed-off-by: Abner Chang 
Signed-off-by: Konstantin Aladyshev 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 14fe0fd2e0..eb0ee67cba 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -72,6 +72,12 @@
   # @Prompt MCTP KCS (Memory mapped) I/O base address
   gManageabilityPkgTokenSpaceGuid.PcdMctpKcsBaseAddress|0xca2|UINT32|0x0004
 
+  ## This value is the PLDM source and destination terminus ID for transmiting 
PLDM message.
+  # @Prompt PLDM source terminus ID
+  gManageabilityPkgTokenSpaceGuid.PcdPldmSourceTerminusId|0|UINT8|0x0040
+  # @Prompt PLDM destination terminus ID
+  
gManageabilityPkgTokenSpaceGuid.PcdPldmDestinationEndpointId|0|UINT8|0x0041
+
   ## This is the value of SOL channels supported on platform.
   # @Prompt SOL channel number
   gManageabilityPkgTokenSpaceGuid.PcdMaxSolChannels|3|UINT8|0x0100
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 08/16] ManageabilityPkg: Don't check MCTP header fields if transfer has failed

2023-10-23 Thread Konstantin Aladyshev
If MCTP KCS communication has failed we need to abort MCTP transfer
function before checking any MCTP header data.

Signed-off-by: Konstantin Aladyshev 
---
 .../MctpProtocol/Common/MctpProtocolCommon.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
index 3128aadd15..4aae4fcba9 100644
--- 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
@@ -461,6 +461,13 @@ CommonMctpSubmitMessage (
 
 );
 
+  *AdditionalTransferError = TransferToken.TransportAdditionalStatus;
+  Status = TransferToken.TransferStatus;
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: Failed to send MCTP command over %s: %r\n", 
__func__, mTransportName, Status));
+return Status;
+  }
+
   MctpTransportResponseHeader = (MCTP_TRANSPORT_HEADER *)ResponseBuffer;
   if (MctpTransportResponseHeader->Bits.HeaderVersion != 
MCTP_KCS_HEADER_VERSION) {
 DEBUG ((
@@ -543,18 +550,9 @@ CommonMctpSubmitMessage (
 return EFI_DEVICE_ERROR;
   }
 
-  //
-  // Return transfer status.
-  //
-  *AdditionalTransferError = TransferToken.TransportAdditionalStatus;
   *ResponseDataSize= TransferToken.ReceivePackage.ReceiveSizeInByte - 
sizeof (MCTP_TRANSPORT_HEADER) - sizeof (MCTP_MESSAGE_HEADER);
   CopyMem (ResponseData, ResponseBuffer + sizeof (MCTP_TRANSPORT_HEADER) + 
sizeof (MCTP_MESSAGE_HEADER), *ResponseDataSize);
   FreePool (ResponseBuffer);
-  Status = TransferToken.TransferStatus;
-  if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a: Failed to send MCTP command over %s: %r\n", 
__func__, mTransportName, Status));
-return Status;
-  }
 
   return Status;
 }
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 10/16] ManageabilityPkg: Return error on multiple-packet MCTP responses

2023-10-23 Thread Konstantin Aladyshev
Since the current driver doesn't yet support handling of
multiple-packet MCTP responses, return EFI_UNSUPPORTED error in such
cases.

Signed-off-by: Konstantin Aladyshev 
---
 .../MctpProtocol/Common/MctpProtocolCommon.c  | 11 +++
 1 file changed, 11 insertions(+)

diff --git 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
index 4aae4fcba9..3709ab16eb 100644
--- 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
@@ -524,6 +524,17 @@ CommonMctpSubmitMessage (
 FreePool (ResponseBuffer);
 return EFI_DEVICE_ERROR;
   }
+  if ((MctpTransportResponseHeader->Bits.StartOfMessage != 1) ||
+  (MctpTransportResponseHeader->Bits.EndOfMessage != 1) ||
+  (MctpTransportResponseHeader->Bits.PacketSequence != 0)) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Multiple-packet MCTP responses are not supported by the 
current driver\n",
+  __func__
+  ));
+FreePool (ResponseBuffer);
+return EFI_UNSUPPORTED;
+  }
 
   MctpMessageResponseHeader = (MCTP_MESSAGE_HEADER 
*)(MctpTransportResponseHeader + 1);
   if (MctpMessageResponseHeader->Bits.MessageType != MctpType) {
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 09/16] ManageabilityPkg: Use correct constants for PLDM header checks

2023-10-23 Thread Konstantin Aladyshev
Currently PldmProtocol code uses magic numbers in the PLDM header
checks. Since PLDM headers have all the necessary definitions replace
magic numbers with the appropriate defines.

Signed-off-by: Konstantin Aladyshev 
---
 .../Universal/PldmProtocol/Common/PldmProtocolCommon.c| 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
index 1c4506d87f..4edfe05955 100644
--- 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
@@ -321,15 +321,15 @@ CommonPldmSubmitCommand (
   //
   // Check the integrity of response. data.
   ResponseHeader = (PLDM_RESPONSE_HEADER *)FullPacketResponseData;
-  if ((ResponseHeader->PldmHeader.DatagramBit != 0) ||
-  (ResponseHeader->PldmHeader.RequestBit != 0) ||
+  if ((ResponseHeader->PldmHeader.DatagramBit != 
(!PLDM_MESSAGE_HEADER_IS_DATAGRAM)) ||
+  (ResponseHeader->PldmHeader.RequestBit != 
PLDM_MESSAGE_HEADER_IS_RESPONSE) ||
   (ResponseHeader->PldmHeader.InstanceId != mPldmRequestInstanceId) ||
   (ResponseHeader->PldmHeader.PldmType != PldmType) ||
   (ResponseHeader->PldmHeader.PldmTypeCommandCode != PldmCommand))
   {
 DEBUG ((DEBUG_ERROR, "PLDM integrity check of response data is 
failed.\n"));
-DEBUG ((DEBUG_ERROR, "Request bit  = %d (Expected value: 0)\n"));
-DEBUG ((DEBUG_ERROR, "Datagram = %d (Expected value: 0)\n"));
+DEBUG ((DEBUG_ERROR, "Datagram = %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.DatagramBit, (!PLDM_MESSAGE_HEADER_IS_DATAGRAM)));
+DEBUG ((DEBUG_ERROR, "Request bit  = %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.RequestBit, PLDM_MESSAGE_HEADER_IS_RESPONSE));
 DEBUG ((DEBUG_ERROR, "Instance ID  = %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.InstanceId, mPldmRequestInstanceId));
 DEBUG ((DEBUG_ERROR, "Pldm Type= %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.PldmType, PldmType));
 DEBUG ((DEBUG_ERROR, "Pldm Command = %d (Expected value: %d)\n", 
ResponseHeader->PldmHeader.PldmTypeCommandCode, PldmCommand));
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 05/16] ManageabilityPkg: Correct typo in MCTP destination EID field

2023-10-23 Thread Konstantin Aladyshev
Correct wrong structure member used for MCTP destination EID.

Signed-off-by: Abner Chang 
Signed-off-by: Konstantin Aladyshev 
---
 .../Universal/PldmProtocol/Common/PldmProtocolCommon.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
index ce1e2cba95..1c4506d87f 100644
--- 
a/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/PldmProtocol/Common/PldmProtocolCommon.c
@@ -119,7 +119,7 @@ SetupPldmRequestTransportPacket (
 }
 
 MctpHeader->SourceEndpointId = PcdGet8 
(PcdMctpSourceEndpointId);
-MctpHeader->SourceEndpointId = PcdGet8 
(PcdMctpDestinationEndpointId);
+MctpHeader->DestinationEndpointId= PcdGet8 
(PcdMctpDestinationEndpointId);
 MctpHeader->MessageHeader.IntegrityCheck = FALSE;
 MctpHeader->MessageHeader.MessageType= MCTP_MESSAGE_TYPE_PLDM;
 *PacketHeader= (MANAGEABILITY_TRANSPORT_HEADER 
*)MctpHeader;
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 06/16] ManageabilityPkg: Update the algorithm of using MCTP endpoint ID PCD

2023-10-23 Thread Konstantin Aladyshev
Although MtcpSubmit function receives source and destination MCTP EID
arguments these value are not used in any way currently. Instead the
code always uses EID values from the PCDs.
To correct this issue modify function interface to receive source and
destination MCTP EIDs via pointers and use PCD values only if the
pointers are NULL.

Signed-off-by: Konstantin Aladyshev 
Signed-off-by: Abner Chang 
---
 .../Include/Protocol/MctpProtocol.h   | 12 --
 .../Dxe/ManageabilityTransportMctp.c  |  4 +-
 .../MctpProtocol/Common/MctpProtocolCommon.c  |  4 +-
 .../Universal/MctpProtocol/Dxe/MctpProtocol.c | 42 ++-
 4 files changed, 44 insertions(+), 18 deletions(-)

diff --git a/Features/ManageabilityPkg/Include/Protocol/MctpProtocol.h 
b/Features/ManageabilityPkg/Include/Protocol/MctpProtocol.h
index 85e42f157d..c96b986c44 100644
--- a/Features/ManageabilityPkg/Include/Protocol/MctpProtocol.h
+++ b/Features/ManageabilityPkg/Include/Protocol/MctpProtocol.h
@@ -28,8 +28,12 @@ typedef struct  _EDKII_MCTP_PROTOCOL EDKII_MCTP_PROTOCOL;
 
   @param[in] This   EDKII_MCTP_PROTOCOL instance.
   @param[in] MctpType   MCTP message type.
-  @param[in] MctpSourceEndpointId   MCTP source endpoint ID.
-  @param[in] MctpDestinationEndpointId  MCTP source endpoint ID.
+  @param[in] MctpSourceEndpointId   Pointer of MCTP source 
endpoint ID.
+Set to NULL means use platform 
PCD value
+(PcdMctpSourceEndpointId).
+  @param[in] MctpDestinationEndpointId  Pointer of MCTP destination 
endpoint ID.
+Set to NULL means use platform 
PCD value
+(PcdMctpDestinationEndpointId).
   @param[in] RequestDataIntegrityCheck  Indicates whether MCTP message 
has
 integrity check byte.
   @param[in] RequestDataMessage Data.
@@ -58,8 +62,8 @@ EFI_STATUS
 (EFIAPI *MCTP_SUBMIT_COMMAND)(
   IN EDKII_MCTP_PROTOCOL  *This,
   IN UINT8MctpType,
-  IN UINT8MctpSourceEndpointId,
-  IN UINT8MctpDestinationEndpointId,
+  IN UINT8*MctpSourceEndpointId,
+  IN UINT8*MctpDestinationEndpointId,
   IN BOOLEAN  RequestDataIntegrityCheck,
   IN UINT8*RequestData,
   IN UINT32   RequestDataSize,
diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/ManageabilityTransportMctp.c
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/ManageabilityTransportMctp.c
index c520e2302d..249104c873 100644
--- 
a/Features/ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/ManageabilityTransportMctp.c
+++ 
b/Features/ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/ManageabilityTransportMctp.c
@@ -205,8 +205,8 @@ MctpTransportTransmitReceive (
   Status = mMctpProtocol->Functions.Version1_0->MctpSubmitCommand (
   mMctpProtocol,
   
TransmitHeader->MessageHeader.MessageType,
-  
TransmitHeader->SourceEndpointId,
-  
TransmitHeader->DestinationEndpointId,
+  
>SourceEndpointId,
+  
>DestinationEndpointId,
   
(BOOLEAN)TransmitHeader->MessageHeader.IntegrityCheck,
   
TransferToken->TransmitPackage.TransmitPayload,
   
TransferToken->TransmitPackage.TransmitSizeInByte,
diff --git 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
index 5844d54eb2..3128aadd15 100644
--- 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
@@ -175,8 +175,8 @@ SetupMctpRequestTransportPacket (
 MctpTransportHeader = (MCTP_TRANSPORT_HEADER 
*)ThisPackage;
 MctpTransportHeader->Bits.Reserved  = 0;
 MctpTransportHeader->Bits.HeaderVersion = MCTP_KCS_HEADER_VERSION;
-MctpTransportHeader->Bits.DestinationEndpointId = PcdGet8 
(PcdMctpDestinationEndpointId);
-MctpTransportHeader->Bits.SourceEndpointIdId= PcdGet8 
(PcdMctpSourceEndpointId);
+MctpTransportHeader->Bits.DestinationEndpointId = 
MctpDestinationEndpointId;
+MctpTransportHeader->Bits.SourceEndpointId  = 

[edk2-devel] [PATCH edk2-platforms v3 07/16] ManageabilityPkg: Correct value for the MCTP TAG_OWNER response bit

2023-10-23 Thread Konstantin Aladyshev
Currently the MCTP TAG_OWNER bit is checked against 1 both in MTCP
request and response.
According to the MTCP Base specification in case of the MCTP response
the TAG_OWNER bit should be equal to 0.
Correct MCTP_MESSAGE_TAG_OWNER_RESPONSE flag value to fix the issue.

Signed-off-by: Konstantin Aladyshev 
---
 .../Include/Library/ManageabilityTransportMctpLib.h   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h
index 462e7436e6..a8dc8a8519 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportMctpLib.h
@@ -51,8 +51,8 @@ typedef struct {
 // is not defined by the specification.
 #define MCTP_MESSAGE_TAG  0x1
 
-#define MCTP_MESSAGE_TAG_OWNER_REQUEST   0x01
-#define MCTP_MESSAGE_TAG_OWNER_RESPONSE  0x01
+#define MCTP_MESSAGE_TAG_OWNER_REQUEST   1
+#define MCTP_MESSAGE_TAG_OWNER_RESPONSE  0
 
 #define MCTP_PACKET_SEQUENCE_MASK  0x3
 
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 04/16] ManageabilityPkg: Check header fields in the MCTP response

2023-10-23 Thread Konstantin Aladyshev
Add checks for the MCTP header fields in the MCTP response.

Signed-off-by: Konstantin Aladyshev 
---
 .../MctpProtocol/Common/MctpProtocolCommon.c  | 82 +++
 1 file changed, 82 insertions(+)

diff --git 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
index e560c638d5..5844d54eb2 100644
--- 
a/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
+++ 
b/Features/ManageabilityPkg/Universal/MctpProtocol/Common/MctpProtocolCommon.c
@@ -461,6 +461,88 @@ CommonMctpSubmitMessage (
 
 );
 
+  MctpTransportResponseHeader = (MCTP_TRANSPORT_HEADER *)ResponseBuffer;
+  if (MctpTransportResponseHeader->Bits.HeaderVersion != 
MCTP_KCS_HEADER_VERSION) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response HeaderVersion (0x%02x) doesn't match 
MCTP_KCS_HEADER_VERSION (0x%02x)\n",
+  __func__,
+  MctpTransportResponseHeader->Bits.HeaderVersion,
+  MCTP_KCS_HEADER_VERSION
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+  if (MctpTransportResponseHeader->Bits.MessageTag != MCTP_MESSAGE_TAG) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response MessageTag (0x%02x) doesn't match MCTP_MESSAGE_TAG 
(0x%02x)\n",
+  __func__,
+  MctpTransportResponseHeader->Bits.MessageTag,
+  MCTP_MESSAGE_TAG
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+  if (MctpTransportResponseHeader->Bits.TagOwner != 
MCTP_MESSAGE_TAG_OWNER_RESPONSE) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response TagOwner (0x%02x) doesn't match 
MCTP_MESSAGE_TAG_OWNER_RESPONSE (0x%02x)\n",
+  __func__,
+  MctpTransportResponseHeader->Bits.TagOwner,
+  MCTP_MESSAGE_TAG_OWNER_RESPONSE
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+  if (MctpTransportResponseHeader->Bits.SourceEndpointId != 
MctpDestinationEndpointId) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response SrcEID (0x%02x) doesn't match sent EID (0x%02x)\n",
+  __func__,
+  MctpTransportResponseHeader->Bits.SourceEndpointId,
+  MctpDestinationEndpointId
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+  if (MctpTransportResponseHeader->Bits.DestinationEndpointId != 
MctpSourceEndpointId) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response DestEID (0x%02x) doesn't match local EID 
(0x%02x)\n",
+  __func__,
+  MctpTransportResponseHeader->Bits.DestinationEndpointId,
+  MctpSourceEndpointId
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+
+  MctpMessageResponseHeader = (MCTP_MESSAGE_HEADER 
*)(MctpTransportResponseHeader + 1);
+  if (MctpMessageResponseHeader->Bits.MessageType != MctpType) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response MessageType (0x%02x) doesn't match sent MessageType 
(0x%02x)\n",
+  __func__,
+  MctpMessageResponseHeader->Bits.MessageType,
+  MctpType
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+
+  if (MctpMessageResponseHeader->Bits.IntegrityCheck != 
(UINT8)RequestDataIntegrityCheck) {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Error! Response IntegrityCheck (%d) doesn't match sent 
IntegrityCheck (%d)\n",
+  __func__,
+  MctpMessageResponseHeader->Bits.IntegrityCheck,
+  (UINT8)RequestDataIntegrityCheck
+  ));
+FreePool (ResponseBuffer);
+return EFI_DEVICE_ERROR;
+  }
+
   //
   // Return transfer status.
   //
-- 
2.34.1



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




[edk2-devel] [PATCH edk2-platforms v3 03/16] ManageabilityPkg: Support both MCTP and IPMI in KCS tranport library

2023-10-23 Thread Konstantin Aladyshev
The Manageability KCS transport library needs to support requests both
from MCTP and IPMI transports. Currently the code only handles IPMI
case correctly.
In the MCTP case the communication should be based on the MCTP-over-KCS
specification (DSP0254). This specification defines a special KCS
binding header and trailer structures that need to be present in every
MCTP message.
The header structure contains a length field, therefore response packet
size is not needed to be known beforehand.
The trailer structure contains a PEC checksum that can be used to check
itegrity of the response message.
Modify Manageability KCS transport library code to check which message
is processed (IPMI or MCTP) and handle each case correctly based on its
own specification.

Tested:
- The IPMI KCS communication is tested by Abner Chang,
- The MCTP KCS communication is tested by Konstantin Aladyshev on the
AMD EthanolX CRB.

Signed-off-by: Konstantin Aladyshev 
Signed-off-by: Abner Chang 
---
 .../Common/KcsCommon.c| 284 +++---
 .../MctpProtocol/Common/MctpProtocolCommon.c  |  14 +-
 2 files changed, 260 insertions(+), 38 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
index d5b54c04be..4f7e7d450f 100644
--- 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
+++ 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
@@ -8,16 +8,19 @@
 **/
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include "ManageabilityTransportKcs.h"
 
 extern MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO  mKcsHardwareInfo;
+extern MANAGEABILITY_TRANSPORT_KCS*mSingleSessionToken;
 
 /**
   This function waits for parameter Flag to set.
@@ -379,6 +382,218 @@ KcsTransportRead (
   return EFI_SUCCESS;
 }
 
+/**
+  This funciton checks the KCS response data according to
+  manageability protocol.
+
+  @param[in]  ResponseDataPointer to response data.
+  @param[in]  ResponseDataSizeSize of response data.
+  @param[out] AdditionalStatusPointer to receive the additional status.
+
+  @retval EFI_SUCCESS KCS response header is checked without 
error
+  @retval EFI_DEVICE_ERRORKCS response header has problem.
+**/
+EFI_STATUS
+KcsCheckResponseData (
+  IN UINT8   *ResponseData,
+  IN UINT32  ResponseDataSize,
+  OUT MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS  *AdditionalStatus
+  )
+{
+  EFI_STATUS  Status;
+  MANAGEABILITY_MCTP_KCS_TRAILER  MctpKcsPec;
+  UINT32  PecSize;
+  UINT8   CalculatedPec;
+  CHAR16  *CompletionCodeStr;
+
+  Status= EFI_SUCCESS;
+  *AdditionalStatus = MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NO_ERRORS;
+  if (CompareGuid (, 
mSingleSessionToken->Token.ManageabilityProtocolSpecification)) {
+//
+// For MCTP over KCS, check PEC
+//
+PecSize = sizeof (MANAGEABILITY_MCTP_KCS_TRAILER) + 1;  // +1 to read last 
dummy byte that finishes KCS transfer
+Status  = KcsTransportRead (, );
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: Error! Failed to read PEC with Status(%r)\n",
+__func__,
+Status
+));
+  *AdditionalStatus = MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_ERROR;
+  return Status;
+}
+
+if (PecSize != sizeof (MctpKcsPec)) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: Error! Received PEC size is %d instead of %d\n",
+__func__,
+PecSize,
+sizeof (MctpKcsPec)
+));
+  *AdditionalStatus = MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_ERROR;
+  return EFI_DEVICE_ERROR;
+}
+
+HelperManageabilityDebugPrint ((VOID *), PecSize - 1, "MCTP 
over KCS Response PEC:\n");
+CalculatedPec = HelperManageabilityGenerateCrc8 
(MCTP_KCS_PACKET_ERROR_CODE_POLY, 0, ResponseData, ResponseDataSize);
+if (CalculatedPec != MctpKcsPec.Pec) {
+  DEBUG ((
+DEBUG_ERROR,
+"%a: Error! Received PEC is 0x%02x instead of 0x%02x\n",
+__func__,
+MctpKcsPec.Pec,
+CalculatedPec
+));
+  Status = EFI_DEVICE_ERROR;
+}
+  } else if (CompareGuid (, 
mSingleSessionToken->Token.ManageabilityProtocolSpecification)) {
+//
+// For IPMI over KCS
+// Check and print Completion Code
+//
+Status = IpmiHelperCheckCompletionCode (*ResponseData, , 
AdditionalStatus);
+if (!EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_MANAGEABILITY_INFO, "Cc: %02x %s.\n", *((UINT8 
*)ResponseData), CompletionCodeStr));
+} else if (Status == EFI_NOT_FOUND) {
+  DEBUG ((DEBUG_ERROR, "Cc: %02x not defined in 

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

2023-10-23 Thread Konstantin Aladyshev
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 (#109910): https://edk2.groups.io/g/devel/message/109910
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]
-=-=-=-=-=-=-=-=-=-=-=-




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

2023-10-23 Thread Konstantin Aladyshev
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 (#109909): https://edk2.groups.io/g/devel/message/109909
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]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support

2023-10-23 Thread Konstantin Aladyshev
The Manageability KCS transport library needs to support requests both
from MCTP and IPMI transports. Currently the code only handles IPMI
case correctly.
In the MCTP case the communication should be based on the MCTP-over-KCS
specification (DSP0254). This specification defines a special KCS
binding header and trailer structures that need to be present in every
MCTP message.
The header structure contains a length field, therefore response packet
size is not needed to be known beforehand.
The trailer structure contains a PEC checksum that can be used to check
itegrity of the response message.
Modify Manageability KCS transport library code to check which message
is processed (IPMI or MCTP) and handle each case correctly based on its
own specification.
This patch is a result of a joint effort from the Konstantin Aladyshev
 and Abner Chang .

Tested:
PLDM communication between the HOST and BMC was tested with both
components implemented via open-source software:
- The HOST (UEFI firmware) part was based one the edk2 [1] and
edk2-platforms [2] code,
- The BMC part was based on the openbmc [3] distribution.

The testing process and all the necessary utilities are described in
the [4] repository.

The provided changes keep IPMI over KCS stack working as reported by
Abner Chang.

[1]: https://github.com/tianocore/edk2
[2]: https://github.com/tianocore/edk2-platforms
[3]: https://github.com/openbmc/openbmc
[4]: https://github.com/Kostr/PLDM

Changes v2 -> v3:
 - Add new patch that adds PLDM completion code check

Changes v1 -> v2:
 - Add new patches with corrections for the PLDM protocol. The
  resulting communication via EDKII_PLDM_PROTOCOL was successfully
  tested.

Abner Chang (4):
  ManageabilityPkg: Add PLDM terminus PCDs
  PldmProtocolDxe: Correct TID argument usage
  ManageabilityPkg/PldmProtocol: Remove PLDM command table
  PldmSmbiosTransferDxe: Implement Set PLDM terminus ID API

Konstantin Aladyshev (12):
  ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure
  ManageabilityPkg: Check MCTP EIDs for reserved values
  ManageabilityPkg: Support both MCTP and IPMI in KCS tranport library
  ManageabilityPkg: Check header fields in the MCTP response
  ManageabilityPkg: Correct typo in MCTP destination EID field
  ManageabilityPkg: Update the algorithm of using MCTP endpoint ID PCD
  ManageabilityPkg: Correct value for the MCTP TAG_OWNER response bit
  ManageabilityPkg: Don't check MCTP header fields if transfer has
failed
  ManageabilityPkg: Use correct constants for PLDM header checks
  ManageabilityPkg: Return error on multiple-packet MCTP responses
  ManageabilityPkg: Return error on PLDM header check fails
  ManageabilityPkg: Check PLDM completion code

 .../Include/Library/BasePldmProtocolLib.h |  16 +
 .../Library/ManageabilityTransportMctpLib.h   |   9 +-
 .../Include/Protocol/MctpProtocol.h   |  12 +-
 .../Include/Protocol/PldmProtocol.h   |  18 +-
 .../Protocol/PldmSmbiosTransferProtocol.h |  26 ++
 .../Common/KcsCommon.c| 284 +++---
 .../Dxe/ManageabilityTransportMctp.c  |   4 +-
 .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c |  49 ++-
 .../Dxe/PldmProtocolLib.inf   |   6 +-
 .../ManageabilityPkg/ManageabilityPkg.dec |   6 +
 .../MctpProtocol/Common/MctpProtocolCommon.c  | 129 +++-
 .../Universal/MctpProtocol/Dxe/MctpProtocol.c |  51 +++-
 .../PldmProtocol/Common/PldmProtocolCommon.c  | 148 +++--
 .../PldmProtocol/Common/PldmProtocolCommon.h  |  25 +-
 .../Universal/PldmProtocol/Dxe/PldmProtocol.c |  69 -
 .../PldmProtocol/Dxe/PldmProtocolDxe.inf  |   4 -
 .../PldmSmbiosTransferDxe.c   |  28 ++
 17 files changed, 690 insertions(+), 194 deletions(-)

-- 
2.34.1



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




Re: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Enhance StdLib for supporting Aarch64 and ARM

2023-10-23 Thread Leif Lindholm
On the whole, I find edk2-libc creates more problems than it solves. So 
I will not be reviewing patches for it.


/
Leif

On 2023-10-20 20:54, Michael D Kinney wrote:

+Ard
+Leif



-Original Message-
From: Jayaprakash, N 
Sent: Friday, October 20, 2023 7:04 AM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran
; Kinney, Michael D ;
Tyler Erickson 
Subject: [edk2-libc Patch 1/1] ek2-libc: Enhance StdLib for supporting
Aarch64 and ARM

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

This commit is for processing the below PR on edk2-libc repo
https://github.com/tianocore/edk2-libc/pull/3
These are the changes introduced to StdLib to build
an application for the UEFI shell.
Added format macros for int types to Aarch64, ARM, and Ia32.
Also modified the X64 macros so that everything would build
when they are used.
Added some macros that can be used for compatibility that define when
socklen_t has been defined.
Added getopt_long parser from OpenBSD to provide long and
short option parsing capability with getopt.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Tyler Erickson 
---
  StdLib/Include/Aarch64/machine/int_fmtio.h | 211 +
  StdLib/Include/Arm/machine/int_fmtio.h | 211 +
  StdLib/Include/Ia32/machine/int_fmtio.h| 212 +
  StdLib/Include/X64/machine/int_fmtio.h | 324 ++---
  StdLib/Include/getopt.h|  76 +++
  StdLib/Include/inttypes.h  |   2 +-
  StdLib/Include/sys/socket.h|   6 +
  StdLib/Include/unistd.h|   7 +-
  StdLib/LibC/LibC.inf   |   1 +
  StdLib/LibC/Uefi/Uefi.inf  |   1 +
  StdLib/LibC/Uefi/compat.c  |  40 +-
  StdLib/LibC/Uefi/getopt_long.c | 523
+
  12 files changed, 1406 insertions(+), 208 deletions(-)
  create mode 100644 StdLib/Include/Aarch64/machine/int_fmtio.h
  create mode 100644 StdLib/Include/Arm/machine/int_fmtio.h
  create mode 100644 StdLib/Include/Ia32/machine/int_fmtio.h
  create mode 100644 StdLib/Include/getopt.h
  create mode 100644 StdLib/LibC/Uefi/getopt_long.c

diff --git a/StdLib/Include/Aarch64/machine/int_fmtio.h
b/StdLib/Include/Aarch64/machine/int_fmtio.h
new file mode 100644
index 000..f091a7d
--- /dev/null
+++ b/StdLib/Include/Aarch64/machine/int_fmtio.h
@@ -0,0 +1,211 @@
+/*  $NetBSD: int_fmtio.h,v 1.10 2018/07/15 00:36:13 christos Exp $
*/
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD
Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
copyright
+ *notice, this list of conditions and the following disclaimer in
the
+ *documentation and/or other materials provided with the
distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ARM_INT_FMTIO_H_
+#define _ARM_INT_FMTIO_H_
+
+/*
+ * 7.8.1 Macros for format specifiers
+ */
+
+/* fprintf macros for signed integers */
+#define PRId8   "d" /* int8_t   */
+#define PRId16  "d" /* int16_t  */
+#define PRId32  "d" /* int32_t  */
+#define PRId64  "lld"   /* int64_t  */
+#define PRIdLEAST8  "d" /* int_least8_t */
+#define PRIdLEAST16 "d" /* int_least16_t*/
+#define PRIdLEAST32 "d" /* int_least32_t*/
+#define PRIdLEAST64 "lld"   /* int_least64_t*/
+#define PRIdFAST8   "d" /* int_fast8_t  */
+#define PRIdFAST16  "d" /* int_fast16_t */
+#define PRIdFAST32  "d" /* int_fast32_t */
+#define PRIdFAST64  "lld"   /* int_fast64_t */
+#define PRIdMAX "lld"   /* intmax_t */
+#define PRIdPTR "ld"/* intptr_t */
+
+#define PRIi8   "i" /* int8_t   */
+#define PRIi16  "i" /* int16_t  */
+#define PRIi32  "i" /* int32_t  */
+#define PRIi64  "lli"   /* int64_t  

Re: [edk2-devel] [PATCH] OvmfPkg/VirtioFsDxe: tolerate opening an abs. pathname rel. to a reg. file

2023-10-23 Thread Gerd Hoffmann
  Hi,
 
> To the RH folks, what's the easiest way of testing shim booting *with this 
> bug*?

I've just passed the host ESP to the guest using virtiofs, libvirt xml
for that looks like this:


  
  
  
  
  


Then boot with an empty varstore and watch shim fail to read
EFI/$distro/BOOTX64.CSV

For the ext4 filesystem driver you probably need an ESP in ext4
filesystem format to test this.

take care,
  Gerd



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




[edk2-devel] [PATCH V2 1/1] OvmfPkg/AcpiPlatformDxe: Fix Coverity report issues

2023-10-23 Thread sunceping
From: Ceping Sun 

v1 -> v2 Changed list:
 1:Since both commits are intended to fix coverity issues, they are merged into 
one
 2: Changed the debug info level to debug error when "DsdtTable == NULL"
 3:Add the Cc member as below
  Erdem Aktas erdemak...@google.com
  James Bottomley j...@linux.ibm.com
  Tom Lendacky thomas.lenda...@amd.com
  Michael Roth michael.r...@amd.com

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

The function InstallCloudHvTablesTdx had an Assert when "DsdtTable == NULL",
but this comes into play only in DEBUG mode. In Release mode , there is
no handling if the pointer is NULL. To avoid the possible null pointer
dereference, it is better to handle it when the pointer is null.

In addition, the status of "AcpiProtocol->InstallAcpiTable" is overwritten 
before
it can be used in the function, it is better to check it before overwriting.

code: https://github.com/sunceping/edk2/tree/fixcoverityerrors.v2

Cc: Erdem Aktas 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Min Xu 
Cc: Tom Lendacky 
Cc: Michael Roth 
Cc: Gerd Hoffmann 
Signed-off-by: Ceping Sun 
---
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c 
b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
index d3e73c155e8f..4629fa260366 100644
--- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
@@ -53,6 +53,11 @@ InstallCloudHvTablesTdx (
CurrentTable->Length,

);
+  if (EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+return Status;
+  }
+
   for (UINTN i = 0; i < CurrentTable->Length; i++) {
 DEBUG ((DEBUG_INFO, " %x", *((UINT8 *)CurrentTable + i)));
   }
@@ -69,8 +74,9 @@ InstallCloudHvTablesTdx (
   // then we're out of sync with the hypervisor, and cannot continue.
   //
   if (DsdtTable == NULL) {
-DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __func__));
+DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __func__));
 ASSERT (FALSE);
+CpuDeadLoop ();
   }
 
   Status = AcpiProtocol->InstallAcpiTable (
-- 
2.34.1



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




Re: [edk2-devel] [PATCH] Basetools: Include PCD declarations from Library Instance

2023-10-23 Thread Sami Mujawar
Dear Basetool Maintainers,

Is it possible to provide feedback for this patch, please? 
This patch fixes an issue that is blocking the patch series at 
https://edk2.groups.io/g/devel/message/109178 from being merged.

Regards,

Sami Mujawar

On 13/10/2023, 08:36, "Sami Mujawar" mailto:sami.muja...@arm.com>> wrote:


Adding Tuan.


Regards,


Sami Mujawar


On 12/10/2023, 18:12, "levi.yun" mailto:yeoreum@arm.com> >> wrote:




The patch "[PATCH v3 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver
architecture independent" (https://edk2.groups.io/g/devel/message/109178 
 
 
)
removed ArmPkg/ArmPkg.dec from the Packages section in the
INF file: StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf




This change was done as part of making the StandaloneMmCpu driver
architecture independent.




Although this change is correct, it results in a side effect
here some platforms that utilise PCDs declared in ArmPkg.dec are
no longer declared.




An example of this issue can be seen when building
edk2-platforms/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc




$ build -a AARCH64 -t GCC -p Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
build.py...
/mnt/source/edk2-platforms/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf(23):
error F001: PCD (gArmTokenSpaceGuid.PcdFdBaseAddress) used in
FDF is not declared in DEC files.




As seen above, removing ArmPkg.dec from the Packages section in the
StandAloneMmCpu Driver Inf file triggers build failure.
Although, ArmPkg.dec is included in other Library Instances,
the build system does not include the declarations from
.dec files defined in Library instances.




The build system only includes the PCD declarations from DEC files
that are specified in INF files for Modules (components).




Therefore, extend the build system to include the Packages from
Library Instances so that the PCD declarations from the respective package
DEC files are included.




This patch can be seen on
https://github.com/LeviYeoReum/edk2/tree/levi/2848_dec_check_on_library 
 
 





Signed-off-by: levi.yun mailto:yeoreum@arm.com> 
>>
---
BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)




diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py 
b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
index 
f86c749c08c3bb2837a88b5872101bc69e8bf7a0..f52ef42045da52c3d4f20277c61542f659eb7874
 100644
--- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
@@ -439,6 +439,10 @@ class WorkspaceAutoGen(AutoGen):
PkgSet = set()
for mb in [self.BuildDatabase[m, Arch, self.BuildTarget, self.ToolChain] for m 
in Platform.Modules]:
PkgSet.update(mb.Packages)
+
+ for lb in [self.BuildDatabase[l, Arch, self.BuildTarget, self.ToolChain] for 
l in Platform.LibraryInstances]:
+ PkgSet.update(lb.Packages)
+
for Inf in ModuleList:
ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)
if ModuleFile in Platform.Modules:
@@ -968,4 +972,3 @@ class WorkspaceAutoGen(AutoGen):
#
def CreateAsBuiltInf(self):
return
-
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")











-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109903): https://edk2.groups.io/g/devel/message/109903
Mute This Topic: https://groups.io/mt/101922917/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/1] StarFive/VisionFive2: Add VisionFive 2 platform

2023-10-23 Thread John Chew
Hi everyone,

Sorry please ignore this patch. I will commit another patch to replace this.

gJH7110TokenSpaceGuid.PcdPci0Mmio32Size|0x8000

gJH7110TokenSpaceGuid.PcdPci1Mmio32Size|0x8000

Supposed to be:

gJH7110TokenSpaceGuid.PcdPci0Mmio32Size|0x800

gJH7110TokenSpaceGuid.PcdPci1Mmio32Size|0x800


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




[edk2-devel] [PATCH v2 1/4] StarFive/JH7110Pkg: Add Pci controller driver

2023-10-23 Thread John Chew
From: mindachen1987 

v2:
  - Change Bus, IO, Mem and MemAbove4G "#define" into
PCDs [John Chew]

v1:

  - Implement Pci Host Bridge and Pci Segment driver:
  - JH7110 SoC contains two PCI segment:

  - PCI Segment 0 (USB):
32-bit Memory: 0x3000_ ~ 0x3FFF_
64-bit Memory: 0x9__ ~0x9_4000_
  - PCI Segment 1 (NVME):
32-bit Memory: 0x3800_ ~ 0x37FF_
64-bit Memory: 0x9_8000_ ~0x9_C000_

  - Non-prefetachable memory is not used in this configuration.

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Co-authored-by: John Chew 
Signed-off-by: mindachen1987 
---
 Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c 
   |  263 
 Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf   
   |   61 +
 
Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLibConstructor.c
 |  406 ++
 Silicon/StarFive/JH7110Pkg/Library/PciSegmentLib/PciSegmentLib.c   
   | 1460 
 Silicon/StarFive/JH7110Pkg/Library/PciSegmentLib/PciSegmentLib.inf 
   |   33 +
 5 files changed, 2223 insertions(+)

diff --git 
a/Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c 
b/Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
new file mode 100644
index ..8b46f6ff58e5
--- /dev/null
+++ b/Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -0,0 +1,263 @@
+/** @file

+ *

+ * PCI Host Bridge Library instance for StarFive JH7110 SOC

+ *

+ * Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.

+ *

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

+ *

+ **/

+

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+

+#pragma pack(1)

+

+typedef PACKED struct {

+  ACPI_HID_DEVICE_PATHAcpiDevicePath;

+  EFI_DEVICE_PATH_PROTOCOLEndDevicePath;

+} EFI_PCI_ROOT_BRIDGE_DEVICE_PATH;

+

+#pragma pack ()

+

+STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH  mEfiPciRootBridgeDevicePath[] = {

+  {

+{

+  {

+ACPI_DEVICE_PATH,

+ACPI_DP,

+{

+  (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),

+  (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8)

+}

+  },

+  EISA_PNP_ID (0x0A08), // PCI Express

+  0

+},

+

+{

+  END_DEVICE_PATH_TYPE,

+  END_ENTIRE_DEVICE_PATH_SUBTYPE,

+  {

+END_DEVICE_PATH_LENGTH,

+0

+  }

+}

+  },

+

+  {

+{

+  {

+ACPI_DEVICE_PATH,

+ACPI_DP,

+{

+  (UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),

+  (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8)

+}

+  },

+  EISA_PNP_ID (0x0A08), // PCI Express

+  1

+},

+

+{

+  END_DEVICE_PATH_TYPE,

+  END_ENTIRE_DEVICE_PATH_SUBTYPE,

+  {

+END_DEVICE_PATH_LENGTH,

+0

+  }

+}

+  },

+};

+

+GLOBAL_REMOVE_IF_UNREFERENCED

+CHAR16  *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {

+  L"Mem", L"I/O", L"Bus"

+};

+

+//

+// See description in MdeModulePkg/Include/Library/PciHostBridgeLib.h

+//

+PCI_ROOT_BRIDGE  mPciRootBridges[] = {

+  {

+0,  // Segment

+0,  // Supports

+0,  // Attributes

+FALSE,  // DmaAbove4G

+FALSE,  // NoExtendedConfigSpace (true=256 
byte config, false=4k)

+FALSE,  // ResourceAssigned

+EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM |

+EFI_PCI_HOST_BRIDGE_MEM64_DECODE,   // AllocationAttributes

+{

+  // Bus

+  FixedPcdGet32 (PcdPciBusMin),

+  FixedPcdGet32 (PcdPciBusMax)

+}, {

+  // Io

+  FixedPcdGet64 (PcdPciIoBase),

+  FixedPcdGet64 (PcdPciIoBase) + FixedPcdGet64 (PcdPciIoSize) - 1,

+  MAX_UINT64 - FixedPcdGet64 (PcdPciIoOffset) + 1

+}, {

+  // Mem

+  FixedPcdGet32 (PcdPci0Mmio32Base),

+  FixedPcdGet32 (PcdPci0Mmio32Base) + FixedPcdGet32 (PcdPci0Mmio32Size) - 1

+}, {

+  // MemAbove4G

+  FixedPcdGet64 (PcdPci0Mmio64Base),

+  FixedPcdGet64 (PcdPci0Mmio64Base) + FixedPcdGet64 (PcdPci0Mmio64Size) - 1

+},

+{

+  // Pefetchable Mem

+  MAX_UINT32,

+  0x0

+}, {

+  // Pefetchable MemAbove4G

+  MAX_UINT64,

+  0x0

+},

+(EFI_DEVICE_PATH_PROTOCOL *)[0]

+  },

+  {

+1,  // Segment

+0,  // Supports

+0,  // Attributes

+FALSE,  // DmaAbove4G

+FALSE,  // NoExtendedConfigSpace (true=256 
byte config, false=4k)

+FALSE,  // 

[edk2-devel] [PATCH v2 4/4] StarFive/JH7110Pkg: Add JH7110 Silicon Package

2023-10-23 Thread John Chew
From: mindachen1987 

v2:
  - Remove redundant commented PCDs [Sunil]
  - Remove unused PCD: PcdJH7110RegistersAddress [John Chew]
  - Added PCIE PCDs: PcdPciBusMin, PcdPciBusMax, PcdPciBusMax,
 PcdPciIoSize, PcdPciIoOffset, PcdPci0Mmio32Base,
 PcdPci0Mmio32Size, PcdPci0Mmio64Base,
 PcdPci0Mmio64Size, PcdPci1Mmio32Base,
 PcdPci1Mmio32Size, PcdPci1Mmio64Base,
 PcdPci1Mmio64Size [John Chew]

v1:

  - Add a new JH7110 silicon package.
  - These files Contain platfrom specific Guids, PCDs and defines
used for JH7110 SoC.

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Co-authored-by: John Chew 
Signed-off-by: mindachen1987 
---
 Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h | 21 
 Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec | 57 

 2 files changed, 78 insertions(+)

diff --git a/Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h 
b/Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h
new file mode 100644
index ..142e7be10c48
--- /dev/null
+++ b/Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h
@@ -0,0 +1,21 @@
+/** @file

+ *

+ *  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.

+ *

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

+ *

+ **/

+

+#ifndef JH7110_H__

+#define JH7110_H__

+

+/* Generic PCI addresses */

+#define PCIE_TOP_OF_MEM_WIN   (FixedPcdGet64 (PcdPciBusMmioAdr))

+#define PCIE_CPU_MMIO_WINDOW  (FixedPcdGet64 (PcdPciCpuMmioAdr))

+#define PCIE_BRIDGE_MMIO_LEN  (FixedPcdGet32 (PcdPciBusMmioLen))

+

+/* PCI root bridge control registers location */

+#define PCIE_REG_BASE (FixedPcdGet64 (PcdPciRegBase))

+#define PCIE_CONFIG_BASE  (FixedPcdGet64 (PcdPciConfigRegBase))

+

+#endif /* JH7110_H__ */

diff --git a/Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec 
b/Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec
new file mode 100644
index ..f9dc5ab3781d
--- /dev/null
+++ b/Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec
@@ -0,0 +1,57 @@
+## @file

+#

+#  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.

+#

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

+#

+##

+

+[Defines]

+  DEC_SPECIFICATION  = 0x0001001A

+  PACKAGE_NAME   = JH7110Pkg

+  PACKAGE_GUID   = D4B585C5-EBCA-4779-B974-05A3CF2F10C4

+  PACKAGE_VERSION= 1.0

+

+[Includes]

+  Include

+

+[Guids]

+  gJH7110TokenSpaceGuid = {0x44045e56, 0x7056, 0x4be6, {0x88, 0xc0, 0x49, 
0x0c, 0x67, 0x90, 0x2f, 0xba}}

+

+[PcdsFixedAtBuild.common]

+# Memory map

+  gJH7110TokenSpaceGuid.PcdJH7110FlashVarOffset|0x0|UINT32|0x0001

+

+# PCIe

+  gJH7110TokenSpaceGuid.PcdPciRegBase|0x2b00|UINT64|0x0002

+  gJH7110TokenSpaceGuid.PcdPciBusMmioAdr|0x0|UINT64|0x0003

+  gJH7110TokenSpaceGuid.PcdPciBusMmioLen|0x0|UINT32|0x0004

+  gJH7110TokenSpaceGuid.PcdPciCpuMmioAdr|0x0|UINT64|0x0005

+  gJH7110TokenSpaceGuid.PcdPciConfigRegBase|0x94000|UINT64|0x0006

+  gJH7110TokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x1007

+  gJH7110TokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x1008

+  gJH7110TokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x1009

+  gJH7110TokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x100A

+  gJH7110TokenSpaceGuid.PcdPciIoOffset|0x0|UINT64|0x100B

+  gJH7110TokenSpaceGuid.PcdPci0Mmio32Base|0x0|UINT32|0x100C

+  gJH7110TokenSpaceGuid.PcdPci0Mmio32Size|0x0|UINT32|0x100D

+  gJH7110TokenSpaceGuid.PcdPci0Mmio64Base|0x0|UINT64|0x100E

+  gJH7110TokenSpaceGuid.PcdPci0Mmio64Size|0x0|UINT64|0x100F

+  gJH7110TokenSpaceGuid.PcdPci1Mmio32Base|0x0|UINT32|0x1010

+  gJH7110TokenSpaceGuid.PcdPci1Mmio32Size|0x0|UINT32|0x111

+  gJH7110TokenSpaceGuid.PcdPci1Mmio64Base|0x0|UINT64|0x112

+  gJH7110TokenSpaceGuid.PcdPci1Mmio64Size|0x0|UINT64|0x113

+

+# SPI

+  gJH7110TokenSpaceGuid.PcdSpiFlashRegBase|0|UINT32|0x114

+  gJH7110TokenSpaceGuid.PcdSpiFlashAhbBase|0|UINT64|0x115

+  gJH7110TokenSpaceGuid.PcdSpiFlashFifoWidth|0|UINT8|0x1016

+  gJH7110TokenSpaceGuid.PcdSpiFlashRefClkHz|0|UINT32|0x1017

+  gJH7110TokenSpaceGuid.PcdSpiFlashTshslNs|0|UINT32|0x1018

+  gJH7110TokenSpaceGuid.PcdSpiFlashTsd2dNs|0|UINT32|0x119

+  gJH7110TokenSpaceGuid.PcdSpiFlashTchshNs|0|UINT32|0x11A

+  gJH7110TokenSpaceGuid.PcdSpiFlashTslchNs|0|UINT32|0x11B

+

+[Protocols]

+  gJH7110SpiMasterProtocolGuid = { 0xA33C46E0, 0x4FB6, 0x4AA3, { 0x8E, 0x66, 
0x00, 0x06, 0x9F, 0x3A, 0x11, 0x81 }}

+  gJH7110SpiFlashProtocolGuid  = { 0x5ECECDF6, 0x81DA, 0x4E10, { 0x9D, 0x4B, 
0x26, 0x65, 0x8C, 0x03, 0xAB, 0xBC }}

-- 
2.34.1



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

[edk2-devel] [PATCH v2 3/4] StarFive/JH7110Pkg: Add firmware volume block protocol

2023-10-23 Thread John Chew
Support for efi variable to store in QSPI flash.
This driver is responsible to initialize both QSPI and Flash driver.

Firmware Volume(FV) Initialization:
1. Copy flash content into allocated shadow buffer (RAM)
2. Check FV header validity
3. If not valid, erase flash based on the region defined in PCDs
   , else skip
4. If erased, write flash with new FV header, else skip
EFI Variable read:
1. Read anbd return the content from the shadow buffer (RAM)
EFI Variable write:
1. Write the data into flash
2. Update shadow buffer (RAM)

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Signed-off-by: John Chew 
---
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.c   | 909 

 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.h   | 138 +++
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.inf |  70 ++
 3 files changed, 1117 insertions(+)

diff --git 
a/Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.c 
b/Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.c
new file mode 100644
index ..c30e82ed0871
--- /dev/null
+++ b/Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.c
@@ -0,0 +1,909 @@
+/** @file

+ *

+ *  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.

+ *

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

+ *

+ **/

+

+#include "FvbDxe.h"

+

+STATIC FVB_DEVICE  *mFvbDevice;

+

+STATIC CONST FVB_DEVICE  mFvbFlashInstanceTemplate = {

+  {

+0,/* AddrSize ... NEED TO BE FILLED */

+NULL, /* Read from NOR FLASH ... NEED TO BE FILLED */

+0,/* RegBase ... NEED TO BE FILLED */

+0,/* AbhBase ... NEED TO BE FILLED */

+0,/* FifoWidth ... NEED TO BE FILLED */

+0,/* WriteDelay ... NEED TO BE FILLED */

+  }, /* SPI_DEVICE_PARAMS */

+

+  NULL, /* SpiFlashProtocol ... NEED TO BE FILLED */

+  NULL, /* SpiMasterProtocol ... NEED TO BE FILLED */

+  NULL, /* Handle ... NEED TO BE FILLED */

+

+  FVB_FLASH_SIGNATURE, /* Signature ... NEED TO BE FILLED */

+

+  0, /* ShadowBufBaseAddr ... NEED TO BE FILLED */

+  0, /* ShadowBufSize ... NEED TO BE FILLED */

+  0, /* FvbFlashVarOffset ... NEED TO BE FILLED */

+  0, /* FvbFlashVarSize ... NEED TO BE FILLED */

+  0, /* BlockSize ... NEED TO BE FILLED */

+  0, /* LastBlock ... NEED TO BE FILLED */

+  0, /* StartLba */

+

+  {

+FvbGetAttributes,   /* GetAttributes */

+FvbSetAttributes,   /* SetAttributes */

+FvbGetPhysicalAddress,  /* GetPhysicalAddress */

+FvbGetBlockSize,/* GetBlockSize */

+FvbRead,/* Read */

+FvbWrite,   /* Write */

+FvbEraseBlocks, /* EraseBlocks */

+NULL,   /* ParentHandle */

+  }, /* EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL */

+

+  {

+{

+  {

+HARDWARE_DEVICE_PATH,

+HW_VENDOR_DP,

+{

+  (UINT8)sizeof (VENDOR_DEVICE_PATH),

+  (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)

+}

+  },

+  { 0xfc0cb972, 0x21df, 0x44d2, { 0x92, 0xa5, 0x78, 0x98, 0x99, 0xcb, 
0xf6, 0x61 }

+  }

+},

+{

+  END_DEVICE_PATH_TYPE,

+  END_ENTIRE_DEVICE_PATH_SUBTYPE,

+  { sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 }

+}

+  } /* FVB_DEVICE_PATH */

+};

+

+STATIC

+EFI_STATUS

+FvbInitFvAndVariableStoreHeaders (

+  IN FVB_DEVICE  *FlashInstance

+  )

+{

+  EFI_FIRMWARE_VOLUME_HEADER  *FirmwareVolumeHeader;

+  VARIABLE_STORE_HEADER   *VariableStoreHeader;

+  EFI_STATUS  Status;

+  VOID*Headers;

+  UINTN   HeadersLength;

+  UINTN   BlockSize;

+

+  HeadersLength = sizeof (EFI_FIRMWARE_VOLUME_HEADER) +

+  sizeof (EFI_FV_BLOCK_MAP_ENTRY) +

+  sizeof (VARIABLE_STORE_HEADER);

+  Headers = AllocateZeroPool (HeadersLength);

+

+  BlockSize = FlashInstance->BlockSize;

+

+  /* VariableBase -> FtwWOrkingBase -> FtwSpareBase are declared

+   * consecutively in contiguous memory

+   */

+  ASSERT (

+  PcdGet64 (PcdFlashNvStorageVariableBase64) +

+  PcdGet32 (PcdFlashNvStorageVariableSize) ==

+  PcdGet64 (PcdFlashNvStorageFtwWorkingBase64)

+  );

+  ASSERT (

+  PcdGet64 (PcdFlashNvStorageFtwWorkingBase64) +

+  PcdGet32 (PcdFlashNvStorageFtwWorkingSize) ==

+  PcdGet64 (PcdFlashNvStorageFtwSpareBase64)

+  );

+

+  /* Ensure the size of the variable area is at least one block size */

+  ASSERT (

+  (PcdGet32 (PcdFlashNvStorageVariableSize) > 0) &&

+  (PcdGet32 (PcdFlashNvStorageVariableSize) / BlockSize > 0)

+  );

+  ASSERT (

+  (PcdGet32 (PcdFlashNvStorageFtwWorkingSize) > 0) &&

+  (PcdGet32 (PcdFlashNvStorageFtwWorkingSize) / 

[edk2-devel] [PATCH v2 2/4] StarFive/JH7110Pkg: Add SPI protocol and driver support

2023-10-23 Thread John Chew
This patch include QSPI driver and Flash driver protocol.
QSPI driver:
1. Used indirect read/write
2. Master mode only
3. Require to setup qspi driver after located protocol
4. Require to free device if no longer needed
5. Support command read/write & data read/write
Flash driver:
1. Require QSPI protocol as prerequisite
2. Support for flash read/write/update/erase
3. Require to init flash driver after allocated protocol

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Signed-off-by: John Chew 
---
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.c
 | 893 
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.h
 | 188 +
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.inf  
 |  52 ++
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.c  
 | 571 +
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.h  
 |  35 +
 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.inf 
|  44 +
 Silicon/StarFive/JH7110Pkg/Include/Protocol/Spi.h  
 | 163 
 Silicon/StarFive/JH7110Pkg/Include/Protocol/SpiFlash.h 
 |  88 ++
 8 files changed, 2034 insertions(+)

diff --git 
a/Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.c 
b/Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.c
new file mode 100755
index ..c345556f8abf
--- /dev/null
+++ b/Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.c
@@ -0,0 +1,893 @@
+/** @file

+ *

+ *  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.

+ *

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

+ *

+ **/

+

+#include "SpiDxe.h"

+

+SPI_MASTER  *mSpiMasterInstance;

+

+STATIC

+VOID

+SpiControllerEnable (

+  IN UINT32  RegBase

+  )

+{

+  UINT32  Reg;

+

+  Reg  = MmioRead32 (RegBase + SPI_REG_CONFIG);

+  Reg |= SPI_REG_CONFIG_ENABLE;

+  MmioWrite32 (RegBase + SPI_REG_CONFIG, Reg);

+}

+

+STATIC

+VOID

+SpiControllerDisable (

+  IN UINT32  RegBase

+  )

+{

+  UINT32  Reg;

+

+  Reg  = MmioRead32 (RegBase + SPI_REG_CONFIG);

+  Reg &= ~SPI_REG_CONFIG_ENABLE;

+  MmioWrite32 (RegBase + SPI_REG_CONFIG, Reg);

+}

+

+STATIC

+VOID

+SpiWriteSpeed (

+  IN SPI_DEVICE_PARAMS  *Slave,

+  IN UINT32 SclkHz,

+  IN SPI_TIMING_PARAMS  *Timing

+  )

+{

+  UINT32  Reg, Div, RefClkNs, SclkNs;

+  UINT32  Tshsl, Tchsh, Tslch, Tsd2d;

+

+  SpiControllerDisable (Slave->RegBase);

+

+  /* Configure baudrate */

+  Reg  = MmioRead32 (Slave->RegBase + SPI_REG_CONFIG);

+  Reg &= ~(SPI_REG_CONFIG_BAUD_MASK << SPI_REG_CONFIG_BAUD_LSB);

+

+  Div = DIV_ROUND_UP (Timing->RefClkHz, SclkHz * 2) - 1;

+

+  if (Div > SPI_REG_CONFIG_BAUD_MASK) {

+Div = SPI_REG_CONFIG_BAUD_MASK;

+  }

+

+  DEBUG (

+ (DEBUG_INFO, "%a(): RefClk %dHz sclk %dHz Div 0x%x, actual %dHz\n", 
__func__,

+  Timing->RefClkHz, SclkHz, Div, Timing->RefClkHz / (2 * (Div + 1)))

+ );

+

+  Reg |= (Div << SPI_REG_CONFIG_BAUD_LSB);

+  MmioWrite32 (Slave->RegBase + SPI_REG_CONFIG, Reg);

+

+  /* Configure delay timing */

+  RefClkNs = DIV_ROUND_UP (10, Timing->RefClkHz);

+  SclkNs = DIV_ROUND_UP (10, SclkHz);

+

+  if (Timing->TshslNs >= SclkNs + RefClkNs) {

+Timing->TshslNs -= SclkNs + RefClkNs;

+  }

+

+  if (Timing->TchshNs >= SclkNs + 3 * RefClkNs) {

+Timing->TchshNs -= SclkNs + 3 * RefClkNs;

+  }

+

+  Tshsl = DIV_ROUND_UP (Timing->TshslNs, RefClkNs);

+  Tchsh = DIV_ROUND_UP (Timing->TchshNs, RefClkNs);

+  Tslch = DIV_ROUND_UP (Timing->TslchNs, RefClkNs);

+  Tsd2d = DIV_ROUND_UP (Timing->Tsd2dNs, RefClkNs);

+

+  Reg = ((Tshsl & SPI_REG_DELAY_TSHSL_MASK)

+ << SPI_REG_DELAY_TSHSL_LSB);

+  Reg |= ((Tchsh & SPI_REG_DELAY_TCHSH_MASK)

+  << SPI_REG_DELAY_TCHSH_LSB);

+  Reg |= ((Tslch & SPI_REG_DELAY_TSLCH_MASK)

+  << SPI_REG_DELAY_TSLCH_LSB);

+  Reg |= ((Tsd2d & SPI_REG_DELAY_TSD2D_MASK)

+  << SPI_REG_DELAY_TSD2D_LSB);

+  MmioWrite32 (Slave->RegBase + SPI_REG_DELAY, Reg);

+

+  SpiControllerEnable (Slave->RegBase);

+}

+

+STATIC

+EFI_STATUS

+SpiWaitIdle (

+  IN UINT32  RegBase

+  )

+{

+  BOOLEAN IsIdle;

+  UINT32  Count = 0;

+  UINT32  TimeoutMs = 500;

+

+  do {

+IsIdle = (BOOLEAN)((MmioRead32(RegBase + SPI_REG_CONFIG) >>

+SPI_REG_CONFIG_IDLE_LSB) & 0x1);

+Count = (IsIdle) ? (Count+1) : 0;

+

+/*

+ * Make sure the QSPI controller is in really idle

+ * for n period of time before proceed

+ */

+if (Count >= SPI_POLL_IDLE_RETRY) {

+  return EFI_SUCCESS;

+}

+

+gBS->Stall (1);

+  } while (TimeoutMs);

+

+  return EFI_TIMEOUT;

+}

+

+STATIC

+EFI_STATUS

+SpiExecFlashCmd (

+  IN UINT32  RegBase,

+  

[edk2-devel] [PATCH v2 0/4] Patches for JH7110 SoC platform

2023-10-23 Thread John Chew
v2:
  - Include all maintainer in all patches in this series [Sunil]
  - Added missing commit message to patches 1/6, 2/6, 6/6 [Sunil]
  - Remove commented code in JH7110.h [Sunil]
  - Remove BootServicesDxe/BootServicesDxe.inf, as it is not required 
anymore because memory allocation is handle by MMC driver [Sunil]
  - Remove PlatformBootManagerLib.inf and change PlatformBootManagerLib to
"Platform/RISC-V/PlatformPkg/.../PlatformBootManagerLib.inf" [Sunil] 
  - Added PCDs for PCIE (Please refer to patch 0001 for details) [John Chew]

v1:
  - In this patches it include all the platform specific drivers/protocol
that is being use for JH7110 SoC platform. All the drivers includes:
  1. PCIE driver for NVME and USB (GT710 graphic in progress)
  2. QSPI Flash driver for efi variable
  3. FVB driver for efi variable
  4. Boot service memory allocation driver
  5. Platform boot manager for graphical console display

  Reference branch:
https://github.com/johnchewyy/edkii-platforms/tree/vf2_jh7110_devel_upstream

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 

John Chew (2):
  StarFive/JH7110Pkg: Add SPI protocol and driver support
  StarFive/JH7110Pkg: Add firmware volume block protocol

mindachen1987 (2):
  StarFive/JH7110Pkg: Add Pci controller driver
  StarFive/JH7110Pkg: Add JH7110 Silicon Package

 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.c
   |  909 
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.h
   |  138 ++
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.inf  
   |   70 +
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.c
   |  893 
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.h
   |  188 +++
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.inf  
   |   52 +
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.c  
   |  571 
 Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.h  
   |   35 +
 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.inf 
  |   44 +
 Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h   
   |   21 +
 Silicon/StarFive/JH7110Pkg/Include/Protocol/Spi.h  
   |  163 +++
 Silicon/StarFive/JH7110Pkg/Include/Protocol/SpiFlash.h 
   |   88 ++
 Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec   
   |   57 +
 Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c 
   |  263 
 Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf   
   |   61 +
 
Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLibConstructor.c
 |  406 ++
 Silicon/StarFive/JH7110Pkg/Library/PciSegmentLib/PciSegmentLib.c   
   | 1460 
 Silicon/StarFive/JH7110Pkg/Library/PciSegmentLib/PciSegmentLib.inf 
   |   33 +
 18 files changed, 5452 insertions(+)
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.c
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.h
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/FvbDxe/FvbDxe.inf
 create mode 100755 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.c
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.h
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiDxe/SpiDxe.inf
 create mode 100755 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.c
 create mode 100755 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.h
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Driver/SpiFvbServicesDxe/SpiFlashDxe/SpiFlashDxe.inf
 create mode 100644 Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h
 create mode 100644 Silicon/StarFive/JH7110Pkg/Include/Protocol/Spi.h
 create mode 100644 Silicon/StarFive/JH7110Pkg/Include/Protocol/SpiFlash.h
 create mode 100644 Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Library/PciHostBridgeLib/PciHostBridgeLibConstructor.c
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Library/PciSegmentLib/PciSegmentLib.c
 create mode 100644 
Silicon/StarFive/JH7110Pkg/Library/PciSegmentLib/PciSegmentLib.inf

-- 
2.34.1



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

[edk2-devel] [PATCH v2 5/5] DesignWare/DwEmmcDxe: Force DMA buffer to allocate below 4GB

2023-10-23 Thread John Chew
The buffer address passed into the read/write block function sometimes
larger than 4GB. This driver only support 32-bit DMA addressing.
MMC timeout will occur if DMA buffer is allocated in 64-bit address.

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Signed-off-by: John Chew 
---
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c | 79 

 1 file changed, 64 insertions(+), 15 deletions(-)

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 39e4d994fcd4..8233639b0ce8 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -601,27 +601,57 @@ DwEmmcWaitDmaComplete (
   return Status;

 }

 

+STATIC

+UINT32 *

+AllocateMemoryBelow4G (

+  IN UINTN  Size

+  )

+{

+  UINTN Pages;

+  EFI_PHYSICAL_ADDRESS  Address;

+  EFI_STATUSStatus;

+  UINT32  *Buffer;

+

+  Pages   = EFI_SIZE_TO_PAGES (Size);

+  Address = 0x;

+

+  Status = gBS->AllocatePages (

+  AllocateMaxAddress,

+  EfiBootServicesData,

+  Pages,

+  

+  );

+  ASSERT_EFI_ERROR (Status);

+

+  Buffer = (UINT32 *)(UINTN)Address;

+  ZeroMem (Buffer, Size);

+

+  return Buffer;

+}

+

 EFI_STATUS

 DwEmmcReadBlockData (

-  IN EFI_MMC_HOST_PROTOCOL *This,

-  IN EFI_LBALba,

-  IN UINTN  Length,

-  IN UINT32*   Buffer

+  IN EFI_MMC_HOST_PROTOCOL  *This,

+  IN EFI_LBALba,

+  IN UINTN  Length,

+  IN UINT32*Buffer

   )

 {

   EFI_STATUS  Status;

   UINT32  DescPages, CountPerPage, Count;

   EFI_TPL Tpl;

+  UINT32  *DmaBuf;

 

   Tpl = gBS->RaiseTPL (TPL_NOTIFY);

+  DmaBuf = AllocateMemoryBelow4G(Length);

 

   CountPerPage = EFI_PAGE_SIZE / 16;

   Count = (Length + DWEMMC_DMA_BUF_SIZE - 1) / DWEMMC_DMA_BUF_SIZE;

   DescPages = (Count + CountPerPage - 1) / CountPerPage;

 

-  InvalidateDataCacheRange (Buffer, Length);

+  InvalidateDataCacheRange (DmaBuf, Length);

 

-  Status = PrepareDmaData (gpIdmacDesc, Length, Buffer);

+  Status = PrepareDmaData (gpIdmacDesc, Length, DmaBuf);

   if (EFI_ERROR (Status)) {

 goto out;

   }

@@ -637,11 +667,14 @@ DwEmmcReadBlockData (
   Status = DwEmmcWaitDmaComplete(This, 1);

 

   if (DWMCI_SD_READ_MASK(mDwEmmcArgument) && (FixedPcdGetBool 
(PcdDwEmmcDxeCPULittleEndian))) {

-Buffer[3] = SwapBytes32(Buffer[3]);

-Buffer[4] = SwapBytes32(Buffer[4]);

+DmaBuf[3] = SwapBytes32(DmaBuf[3]);

+DmaBuf[4] = SwapBytes32(DmaBuf[4]);

   }

 

+  CopyMem(Buffer, DmaBuf, Length);

+

 out:

+  FreePages (DmaBuf, EFI_SIZE_TO_PAGES(Length));

   // Restore Tpl

   gBS->RestoreTPL (Tpl);

   return Status;

@@ -649,25 +682,29 @@ out:
 

 EFI_STATUS

 DwEmmcWriteBlockData (

-  IN EFI_MMC_HOST_PROTOCOL *This,

-  IN EFI_LBALba,

-  IN UINTN  Length,

-  IN UINT32*Buffer

+  IN EFI_MMC_HOST_PROTOCOL  *This,

+  IN EFI_LBALba,

+  IN UINTN  Length,

+  IN UINT32*Buffer

   )

 {

   EFI_STATUS  Status;

   UINT32  DescPages, CountPerPage, Count;

   EFI_TPL Tpl;

+  UINT32  *DmaBuf;

 

   Tpl = gBS->RaiseTPL (TPL_NOTIFY);

 

+  DmaBuf = AllocateMemoryBelow4G(Length);

+  CopyMem(DmaBuf, Buffer, Length);

+

   CountPerPage = EFI_PAGE_SIZE / 16;

   Count = (Length + DWEMMC_DMA_BUF_SIZE - 1) / DWEMMC_DMA_BUF_SIZE;

   DescPages = (Count + CountPerPage - 1) / CountPerPage;

 

-  WriteBackDataCacheRange (Buffer, Length);

+  WriteBackDataCacheRange (DmaBuf, Length);

 

-  Status = PrepareDmaData (gpIdmacDesc, Length, Buffer);

+  Status = PrepareDmaData (gpIdmacDesc, Length, DmaBuf);

   if (EFI_ERROR (Status)) {

 goto out;

   }

@@ -683,6 +720,7 @@ DwEmmcWriteBlockData (
   Status = DwEmmcWaitDmaComplete(This, 0);

 

 out:

+  FreePages (DmaBuf, EFI_SIZE_TO_PAGES(Length));

   // Restore Tpl

   gBS->RestoreTPL (Tpl);

   return Status;

@@ -772,6 +810,7 @@ DwEmmcDxeInitialize (
 {

   EFI_STATUSStatus;

   EFI_HANDLEHandle;

+  EFI_PHYSICAL_ADDRESS  Address;

 

   if (!FixedPcdGetBool (PcdDwPermitObsoleteDrivers)) {

 ASSERT (FALSE);

@@ -781,7 +820,17 @@ DwEmmcDxeInitialize (
   Handle = NULL;

 

   DwEmmcAdjustFifoThreshold ();

-  gpIdmacDesc = (DWEMMC_IDMAC_DESCRIPTOR *)AllocatePages 
(DWEMMC_MAX_DESC_PAGES);

+

+  Address = 0x;

+  Status = gBS->AllocatePages (

+  AllocateMaxAddress,

+  EfiBootServicesData,

+  DWEMMC_MAX_DESC_PAGES,

+  

+  );

+  gpIdmacDesc = (DWEMMC_IDMAC_DESCRIPTOR *)(UINTN)Address;

+  ZeroMem (gpIdmacDesc, DWEMMC_MAX_DESC_PAGES);

+

   if (gpIdmacDesc 

[edk2-devel] [PATCH v2 4/5] DesignWare/DwEmmcDxe: Add handling for SDMMC

2023-10-23 Thread John Chew
From: mindachen1987 

Add base address PCD for eMMC and SDMMC
Add application command for SDMMC
Add PCD for Ultra High Speed (UHS) option

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Co-authored-by: John Chew 
Signed-off-by: mindachen1987 
---
 Silicon/Synopsys/DesignWare/DesignWare.dec 
 |   2 +
 Silicon/Synopsys/DesignWare/DesignWare.dsc 
 |   1 +
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h 
 |  64 +++
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c  
 | 183 +---
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
 |   1 +
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/{DwEmmcDxe.inf => 
DwSdmmcDxe.inf} |   9 +-
 6 files changed, 158 insertions(+), 102 deletions(-)

diff --git a/Silicon/Synopsys/DesignWare/DesignWare.dec 
b/Silicon/Synopsys/DesignWare/DesignWare.dec
index 751370a8b1af..91aca7568b08 100755
--- a/Silicon/Synopsys/DesignWare/DesignWare.dec
+++ b/Silicon/Synopsys/DesignWare/DesignWare.dec
@@ -31,4 +31,6 @@ [PcdsFixedAtBuild.common]
   
gDesignWareTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|0x0|UINT32|0x0003

   gDesignWareTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz|0x0|UINT32|0x0004

   gDesignWareTokenSpaceGuid.PcdDwEmmcDxeFifoDepth|0x0|UINT32|0x0005

+  gDesignWareTokenSpaceGuid.PcdDwSdDxeBaseAddress|0x0|UINT32|0x0006

+  gDesignWareTokenSpaceGuid.PcdDwEmmcDxeUHSEn|TRUE|BOOLEAN|0x0007

   
gDesignWareTokenSpaceGuid.PcdDwEmmcDxeCPULittleEndian|FALSE|BOOLEAN|0x0008

diff --git a/Silicon/Synopsys/DesignWare/DesignWare.dsc 
b/Silicon/Synopsys/DesignWare/DesignWare.dsc
index b5a7b38e142e..7ebec358851e 100755
--- a/Silicon/Synopsys/DesignWare/DesignWare.dsc
+++ b/Silicon/Synopsys/DesignWare/DesignWare.dsc
@@ -43,3 +43,4 @@ [LibraryClasses]
 [Components]

   Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/DwEmacSnpDxe.inf

   Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf

+  Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwSdmmcDxe.inf

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h
index 3347418006c7..5d2e6d4055a4 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h
@@ -18,38 +18,38 @@
 #include 

 

 // DW MMC Registers

-#define DWEMMC_CTRL ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x000)

-#define DWEMMC_PWREN((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x004)

-#define DWEMMC_CLKDIV   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x008)

-#define DWEMMC_CLKSRC   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x00c)

-#define DWEMMC_CLKENA   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x010)

-#define DWEMMC_TMOUT((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x014)

-#define DWEMMC_CTYPE((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x018)

-#define DWEMMC_BLKSIZ   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x01c)

-#define DWEMMC_BYTCNT   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x020)

-#define DWEMMC_INTMASK  ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x024)

-#define DWEMMC_CMDARG   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x028)

-#define DWEMMC_CMD  ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x02c)

-#define DWEMMC_RESP0((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x030)

-#define DWEMMC_RESP1((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x034)

-#define DWEMMC_RESP2((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x038)

-#define DWEMMC_RESP3((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x03c)

-#define DWEMMC_RINTSTS  ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x044)

-#define DWEMMC_STATUS   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x048)

-#define DWEMMC_FIFOTH   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x04c)

-#define DWEMMC_TCBCNT   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x05c)

-#define DWEMMC_TBBCNT   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x060)

-#define DWEMMC_DEBNCE   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x064)

-#define DWEMMC_HCON ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x070)

-#define DWEMMC_UHSREG   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x074)

-#define DWEMMC_BMOD ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x080)

-#define DWEMMC_DBADDR   ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x088)

-#define DWEMMC_IDSTS((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x08c)

-#define DWEMMC_IDINTEN  ((UINT32)PcdGet32 (PcdDwEmmcDxeBaseAddress) + 
0x090)

-#define DWEMMC_DSCADDR  ((UINT32)PcdGet32 

[edk2-devel] [PATCH v2 3/5] DesignWare/DwEmmcDxe: Remove ARM dependency library

2023-10-23 Thread John Chew
From: mindachen1987 

This driver do not have dependency on ArmLib. It will cause compilation
error when compile with risv architecture.

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Signed-off-by: mindachen1987 
---
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
index 18c84a4172f9..0bd78d5a05ad 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
@@ -30,7 +30,6 @@ [Packages]
   Silicon/Synopsys/DesignWare/DesignWare.dec

 

 [LibraryClasses]

-  ArmLib

   BaseLib

   BaseMemoryLib

   CacheMaintenanceLib

-- 
2.34.1



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




[edk2-devel] [PATCH v2 2/5] DesignWare/DwEmmcDxe: Add CPU little endian option

2023-10-23 Thread John Chew
From: mindachen1987 

Add PCD for little endian CPU. During RX, the endianess of data receive
via DMA will be swap.

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 
Co-authored-by: mindachen1987 
Signed-off-by: John Chew 
---
 Silicon/Synopsys/DesignWare/DesignWare.dec  | 1 +
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c   | 5 +
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf | 1 +
 3 files changed, 7 insertions(+)

diff --git a/Silicon/Synopsys/DesignWare/DesignWare.dec 
b/Silicon/Synopsys/DesignWare/DesignWare.dec
index f7ec7927543c..751370a8b1af 100755
--- a/Silicon/Synopsys/DesignWare/DesignWare.dec
+++ b/Silicon/Synopsys/DesignWare/DesignWare.dec
@@ -31,3 +31,4 @@ [PcdsFixedAtBuild.common]
   
gDesignWareTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|0x0|UINT32|0x0003

   gDesignWareTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz|0x0|UINT32|0x0004

   gDesignWareTokenSpaceGuid.PcdDwEmmcDxeFifoDepth|0x0|UINT32|0x0005

+  
gDesignWareTokenSpaceGuid.PcdDwEmmcDxeCPULittleEndian|FALSE|BOOLEAN|0x0008

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 7ac286c5f361..edda28a45d7c 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -588,6 +588,11 @@ DwEmmcReadBlockData (
   }

   Status = DwEmmcWaitDmaComplete(This, 1);

 

+  if (DWMCI_SD_READ_MASK(mDwEmmcArgument) && (FixedPcdGetBool 
(PcdDwEmmcDxeCPULittleEndian))) {

+Buffer[3] = SwapBytes32(Buffer[3]);

+Buffer[4] = SwapBytes32(Buffer[4]);

+  }

+

 out:

   // Restore Tpl

   gBS->RestoreTPL (Tpl);

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
index 7f70fe1e2a38..18c84a4172f9 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
@@ -51,6 +51,7 @@ [Pcd]
   gDesignWareTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz

   gDesignWareTokenSpaceGuid.PcdDwEmmcDxeFifoDepth

   gDesignWareTokenSpaceGuid.PcdDwPermitObsoleteDrivers

+  gDesignWareTokenSpaceGuid.PcdDwEmmcDxeCPULittleEndian

 

 [Depex]

   TRUE

-- 
2.34.1



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




[edk2-devel] [PATCH v2 1/5] DesignWare/DwEmmcDxe: Enabled Internal IDMAC interrupt RX/TX register

2023-10-23 Thread John Chew
From: mindachen1987 

Remove DMA enable in CTRL register
Added DMA polling handling for RX/TX

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Li Yong 
Co-authored-by: John Chew 
Signed-off-by: mindachen1987 
---
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h|  6 +++
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c | 52 
++--
 2 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h
index 09ad9b8428c4..3347418006c7 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h
@@ -129,4 +129,10 @@
 

 #define DWEMMC_GET_HDATA_WIDTH(x)   (((x) >> 7) & 0x7)

 

+/* Internal IDMAC interrupt defines */

+#define DWMCI_IDINTEN_RI(1 << 1)

+#define DWMCI_IDINTEN_TI(1 << 0)

+

+#define DWMCI_IDINTEN_MASK  (DWMCI_IDINTEN_RI | 
DWMCI_IDINTEN_TI)

+

 #endif  // __DWEMMC_H__

diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 39b1ea4346dc..7ac286c5f361 100644
--- a/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -215,6 +215,7 @@ DwEmmcNotifyState (
 do {

   Data = MmioRead32 (DWEMMC_BMOD);

 } while (Data & DWEMMC_IDMAC_SWRESET);

+MmioWrite32 (DWEMMC_IDINTEN, 0x3);

 break;

   case MmcIdleState:

 break;

@@ -463,6 +464,14 @@ PrepareDmaData (
   )

 {

   UINTN  Cnt, Blks, Idx, LastIdx;

+  UINT32 Data; /* flag, cnt */

+

+  MmioWrite32 (DWEMMC_CTRL, DWEMMC_CTRL_FIFO_RESET);

+  do {

+/* Wait until reset operation finished */

+Data = MmioRead32 (DWEMMC_CTRL);

+  } while (Data & DWEMMC_CTRL_RESET_ALL);

+  MmioWrite32 (DWEMMC_IDSTS, 0x);

 

   Cnt = (Length + DWEMMC_DMA_BUF_SIZE - 1) / DWEMMC_DMA_BUF_SIZE;

   Blks = (Length + DWEMMC_BLOCK_SIZE - 1) / DWEMMC_BLOCK_SIZE;

@@ -487,9 +496,7 @@ PrepareDmaData (
   (IdmacDesc + LastIdx)->Des1 = DWEMMC_IDMAC_DES1_BS1(Length -

   (LastIdx * 
DWEMMC_DMA_BUF_SIZE));

   /* Set the Next field of Last Descriptor */

-  (IdmacDesc + LastIdx)->Des3 = 0;

   MmioWrite32 (DWEMMC_DBADDR, (UINT32)((UINTN)IdmacDesc));

-

   return EFI_SUCCESS;

 }

 

@@ -501,7 +508,7 @@ StartDma (
   UINT32 Data;

 

   Data = MmioRead32 (DWEMMC_CTRL);

-  Data |= DWEMMC_CTRL_INT_EN | DWEMMC_CTRL_DMA_EN | DWEMMC_CTRL_IDMAC_EN;

+  Data |= DWEMMC_CTRL_DMA_EN | DWEMMC_CTRL_IDMAC_EN;

   MmioWrite32 (DWEMMC_CTRL, Data);

   Data = MmioRead32 (DWEMMC_BMOD);

   Data |= DWEMMC_IDMAC_ENABLE | DWEMMC_IDMAC_FB;

@@ -511,6 +518,41 @@ StartDma (
   MmioWrite32 (DWEMMC_BYTCNT, Length);

 }

 

+STATIC

+EFI_STATUS

+DwEmmcWaitDmaComplete (

+  IN EFI_MMC_HOST_PROTOCOL *This,

+  IN UINT32 Read

+  )

+{

+  UINT32 Mask, Ctrl, Timeout = 100;

+  EFI_STATUS Status = EFI_SUCCESS;

+

+  Mask = (Read) ? DWMCI_IDINTEN_RI : DWMCI_IDINTEN_TI;

+

+  do {

+Ctrl = MmioRead32 (DWEMMC_IDSTS);

+if (Ctrl & Mask) {

+  break;

+}

+Timeout--;

+gBS->Stall(1);

+  } while (Timeout);

+

+  if (!Timeout) {

+DEBUG ((DEBUG_INFO, "%a, DMA waiting timeout...\n", __func__));

+Status = EFI_DEVICE_ERROR;

+  }

+  MmioWrite32 (DWEMMC_IDSTS, DWMCI_IDINTEN_MASK);

+  Ctrl = MmioRead32(DWEMMC_CTRL);

+  Ctrl &= ~(DWEMMC_CTRL_DMA_EN);

+  Ctrl = MmioWrite32(DWEMMC_CTRL, Ctrl);

+

+  gBS->Stall(100);

+

+  return Status;

+}

+

 EFI_STATUS

 DwEmmcReadBlockData (

   IN EFI_MMC_HOST_PROTOCOL *This,

@@ -544,6 +586,8 @@ DwEmmcReadBlockData (
 DEBUG ((DEBUG_ERROR, "Failed to read data, mDwEmmcCommand:%x, 
mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));

 goto out;

   }

+  Status = DwEmmcWaitDmaComplete(This, 1);

+

 out:

   // Restore Tpl

   gBS->RestoreTPL (Tpl);

@@ -583,6 +627,8 @@ DwEmmcWriteBlockData (
 DEBUG ((DEBUG_ERROR, "Failed to write data, mDwEmmcCommand:%x, 
mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));

 goto out;

   }

+  Status = DwEmmcWaitDmaComplete(This, 0);

+

 out:

   // Restore Tpl

   gBS->RestoreTPL (Tpl);

-- 
2.34.1



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




[edk2-devel] [PATCH v2 0/5] Designware MMCDXE changes and enhancement

2023-10-23 Thread John Chew
v2:
  - Added maintainer to all patch in this series [Sunil]
  - Implement addition memory allocation strategy, where dma buffer
is force to allocation below 4GB (Please refer to pathc 0005)
[Sunil]

v1:
  This patch series involves the following changes:
1. Remove DMA enable in CTRL register
2. Added DMA polling handling for RX/TX 
3. Integrate SD MMC handling into the driver

Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cc: Li Yong 

John Chew (1):
  DesignWare/DwEmmcDxe: Force DMA buffer to allocate below 4GB

mindachen1987 (4):
  DesignWare/DwEmmcDxe: Enabled Internal IDMAC interrupt RX/TX register
  DesignWare/DwEmmcDxe: Add CPU little endian option
  DesignWare/DwEmmcDxe: Remove ARM dependency library
  DesignWare/DwEmmcDxe: Add handling for SDMMC

 Silicon/Synopsys/DesignWare/DesignWare.dec 
 |   3 +
 Silicon/Synopsys/DesignWare/DesignWare.dsc 
 |   1 +
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmc.h 
 |  70 +++--
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.c  
 | 315 +++-
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/DwEmmcDxe.inf
 |   3 +-
 Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/{DwEmmcDxe.inf => 
DwSdmmcDxe.inf} |  11 +-
 6 files changed, 283 insertions(+), 120 deletions(-)
 copy Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe/{DwEmmcDxe.inf => 
DwSdmmcDxe.inf} (74%)

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109890): https://edk2.groups.io/g/devel/message/109890
Mute This Topic: https://groups.io/mt/102130684/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/7] LoongArchQemuPkg/LsRealTimeClockLib: remove superfluous instance init steps

2023-10-23 Thread Chao Li

Hi Laszlo,

This change is look good to me and I will take this change into 
edk2/OvmfPkg/LoongArchVirt/ which I'm porting. Thanks.


Reviewed-by: Chao Li 



Thanks,
Chao
在 2023/10/20 20:18, Laszlo Ersek 写道:

RealTimeClockLib instances are consumed by edk2's
EmbeddedPkg/RealTimeClockRuntimeDxe driver. In its entry point function
InitializeRealTimeClock(), the driver:

(1) calls LibRtcInitialize(),

(2) sets the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime()
 runtime services to its own similarly-named functions -- where those
 functions wrap the corresponding RealTimeClockLib APIs,

(3) installs EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL with a NULL protocol
 interface.

Steps (2) and (3) conform to PI v1.8 sections II-9.7.2.4 through
II-9.7.2.7.

However, this means that LibRtcInitialize() (of any RealTimeClockLib
instance) should not itself (a) set the GetTime(), SetTime(),
GetWakeupTime() and SetWakeupTime() runtime services, nor (b) install
EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL. The runtime service pointers will be
overwritten in step (2) anyway, and step (3) will uselessly install a
second (NULL-interface) EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL instance in the
protocol database. (The protocol only serves to notify the DXE Foundation
about said runtime services being available.)

Clean up LoongArchQemuPkg/LsRealTimeClockLib accordingly.

(Note that the lib instance INF file already does not list
UefiRuntimeServicesTableLib.)

Build-tested only (with "Loongson.dsc").

Cc: Bibo Mao
Cc: Chao Li
Cc: Xianglai li
Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=4565
Signed-off-by: Laszlo Ersek
---

Notes:
 context:-W

  
Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf
 |  3 ---
  
Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
   | 16 
  2 files changed, 19 deletions(-)

diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf
 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf
index 5aa95650f8ba..c5ab1a702167 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf
@@ -40,8 +40,5 @@ [Pcd]
  [Guids]
gEfiEventVirtualAddressChangeGuid
  
-[Protocols]

-  gEfiRealTimeClockArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
-
  [Depex]
TRUE
diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
index eeac011a9400..954589ecb328 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.c
@@ -1,30 +1,28 @@
  /** @file
Implement EFI RealTimeClock runtime services via RTC Lib.
  
Copyright (c) 2022, Loongson Limited. All rights reserved.
  
SPDX-License-Identifier: BSD-2-Clause-Patent
  
  **/
  
  #include 

  #include 
  
  #include 

  #include 
  
  #include 

  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
-#include 
  #include 
-#include 
  #include "LsRealTimeClock.h"
  
  STATIC BOOLEANmInitialized = FALSE;

@@ -291,46 +289,32 @@ EFIAPI
  LibRtcInitialize (
IN EFI_HANDLEImageHandle,
IN EFI_SYSTEM_TABLE  *SystemTable
)
  {
EFI_STATUSStatus;
-  EFI_HANDLEHandle;
  
InitRtc ();

Status = KvmtoolRtcMapMemory (ImageHandle, (mRtcBase & ~EFI_PAGE_MASK));
if (EFI_ERROR (Status)) {
  DEBUG ((
DEBUG_ERROR,
"Failed to map memory for loongson 7A RTC. Status = %r\n",
Status
));
  return Status;
}
  
-  // Setup the setters and getters

-  gRT->GetTime   = LibGetTime;
-  gRT->SetTime   = LibSetTime;
-
-  // Install the protocol
-  Handle = NULL;
-  Status = gBS->InstallMultipleProtocolInterfaces (
-  ,
-  ,  NULL,
-  NULL
- );
-  ASSERT_EFI_ERROR (Status);
-
//
// Register for the virtual address change event
//
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
VirtualNotifyEvent,
NULL,
,

);
ASSERT_EFI_ERROR (Status);
return Status;
  }









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