Date   

[PATCH 1/1] OvmfPkg/XenHypercallLib: Fix naming of AArch64

Anthony PERARD
 

From: Anthony PERARD <anthony.perard@...>

Fix path to follow naming convention of "AArch64", and allow the path
in "Maintainers.txt" to work as expected.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3982
Signed-off-by: Anthony PERARD <anthony.perard@...>
---
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Julien Grall <julien@...>
---
OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf | 2 +-
.../Library/XenHypercallLib/{Aarch64 => AArch64}/Hypercall.S | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename OvmfPkg/Library/XenHypercallLib/{Aarch64 => AArch64}/Hypercall.S (100%)

diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
index 32ae73f7aac5..edb77872391c 100644
--- a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
+++ b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
@@ -42,7 +42,7 @@ [Sources.ARM]
Arm/Hypercall.S

[Sources.AARCH64]
- Aarch64/Hypercall.S
+ AArch64/Hypercall.S

[Sources]
XenHypercall.c
diff --git a/OvmfPkg/Library/XenHypercallLib/Aarch64/Hypercall.S b/OvmfPkg/Library/XenHypercallLib/AArch64/Hypercall.S
similarity index 100%
rename from OvmfPkg/Library/XenHypercallLib/Aarch64/Hypercall.S
rename to OvmfPkg/Library/XenHypercallLib/AArch64/Hypercall.S
--
Anthony PERARD


[PATCH] BaseTools/VolInfo: Parse EFI_SECTION_FREEFORM_SUBTYPE_GUID header

Konstantin Aladyshev
 

Print 'SubtypeGuid' field from the EFI_FREEFORM_SUBTYPE_GUID_SECTION
structure.
This value describes the raw data inside the section.

Signed-off-by: Konstantin Aladyshev <aladyshev22@...>
---
BaseTools/Source/C/VolInfo/VolInfo.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolI=
nfo/VolInfo.c
index a78a7e7976..4628e756d7 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1806,12 +1806,20 @@ Returns:
break;=0D
=0D
case EFI_SECTION_COMPATIBILITY16:=0D
- case EFI_SECTION_FREEFORM_SUBTYPE_GUID:=0D
//=0D
// Section does not contain any further header information.=0D
//=0D
break;=0D
=0D
+ case EFI_SECTION_FREEFORM_SUBTYPE_GUID:=0D
+ printf (" Guid: ");=0D
+ if (SectionHeaderLen =3D=3D sizeof (EFI_COMMON_SECTION_HEADER))=0D
+ PrintGuid (&((EFI_FREEFORM_SUBTYPE_GUID_SECTION *)Ptr)->SubTypeGui=
d);=0D
+ else=0D
+ PrintGuid (&((EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *)Ptr)->SubTypeGu=
id);=0D
+ printf ("\n");=0D
+ break;=0D
+=0D
case EFI_SECTION_PEI_DEPEX:=0D
case EFI_SECTION_DXE_DEPEX:=0D
case EFI_SECTION_SMM_DEPEX:=0D
--=20
2.25.1


Re: [PATCH v1 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables

Sami Mujawar
 

Hi Kun,

Thank you for this patch.

I have some minor suggestions marked inline as [SAMI], otherwise this patch looks good to me.

With that updated.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar

On 19/07/2022 01:22 am, Kun Qin wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997

This change added an extra step to allow check for installed ACPI tables.

For FADT, MADT, GTDT, DSDT and DBG2 tables, either pre-installed or
supplied through AcpiTableInfo can be accepted.

An extra check for FADT ACPI table existence during installation step is
also added.

Cc: Sami Mujawar <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
---
DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 200 ++++++++++++++++----
DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 1 +
2 files changed, 167 insertions(+), 34 deletions(-)

diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
index ed62299f9bbd..ac5fe0bed91b 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
@@ -11,6 +11,7 @@
#include <Library/PcdLib.h>

#include <Library/UefiBootServicesTableLib.h>

#include <Protocol/AcpiTable.h>

+#include <Protocol/AcpiSystemDescriptionTable.h>
[SAMI] Can thie include statement above be alphabetically ordered, please?


// Module specific include files.

#include <AcpiTableGenerator.h>

@@ -387,6 +388,57 @@ BuildAndInstallAcpiTable (
return Status;

}


+/**

+ This function uses the ACPI SDT protocol to locate an ACPI table.

+ It is really only useful for finding tables that only have a single instance,

+ e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT, etc.

+

+ @param[in] Signature - Pointer to an ASCII string containing the OEM Table ID from the ACPI table header

+ @param[in, out] Table - Updated with a pointer to the table

+ @param[in, out] Handle - AcpiSupport protocol table handle for the table found

+

+ @retval EFI_SUCCESS - The function completed successfully.
[SAMI] Please add EFI_NOT_FOUND as a return type if an ACPI table with the requested signature is not found or if the ACPI SDT protocol is not installed.


+**/

+STATIC

+EFI_STATUS

+LocateAcpiTableBySignature (

+ IN UINT32 Signature,

+ IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table,

+ IN OUT UINTN *Handle

+ )

+{

+ EFI_STATUS Status;

+ INTN Index;

+ EFI_ACPI_TABLE_VERSION Version;

+ EFI_ACPI_SDT_PROTOCOL *AcpiSdt;

+

+ AcpiSdt = NULL;

+ Status = gBS->LocateProtocol (&gEfiAcpiSdtProtocolGuid, NULL, (VOID **)&AcpiSdt);

+

+ if (EFI_ERROR (Status) || (AcpiSdt == NULL)) {

+ return EFI_NOT_FOUND;

+ }

+

+ //

+ // Locate table with matching ID

+ //

+ Version = 0;

+ Index = 0;

+ do {

+ Status = AcpiSdt->GetAcpiTable (Index, (EFI_ACPI_SDT_HEADER **)Table, &Version, Handle);

+ if (EFI_ERROR (Status)) {

+ break;

+ }

+

+ Index++;

+ } while ((*Table)->Signature != Signature);

+

+ //

+ // If we found the table, there will be no error.

+ //

+ return Status;

+}

+

/** The function checks if the Configuration Manager has provided the

mandatory ACPI tables for installation.


@@ -411,6 +463,9 @@ VerifyMandatoryTablesArePresent (
BOOLEAN DsdtFound;

BOOLEAN Dbg2Found;

BOOLEAN SpcrFound;

+ UINTN Handle;

+

+ EFI_ACPI_DESCRIPTION_HEADER *DummyHeader;


Status = EFI_SUCCESS;

FadtFound = FALSE;

@@ -447,32 +502,99 @@ VerifyMandatoryTablesArePresent (
}


// We need at least the FADT, MADT, GTDT and the DSDT tables to boot

- if (!FadtFound) {

- DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found\n"));

+ // But they also might be published already, so we can search from there

+ Handle = 0;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status) && !FadtFound) {

+ DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found.\n"));

Status = EFI_NOT_FOUND;

+ } else if (!EFI_ERROR (Status) && FadtFound) {

+ DEBUG ((DEBUG_ERROR, "ERROR: FADT Table found while already published.\n"));

+ Status = EFI_ALREADY_STARTED;
[SAMI] Please update the function documentation header to reflect the EFI_ALREADY_STARTED error code.

+ } else {

+ FadtFound = TRUE;

}


- if (!MadtFound) {

+ Handle = 0;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status) && !MadtFound) {

DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found.\n"));

Status = EFI_NOT_FOUND;

+ } else if (!EFI_ERROR (Status) && MadtFound) {

+ DEBUG ((DEBUG_ERROR, "ERROR: MADT Table found while already published.\n"));

+ Status = EFI_ALREADY_STARTED;

+ } else {

+ MadtFound = TRUE;

}


- if (!GtdtFound) {

+ Handle = 0;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status) && !GtdtFound) {

DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found.\n"));

Status = EFI_NOT_FOUND;

+ } else if (!EFI_ERROR (Status) && GtdtFound) {

+ DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table found while already published.\n"));

+ Status = EFI_ALREADY_STARTED;

+ } else {

+ GtdtFound = TRUE;

}


- if (!DsdtFound) {

+ Handle = 0;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status) && !DsdtFound) {

DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found.\n"));

Status = EFI_NOT_FOUND;

+ } else if (!EFI_ERROR (Status) && DsdtFound) {

+ DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table found while already published.\n"));

+ Status = EFI_ALREADY_STARTED;

+ } else {

+ DsdtFound = TRUE;

}


- if (!Dbg2Found) {

+ Handle = 0;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status) && !Dbg2Found) {

DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not found.\n"));

+ } else if (!EFI_ERROR (Status) && Dbg2Found) {

+ DEBUG ((DEBUG_ERROR, "ERROR: DBG2 Table found while already published.\n"));

+ Status = EFI_ALREADY_STARTED;

+ } else {

+ Dbg2Found = TRUE;

}


- if (!SpcrFound) {

+ Handle = 0;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status) && !SpcrFound) {

DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not found.\n"));

+ } else if (!EFI_ERROR (Status) && SpcrFound) {

+ DEBUG ((DEBUG_ERROR, "ERROR: SPCR Table found while already published.\n"));

+ Status = EFI_ALREADY_STARTED;

+ } else {

+ SpcrFound = TRUE;

}


return Status;

@@ -500,11 +622,13 @@ ProcessAcpiTables (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol

)

{

- EFI_STATUS Status;

- EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;

- CM_STD_OBJ_ACPI_TABLE_INFO *AcpiTableInfo;

- UINT32 AcpiTableCount;

- UINT32 Idx;

+ EFI_STATUS Status;

+ EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;

+ CM_STD_OBJ_ACPI_TABLE_INFO *AcpiTableInfo;

+ UINT32 AcpiTableCount;

+ UINT32 Idx;

+ UINTN Handle;

+ EFI_ACPI_DESCRIPTION_HEADER *DummyHeader;


ASSERT (TableFactoryProtocol != NULL);

ASSERT (CfgMgrProtocol != NULL);

@@ -570,29 +694,37 @@ ProcessAcpiTables (
}
[snip]
  // Check if mandatory ACPI tables are present.
  Status = VerifyMandatoryTablesArePresent (
             AcpiTableInfo,
             AcpiTableCount
             );
  if (EFI_ERROR (Status)) {
    DEBUG ((
      DEBUG_ERROR,
      "ERROR: Failed to find mandatory ACPI Table(s)."
      " Status = %r\n",
      Status

      ));


[SAMI] Is it possible to update the error reporting to reflect the EFI_ALREADY_STARTED error type, please? Please also update the function documentation header for ProcessAcpiTables().


    return Status;

  }


[/snip]



// Add the FADT Table first.

- for (Idx = 0; Idx < AcpiTableCount; Idx++) {

- if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==

- AcpiTableInfo[Idx].TableGeneratorId)

- {

- Status = BuildAndInstallAcpiTable (

- TableFactoryProtocol,

- CfgMgrProtocol,

- AcpiTableProtocol,

- &AcpiTableInfo[Idx]

- );

- if (EFI_ERROR (Status)) {

- DEBUG ((

- DEBUG_ERROR,

- "ERROR: Failed to find build and install ACPI FADT Table." \

- " Status = %r\n",

- Status

- ));

- return Status;

+ Status = LocateAcpiTableBySignature (

+ EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,

+ &DummyHeader,

+ &Handle

+ );

+ if (EFI_ERROR (Status)) {

+ // FADT is not yet installed

+ for (Idx = 0; Idx < AcpiTableCount; Idx++) {

+ if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==

+ AcpiTableInfo[Idx].TableGeneratorId)

+ {

+ Status = BuildAndInstallAcpiTable (

+ TableFactoryProtocol,

+ CfgMgrProtocol,

+ AcpiTableProtocol,

+ &AcpiTableInfo[Idx]

+ );

+ if (EFI_ERROR (Status)) {

+ DEBUG ((

+ DEBUG_ERROR,

+ "ERROR: Failed to find build and install ACPI FADT Table." \

+ " Status = %r\n",

+ Status

+ ));

+ return Status;

+ }

+

+ break;

}

-

- break;

- }

- } // for

+ } // for

+ }


// Add remaining ACPI Tables

for (Idx = 0; Idx < AcpiTableCount; Idx++) {

diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
index 028c3d413cf8..5ca98c8b4895 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
@@ -36,6 +36,7 @@ [LibraryClasses]

[Protocols]

gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED

+ gEfiAcpiSdtProtocolGuid # PROTOCOL ALWAYS_CONSUMED
[SAMI] Should the DEPEX section be updated to relect the dependency on the SDT protocol?



gEdkiiConfigurationManagerProtocolGuid # PROTOCOL ALWAYS_CONSUMED

gEdkiiDynamicTableFactoryProtocolGuid # PROTOCOL ALWAYS_CONSUMED


Re: [PATCH v1 3/6] DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers

Sami Mujawar
 

Hi Kun,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar

On 19/07/2022 01:22 am, Kun Qin wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996

This change added more token fixers for other node types, including
NamedComponentNode, RootComplexNode, and SmmuV3Node.

The corresponding entries for tokenFixer functions table is also updated.

Cc: Sami Mujawar <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
---
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | 78 +++++++++++++++++++-
1 file changed, 75 insertions(+), 3 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 84e4bb7e3bc8..345acab53f74 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -64,6 +64,78 @@ TokenFixerItsGroup (
return EFI_SUCCESS;

}


+/** EArmObjNamedComponent token fixer.

+

+ CmObjectToken fixer function that updates the Tokens in the CmObjects.

+

+ @param [in] CmObject Pointer to the Configuration Manager Object.

+ @param [in] Token Token to be updated in the CmObject.

+

+ @retval EFI_SUCCESS Success.

+ @retval EFI_INVALID_PARAMETER A parameter is invalid.

+ @retval EFI_UNSUPPORTED Not supported.

+**/

+STATIC

+EFI_STATUS

+EFIAPI

+TokenFixerNamedComponentNode (

+ IN CM_OBJ_DESCRIPTOR *CmObject,

+ IN CM_OBJECT_TOKEN Token

+ )

+{

+ ASSERT (CmObject != NULL);

+ ((CM_ARM_NAMED_COMPONENT_NODE *)CmObject->Data)->Token = Token;

+ return EFI_SUCCESS;

+}

+

+/** EArmObjRootComplex token fixer.

+

+ CmObjectToken fixer function that updates the Tokens in the CmObjects.

+

+ @param [in] CmObject Pointer to the Configuration Manager Object.

+ @param [in] Token Token to be updated in the CmObject.

+

+ @retval EFI_SUCCESS Success.

+ @retval EFI_INVALID_PARAMETER A parameter is invalid.

+ @retval EFI_UNSUPPORTED Not supported.

+**/

+STATIC

+EFI_STATUS

+EFIAPI

+TokenFixerRootComplexNode (

+ IN CM_OBJ_DESCRIPTOR *CmObject,

+ IN CM_OBJECT_TOKEN Token

+ )

+{

+ ASSERT (CmObject != NULL);

+ ((CM_ARM_ROOT_COMPLEX_NODE *)CmObject->Data)->Token = Token;

+ return EFI_SUCCESS;

+}

+

+/** EArmObjSmmuV3 token fixer.

+

+ CmObjectToken fixer function that updates the Tokens in the CmObjects.

+

+ @param [in] CmObject Pointer to the Configuration Manager Object.

+ @param [in] Token Token to be updated in the CmObject.

+

+ @retval EFI_SUCCESS Success.

+ @retval EFI_INVALID_PARAMETER A parameter is invalid.

+ @retval EFI_UNSUPPORTED Not supported.

+**/

+STATIC

+EFI_STATUS

+EFIAPI

+TokenFixerSmmuV3Node (

+ IN CM_OBJ_DESCRIPTOR *CmObject,

+ IN CM_OBJECT_TOKEN Token

+ )

+{

+ ASSERT (CmObject != NULL);

+ ((CM_ARM_SMMUV3_NODE *)CmObject->Data)->Token = Token;

+ return EFI_SUCCESS;

+}

+

/** TokenFixer functions table.


A CmObj having a CM_OBJECT_TOKEN field might need to have its

@@ -90,10 +162,10 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] = {
NULL, ///< 16 - Hypervisor Vendor Id

NULL, ///< 17 - Fixed feature flags for FADT

TokenFixerItsGroup, ///< 18 - ITS Group

- TokenFixerNotImplemented, ///< 19 - Named Component

- TokenFixerNotImplemented, ///< 20 - Root Complex

+ TokenFixerNamedComponentNode, ///< 19 - Named Component

+ TokenFixerRootComplexNode, ///< 20 - Root Complex

TokenFixerNotImplemented, ///< 21 - SMMUv1 or SMMUv2

- TokenFixerNotImplemented, ///< 22 - SMMUv3

+ TokenFixerSmmuV3Node, ///< 22 - SMMUv3

TokenFixerNotImplemented, ///< 23 - PMCG

NULL, ///< 24 - GIC ITS Identifier Array

NULL, ///< 25 - ID Mapping Array


Re: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation

Ni, Ray
 

Reviewed-by: Ray Ni <ray.ni@...>

-----Original Message-----
From: Shindo, Miki <miki.shindo@...>
Sent: Wednesday, July 20, 2022 4:28 AM
To: devel@edk2.groups.io
Cc: Andrew Fish <afish@...>; Ni, Ray <ray.ni@...>
Subject: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory
allocation

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

This commit adds NULL check on memory allocation of the size
for FileName in ASCII string format at PosixFileSetInfo().

Signed-off-by: Miki Shindo <miki.shindo@...>
Cc: Andrew Fish <afish@...>
Cc: Ray Ni <ray.ni@...>
---
EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c
b/EmulatorPkg/Unix/Host/PosixFileSystem.c
index ae3fe72a05..b69d3d5520 100644
--- a/EmulatorPkg/Unix/Host/PosixFileSystem.c
+++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c
@@ -1187,7 +1187,7 @@ PosixFileSetInfo (
}



OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));

- if (OldFileInfo == NULL) {

+ if (OldFileName == NULL) {

goto Done;

}



--
2.27.0.windows.1


Re: [PATCH v1 2/6] DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing

Sami Mujawar
 

Hi Kun,

Thank you for this fix.

This patch looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar

On 19/07/2022 01:22 am, Kun Qin wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996

The content of token should be derived from the data section of the
`CmObject` instead of the object itself.

This change fixed the issue by dereferencing the token value from the
data buffer of input CmObject.

Cc: Sami Mujawar <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
---
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 80d0aa17bc1a..84e4bb7e3bc8 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -60,7 +60,7 @@ TokenFixerItsGroup (
)

{

ASSERT (CmObject != NULL);

- ((CM_ARM_ITS_GROUP_NODE *)CmObject)->Token = Token;

+ ((CM_ARM_ITS_GROUP_NODE *)CmObject->Data)->Token = Token;

return EFI_SUCCESS;

}


Re: [PATCH v1 1/6] DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to inf

Sami Mujawar
 

Hi Kun,

Thank you for this patch.

This change looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar

On 19/07/2022 01:22 am, Kun Qin wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996

The DynamicPlatRepoLib has multiple reference to MemoryAllocationLib,
such as DynamicPlatRepo.c and TokenMapper.c. Not including it in the
library inf file could lead to potential build break.

This change added the MemoryAllocationLib into this inf file.

Cc: Sami Mujawar <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
---
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf | 1 +
1 file changed, 1 insertion(+)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf
index 9a3cc87fd91d..8423352550c2 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf
@@ -31,3 +31,4 @@ [Packages]
[LibraryClasses]

AcpiHelperLib

BaseLib

+ MemoryAllocationLib


[PATCH 2/2] UefiPayloadPkg: Load Boot Logo into ACPI table

Sean Rhodes
 

This will allow the OS to display the logo whilst booting.

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Signed-off-by: Sean Rhodes <sean@...>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++++++
UefiPayloadPkg/UefiPayloadPkg.fdf | 2 ++
2 files changed, 8 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload=
Pkg.dsc
index bdafe8ae99..f9459f24f8 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -287,6 +287,10 @@
VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf=0D
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor=
tStatusCodeLib.inf=0D
=0D
+[LibraryClasses.common]=0D
+ SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf=0D
+ BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.i=
nf=0D
+=0D
[LibraryClasses.common.SEC]=0D
HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf=0D
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf=0D
@@ -656,6 +660,8 @@
# ACPI Support=0D
#=0D
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf=0D
+ MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf=0D
+ MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes=
ourceTableDxe.inf=0D
=0D
#=0D
# PCI Support=0D
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload=
Pkg.fdf
index 6d54bb0e13..e6970fceae 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -243,6 +243,8 @@ INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
# ACPI Support=0D
#=0D
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf=0D
+INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf=0D
+INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics=
ResourceTableDxe.inf=0D
=0D
#=0D
# UEFI network modules=0D
--=20
2.34.1


[PATCH 1/2] UefiPayloadPkg: Enable Boot Logo

Sean Rhodes
 

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Signed-off-by: Sean Rhodes <sean@...>
---
.../Library/PlatformBootManagerLib/PlatformBootManager.c | 5 +++++
.../PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 +
UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++++++
UefiPayloadPkg/UefiPayloadPkg.fdf | 4 ++++
4 files changed, 16 insertions(+)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana=
ger.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index b360e29dfe..2fadd3f130 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -252,6 +252,11 @@ PlatformBootManagerAfterConsole (
Black.Blue =3D Black.Green =3D Black.Red =3D Black.Reserved =3D 0;=0D
White.Blue =3D White.Green =3D White.Red =3D White.Reserved =3D 0xFF;=0D
=0D
+ if (&gEdkiiPlatformLogoProtocolGuid) {=0D
+ gST->ConOut->ClearScreen (gST->ConOut);=0D
+ BootLogoEnableLogo ();=0D
+ }=0D
+=0D
EfiBootManagerConnectAll ();=0D
EfiBootManagerRefreshAllBootOption ();=0D
=0D
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana=
gerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana=
gerLib.inf
index 9f58c460cd..7ec93420f2 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.=
inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.=
inf
@@ -39,6 +39,7 @@
UefiRuntimeServicesTableLib=0D
UefiLib=0D
UefiBootManagerLib=0D
+ BootLogoLib=0D
PcdLib=0D
DxeServicesLib=0D
MemoryAllocationLib=0D
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload=
Pkg.dsc
index 5e947526b7..bdafe8ae99 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -40,6 +40,7 @@
DEFINE SD_ENABLE =3D TRUE=0D
DEFINE PS2_MOUSE_ENABLE =3D TRUE=0D
DEFINE SD_MMC_TIMEOUT =3D 1000000=0D
+ DEFINE BOOTSPLASH_IMAGE =3D FALSE=0D
=0D
#=0D
# NULL: NullMemoryTestDxe=0D
@@ -221,6 +222,7 @@
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf=
=0D
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS=
ecurityManagementLib.inf=0D
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag=
erLib.inf=0D
+ BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf=0D
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize=
dDisplayLib.inf=0D
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltL=
ib.inf=0D
=0D
@@ -419,6 +421,7 @@
=0D
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_=
MEMORY)=0D
gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE=
)=0D
+=0D
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1800000=0D
=0D
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Fami=
ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D
@@ -593,6 +596,9 @@
!endif=0D
UefiCpuPkg/CpuDxe/CpuDxe.inf=0D
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf=0D
+!if $(BOOTSPLASH_IMAGE)=0D
+ MdeModulePkg/Logo/LogoDxe.inf=0D
+!endif=0D
MdeModulePkg/Application/UiApp/UiApp.inf {=0D
<LibraryClasses>=0D
NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf=
=0D
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload=
Pkg.fdf
index 5c055e61b3..6d54bb0e13 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -163,6 +163,10 @@ INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
INF UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf=0D
=0D
INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf=0D
+!if $(BOOTSPLASH_IMAGE)=0D
+INF MdeModulePkg/Logo/LogoDxe.inf=0D
+!endif=0D
+=0D
#=0D
# PCI Support=0D
#=0D
--=20
2.34.1


[PATCH v1-resend 1/1] ShellPkg: Add revision check for DSDT Header on Arm

Edward Pickup <edward.pickup@...>
 

Bugzilla: 3995 (https://bugzilla.tianocore.org/show_bug.cgi?id=3995)

ACPI 6.4 spec states that if the revision field in the DSDT header is less
than 2, then all integers are restricted in width to 32 bits, including in
SSDTs.

Arm Base boot requirements state that platforms must conform to ACPI 6.3
or later, and that legacy tables are not supported.

Adds a check for this field and raise warning if revision is less
than 2 on arm.

Signed-off-by: Edward Pickup <edward.pickup@...>
---

The changes can be seen at https://github.com/edpickup/edk2/tree/2073_add_DSDT_revision_check_v1_resend

Notes:
v1:
- Resending with rebase and bugzilla id
- No code changes since previous submit.
Ref: https://edk2.groups.io/g/devel/message/89378

ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c
index e75e4622239ed03b171adc92d32b5eeb75a8edef..7f30a8409bb711d4edf77ed04319c628ef8aea73 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c
@@ -1,7 +1,7 @@
/** @file
DSDT table parser

- Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2022, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

@par Reference(s):
@@ -39,4 +39,20 @@ ParseAcpiDsdt (
}

DumpAcpiHeader (Ptr);
+
+ // As per 19.6.29 in the version 6.4 of the ACPI spec, a revision less than 2
+ // restricts integers to 32 bit width. This may not be intended, raise a
+ // warning
+ #if defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
+ if (AcpiTableRevision < 2) {
+ IncrementWarningCount ();
+ Print (
+ L"WARNING: DSDT Table Revision less than 2. Integer width restricted to "
+ L"32 bits. Table Revision = %d.\n",
+ AcpiTableRevision
+ );
+ return;
+ }
+
+ #endif
}
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")


Re: [PATCH V2 3/8] EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib

Min Xu
 

Hi, Leif/Ard/Abner/Daniel
Since you're maintainers/reviewers of EmbeddedPkg. Do you have any comments to this patch?

Thanks
Min

-----Original Message-----
From: Xu, Min M <min.m.xu@...>
Sent: Sunday, June 26, 2022 11:06 AM
To: devel@edk2.groups.io
Cc: Xu, Min M <min.m.xu@...>; Leif Lindholm
<quic_llindhol@...>; Ard Biesheuvel <ardb+tianocore@...>;
Chang, Abner <abner.chang@...>; Schaefer, Daniel
<daniel.schaefer@...>; Gerd Hoffmann <kraxel@...>
Subject: [PATCH V2 3/8] EmbeddedPkg: Add AllocateRuntimePages in
PrePiMemoryAllocationLib

From: Min M Xu <min.m.xu@...>

AllocateRuntimePages is used to allocate one or more 4KB pages of type
EfiRuntimeServicesData.

Cc: Leif Lindholm <quic_llindhol@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Abner Chang <abner.chang@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
Cc: Gerd Hoffmann <kraxel@...>
Signed-off-by: Min Xu <min.m.xu@...>
---
EmbeddedPkg/Include/Library/PrePiLib.h | 19 ++++++
.../MemoryAllocationLib.c | 64 ++++++++++++++-----
2 files changed, 67 insertions(+), 16 deletions(-)

diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h
b/EmbeddedPkg/Include/Library/PrePiLib.h
index 7b2cea296f1c..3741b08c4478 100644
--- a/EmbeddedPkg/Include/Library/PrePiLib.h
+++ b/EmbeddedPkg/Include/Library/PrePiLib.h
@@ -665,6 +665,25 @@ AllocatePages (
IN UINTN Pages
);

+/**
+ Allocates one or more 4KB pages of type EfiRuntimeServicesData.
+
+ Allocates the number of 4KB pages of type EfiRuntimeServicesData and
+ returns a pointer to the allocated buffer. The buffer returned is
+ aligned on a 4KB boundary. If Pages is 0, then NULL is returned. If
+ there is not enough memory remaining to satisfy the request, then NULL is
returned.
+
+ @param Pages The number of 4 KB pages to allocate.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocateRuntimePages (
+ IN UINTN Pages
+ );
+
/**
Allocates a buffer of type EfiBootServicesData.

diff --git
a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
index 78f8da5e9527..9d7b34ad28fa 100644
---
a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
+++
b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
@@ -14,23 +14,11 @@
#include <Library/PrePiLib.h>
#include <Library/DebugLib.h>

-/**
- Allocates one or more 4KB pages of type EfiBootServicesData.
-
- Allocates the number of 4KB pages of MemoryType and returns a pointer
to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If
Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the
request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
VOID *
EFIAPI
-AllocatePages (
- IN UINTN Pages
+InternalAllocatePages (
+ IN UINTN Pages,
+ IN EFI_MEMORY_TYPE MemoryType
)
{
EFI_PEI_HOB_POINTERS Hob;
@@ -65,12 +53,56 @@ AllocatePages (
BuildMemoryAllocationHob (
Hob.HandoffInformationTable->EfiFreeMemoryTop,
Pages * EFI_PAGE_SIZE,
- EfiBootServicesData
+ MemoryType
);
return (VOID *)(UINTN)Hob.HandoffInformationTable-
EfiFreeMemoryTop;
}
}

+/**
+ Allocates one or more 4KB pages of type EfiBootServicesData.
+
+ Allocates the number of 4KB pages of MemoryType and returns a pointer
+ to the allocated buffer. The buffer returned is aligned on a 4KB
+ boundary. If Pages is 0, then NULL is returned. If there is not
+ enough memory remaining to satisfy the request, then NULL is returned.
+
+ @param Pages The number of 4 KB pages to allocate.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocatePages (
+ IN UINTN Pages
+ )
+{
+ return InternalAllocatePages (Pages, EfiBootServicesData); }
+
+/**
+ Allocates one or more 4KB pages of type EfiRuntimeServicesData.
+
+ Allocates the number of 4KB pages of type EfiRuntimeServicesData and
+ returns a pointer to the allocated buffer. The buffer returned is
+ aligned on a 4KB boundary. If Pages is 0, then NULL is returned. If
+ there is not enough memory remaining to satisfy the request, then NULL is
returned.
+
+ @param Pages The number of 4 KB pages to allocate.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocateRuntimePages (
+ IN UINTN Pages
+ )
+{
+ return InternalAllocatePages (Pages, EfiRuntimeServicesData); }
+
/**
Allocates one or more 4KB pages of type EfiBootServicesData at a specified
alignment.

--
2.29.2.windows.2


Re: [PATCH V4 0/8] Enable secure-boot when lauch OVMF with -bios parameter

Gerd Hoffmann
 

On Wed, Jul 20, 2022 at 06:38:32AM +0000, Xu, Min M wrote:
Hi, Gerd
Do you have any comments to this patch-set?
With this in place it should be possible to allow secure boot builds for
AmdSev and Microvm, that is something I plan to try for additional
verification. Havn't found the time to to so, and most likely wouldn't
before my summer vacation (starting next week and ending after soft
freeze). Have to drop that ball I guess ...

From looking at the code this all looks sane.

Acked-by: Gerd Hoffmann <kraxel@...>

take care,
Gerd


Re: [PATCH v3 0/3] DynamicTablesPkg: Pcie generation updates

Sami Mujawar
 

Merged as f0064ac3afa2..19a87683654a

Thanks.

Regards,

Sami Mujawar


How to handle USBIO operation during FmpDxe update capsule flow?

gordontcp@...
 

Hi all,
According to the instructions of edk2-platforms, I can build MinnowMax.cap and CapsuleApp.efi.
Build command: build -a IA32 -a X64 -n 5 -t VS2019 -b DEBUG -p Vlv2TbltDevicePkg\PlatformPkgX64.dsc
reference:
https://github.com/tianocore/edk2-platforms/tree/master/Platform/Intel/Vlv2TbltDevicePkg
My system: MinnowMax board.
I can update capsule data to MinnowMax SPI flash with the following command:
Shell command: CapsuleApp MinnowMax.cap
But when I try to write data to an external USB device, I get an error. My modifications are as follows:
\edk2-platforms\Platform\Intel\Vlv2TbltDevicePkg\Feature\Capsule\Library\PlatformFlashAccessLib\PlatformFlashAccessLib.c

EFI_STATUS
EFIAPI
PerformFlashAccessLibConstructor (
VOID
)
{
EFI_STATUS Status;
Status = gBS->LocateProtocol(
&gEfiUsbIoProtocolGuid,
NULL,
(VOID**)&gUsbIOWDT
);
if (EFI_ERROR(Status)) return Status; //unsupport
return Status;
}

The error message is Status : EFI_NOT_FOUND.
Among them, PerformFlashAccessLibConstructor is executed in the FmpDxe(Minnow) driver, and it refers to the following method of Vlv2TbltDevicePkg:

Status = gBS->LocateProtocol (
&gEfiSpiProtocolGuid,
NULL,
(VOID **) &mSpiProtocol
);

My questions are:

  1. How to handle USBIO operation during FmpDxe update capsule flow? Is there any sample code?
  2. In FmpDxe, you can pass the gEfiSpiProtocolGuid parameter in the LocateProtocol function to get the handle. Why does passing gEfiUsbIoProtocolGuid cause an error? How should it be modified?
  Any advice is greatly appreciated!
Thanks!


Re: [PATCH] UefiPayloadPkg: Fix RelaAddress type always mismatch in if condition

Lu, James
 

Hi Ray,

Any comment on this patch?


Thanks,
James

-----Original Message-----
From: Lu, James <james.lu@...>
Sent: Monday, July 11, 2022 1:06 PM
To: devel@edk2.groups.io
Cc: Lu, James <james.lu@...>; Ni, Ray <ray.ni@...>; Dong, Guo <guo.dong@...>; Guo, Gua <gua.guo@...>
Subject: [PATCH] UefiPayloadPkg: Fix RelaAddress type always mismatch in if condition

From: James Lu <james.lu@...>

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

Under function RolocateElfDynamic() in Elf32Lib.c if (RelaAddress == MAX_UINT64) is always FALSE while RelaAddress is UINT32 Fix is to modify if condition check to "if (RelaAddress == MAX_UINT32)"

Cc: Ray Ni <ray.ni@...>
Cc: Guo Dong <guo.dong@...>
Cc: Gua Guo <gua.guo@...>
Signed-off-by: James Lu <james.lu@...>
---
UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
index b002c4b9cf..cb915e7142 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
@@ -292,7 +292,7 @@ RelocateElf32Dynamic (
} } - if (RelaAddress == MAX_UINT64) {+ if (RelaAddress == MAX_UINT32) { ASSERT (RelaCount == 0); ASSERT (RelaEntrySize == 0); ASSERT (RelaSize == 0);--
2.26.2.windows.1


Re: [PATCH V4 0/8] Enable secure-boot when lauch OVMF with -bios parameter

Min Xu
 

Hi, Gerd
Do you have any comments to this patch-set?

Thanks Min

-----Original Message-----
From: Xu, Min M <min.m.xu@...>
Sent: Friday, July 1, 2022 7:29 AM
To: devel@edk2.groups.io
Cc: Xu, Min M <min.m.xu@...>; Leif Lindholm
<quic_llindhol@...>; Ard Biesheuvel <ardb+tianocore@...>;
Chang, Abner <abner.chang@...>; Schaefer, Daniel
<daniel.schaefer@...>; Aktas, Erdem <erdemaktas@...>;
James Bottomley <jejb@...>; Yao, Jiewen
<jiewen.yao@...>; Tom Lendacky <thomas.lendacky@...>;
Gerd Hoffmann <kraxel@...>
Subject: [PATCH V4 0/8] Enable secure-boot when lauch OVMF with -bios
parameter

Secure-Boot related variables include the PK/KEK/DB/DBX and they are
stored in NvVarStore (OVMF_VARS.fd). When lauching with -pflash,
QEMU/OVMF will use emulated flash, and fully support UEFI variables.
But when launching with -bios parameter, UEFI variables will be partially
emulated, and non-volatile variables may lose their contents after a reboot.
See OvmfPkg/README.

Tdx guest is an example that -pflash is not supported. So this patch-set is
designed to initialize the NvVarStore with the content of in OVMF_VARS.fd.

patch 1:
Add a new function (AllocateRuntimePages) in PrePiMemoryAllocationLib.
This function will be used in PeilessStartupLib which will run in SEC phase.

patch 2:
Delete the TdxValidateCfv in PeilessStartupLib. Because it is going to be
renamed to PlatformValidateNvVarStore and be moved to PlatformInitLib.

patch 3 - 7:
Then we add functions for EmuVariableNvStore in PlatformInitLib. This lib
will then be called in OvmfPkg/PlatformPei and PeilessStartupLib.
We also shortcut ConnectNvVarsToFileSystem in secure-boot.

patch 8:
At last a build-flag (SECURE_BOOT_FEATURE_ENABLED) is introduced in the
dsc in OvmfPkg. Because the copy over of OVMR_VARS.fd to
EmuVariableNvStore is only required when secure-boot is enabled.

Code: https://github.com/mxu9/edk2/tree/secure-boot.v4

v4 chagnes:
- "EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib"
is
missed in v3. It is added in this version.
- No other changes.

v3 changes:
- Renamed TdxValidateCfv to PlatformValidateNvVarStore and implemented
in PlatformInitlLib/Platform.c.
- Shortcut ConnectNvVarsToFileSystem in secure-boot.
- Other minor changes, such as adding log in
PlatformInitEmuVariableNvStore.

v2 changes:
- The v1 title is "Enable Secure-Boot in Tdx guest". Because the
patch-setwe was first designed to fix the gap when secure-boot feature
was enabled in Tdx guest. After discussing with the community (see
the disuccsions under https://edk2.groups.io/g/devel/message/90589)
this patch-set can fix the secure-boot issue when OVMF is lauched
with -bios parameter. So the title is updated.
- Add a new function (AllocateRuntimePages) in PrePiMemoryAllocationLib.
- Add build-flag SECURE_BOOT_FEATURE_ENABLED to control the copy over
of OVMF_VARS.fd to EmuVariableNvStore.

Cc: Leif Lindholm <quic_llindhol@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Abner Chang <abner.chang@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: James Bottomley <jejb@...> [jejb]
Cc: Jiewen Yao <jiewen.yao@...> [jyao1]
Cc: Tom Lendacky <thomas.lendacky@...> [tlendacky]
Cc: Gerd Hoffmann <kraxel@...>
Signed-off-by: Min Xu <min.m.xu@...>

Min M Xu (8):
EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib
OvmfPkg/PeilessStartupLib: Delete TdxValidateCfv
OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore
OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore
OvmfPkg: Reserve and init EmuVariableNvStore in Pei-less Startup
OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in
secure-boot
OvmfPkg/TdxDxe: Set PcdEmuVariableNvStoreReserved
OvmfPkg: Add build-flag SECURE_BOOT_FEATURE_ENABLED

EmbeddedPkg/Include/Library/PrePiLib.h | 19 ++
.../MemoryAllocationLib.c | 64 +++--
OvmfPkg/CloudHv/CloudHvX64.dsc | 9 +
OvmfPkg/Include/Library/PlatformInitLib.h | 51 ++++
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 9 +
OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c | 7 +
OvmfPkg/Library/PeilessStartupLib/IntelTdx.c | 153 -----------
.../PeilessStartupLib/PeilessStartup.c | 15 +-
.../PeilessStartupInternal.h | 17 --
OvmfPkg/Library/PlatformInitLib/Platform.c | 238 ++++++++++++++++++
.../PlatformInitLib/PlatformInitLib.inf | 3 +
OvmfPkg/OvmfPkgIa32.dsc | 9 +
OvmfPkg/OvmfPkgIa32X64.dsc | 9 +
OvmfPkg/OvmfPkgX64.dsc | 9 +
OvmfPkg/PlatformPei/Platform.c | 25 +-
OvmfPkg/TdxDxe/TdxDxe.c | 2 +
OvmfPkg/TdxDxe/TdxDxe.inf | 1 +
17 files changed, 428 insertions(+), 212 deletions(-)

--
2.29.2.windows.2


Re: [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch are not working with I2C touch panel

Dandan Bi
 

Reviewed-by: Dandan Bi <dandan.bi@...>

-----Original Message-----
From: Thangaraj, KalaiyarasanX <kalaiyarasanx.thangaraj@...>
Sent: Tuesday, July 19, 2022 5:23 PM
To: devel@edk2.groups.io
Cc: Thangaraj, KalaiyarasanX <kalaiyarasanx.thangaraj@...>; Bi, Dandan <dandan.bi@...>; Gao, Liming <gaoliming@...>; Pethaiyan, Madhan <madhan.pethaiyan@...>; Esakkithevar, Kathappan <kathappan.esakkithevar@...>; Balaji, Madhusudhan <madhusudhan.balaji@...>
Subject: [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch are not working with I2C touch panel

Vktimer event Task Priority Level changed to TPL_CALLBACK from TPL_NOTIFY to fix Virtual Keyboard touch slowness issues and touch not working issues

Cc: Dandan Bi <dandan.bi@...>
Cc: Liming Gao <gaoliming@...>
Cc: Madhan Pethaiyan <madhan.pethaiyan@...>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@...>
Cc: Madhusudhan Balaji <madhusudhan.balaji@...>
Signed-off-by: KalaiyarasanX Thangaraj <kalaiyarasanx.thangaraj@...>
---
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c
index 84c3a06f68..2b1216746b 100644
--- a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c
+++ b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyb
+++ oardDxe/Keyboard.c
@@ -759,7 +759,7 @@ VkApiStart (

Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL,
- TPL_VK_SYNC,
+ TPL_CALLBACK,
VkTimer,
(VOID *)VkContext,
&(VkContext->TimerEvent)
--
2.26.2.windows.1


Event: TianoCore Bug Triage - APAC / NAMO - 07/19/2022 #cal-reminder

Group Notification <noreply@...>
 

Reminder: TianoCore Bug Triage - APAC / NAMO

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

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

Organizer: Liming Gao gaoliming@...

View Event

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

Join with a video conferencing device

teams@...

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,77463821#   United States, Sacramento

Phone Conference ID: 774 638 21#

Find a local number | Reset PIN

Learn More | Meeting options


Re: [Patch V2 1/1] BaseTools: remove directly calling for gcc command

Ni, Ray
 

Does every cc support dumpversion?

thanks,
ray

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Yuwei Chen <yuwei.chen@...>
Sent: Wednesday, July 20, 2022 8:21:45 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Feng, Bob C <bob.c.feng@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel] [Patch V2 1/1] BaseTools: remove directly calling for gcc command
 
In some environment, the directly calling for gcc is not supported.
This patch fixes the issue.

Cc: Bob Feng <bob.c.feng@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Yuwei Chen <yuwei.chen@...>
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
old mode 100644
new mode 100755
index c217674345b1..5944e80bd2b4
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,12 +13,15 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
-GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+GCCVERSION=0
+ifneq ($(CXX), gcc)
+  GCCVERSION = $(shell $(CXX) -dumpversion | awk -F'.' '{print $$1}')
+endif
 ifneq ("$(GCCVERSION)", "5")
-ifneq ($(CXX), llvm)
-# gcc 12 trips over device path handling
-BUILD_CFLAGS += -Wno-error=stringop-overflow
-endif
+  ifneq ($(CXX), llvm)
+    # gcc 12 trips over device path handling
+    BUILD_CFLAGS += -Wno-error=stringop-overflow
+  endif
 endif
 
 LIBS = -lCommon
--
2.27.0.windows.1







Re: [edk2-platforms][PATCH V2 1/1] MinPlatformPkg: Add missing FV PCD

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Monday, July 18, 2022 5:15 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Chiu, Chasel <chasel.chiu@...>; Desimone, Nathaniel L <nathaniel.l.desimone@...>; Dong, Eric <eric.dong@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel][edk2-platforms][PATCH V2 1/1] MinPlatformPkg: Add missing FV PCD

Add missing PCD for BSP FV Base/Size/Offsets.

Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Eric Dong <eric.dong@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 68ab1d702d..76da6f35ae 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -230,9 +230,17 @@
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase|0x00000000|UINT32|0x20000004
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize|0x00000000|UINT32|0x20000005
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset|0x00000000|UINT32|0x20000006
+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemorySize|0x00000000|UINT32|0x20000030
+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemoryBase|0x00000000|UINT32|0x20000031
+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemoryOffset|0x00000000|UINT32|0x20000032
+
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase|0x00000000|UINT32|0x20000007
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize|0x00000000|UINT32|0x20000008
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset|0x00000000|UINT32|0x20000009
+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspSize|0x00000000|UINT32|0x20000033
+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspBase|0x00000000|UINT32|0x20000034
+ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspOffset|0x00000000|UINT32|0x20000035
+
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase|0x00000000|UINT32|0x2000000A
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize|0x00000000|UINT32|0x2000000B
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset|0x00000000|UINT32|0x2000000C
--
2.36.1.windows.1