From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.342.1659107473326075964 for ; Fri, 29 Jul 2022 08:11:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6430B1063; Fri, 29 Jul 2022 08:11:13 -0700 (PDT) Received: from [10.57.43.151] (unknown [10.57.43.151]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 489A43F73B; Fri, 29 Jul 2022 08:11:11 -0700 (PDT) Message-ID: Date: Fri, 29 Jul 2022 17:11:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2-devel] [PATCH v2 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables To: Kun Qin , devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov , Joe Lopez References: <20220728043147.395-1-kuqin12@gmail.com> <20220728043147.395-5-kuqin12@gmail.com> <1102c58a-1424-4e5f-476b-3866137382a3@arm.com> <2076e6af-3464-d0ad-abc8-3408d251e09a@gmail.com> From: "PierreGondois" In-Reply-To: <2076e6af-3464-d0ad-abc8-3408d251e09a@gmail.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 7/29/22 07:00, Kun Qin wrote: > Hi Pierre, >=20 > Thank you for your feedback. I will add more document/comments to the > newly define structure, as > well as the "break" as you suggested. >=20 > As per failure to locate "gEfiAcpiSdtProtocolGuid", my thought was that > this protocol could be enabled > per platform through > "gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol". So I did no= t > treat > the failure as a hard requirement (for the same reason, I did not add i= t > to the module Depex). Please let > me know whether you think this makes sense. Otherwise, I could replace > the "goto" logic with a check > for the same PCD and only conduct the routine if ACPI_SDT is expected. >=20 Ok yes, this is a good idea, Regards, Pierre > Please also let me know if you have other suggestions. >=20 > Thanks, > Kun >=20 > On 7/28/2022 6:07 AM, Pierre Gondois wrote: >> Hello Kun, >> With the changes below: >> Reviewed-by: Pierre Gondois >> >> Thanks! >> >> On 7/28/22 06:31, Kun Qin via groups.io wrote: >>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3997 >>> >>> This change added an extra step to allow check for installed ACPI >>> tables. >>> >>> For FADT, MADT, GTDT, DSDT, DBG2 and SPCR 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 >>> Cc: Alexei Fedorov >>> >>> Co-authored-by: Joe Lopez >>> Signed-off-by: Kun Qin >>> --- >>> >>> Notes: >>> =C2=A0=C2=A0=C2=A0=C2=A0 v2: >>> =C2=A0=C2=A0=C2=A0=C2=A0 - Function description updates [Sami] >>> =C2=A0=C2=A0=C2=A0=C2=A0 - Refactorized the table verification [Pier= re] >>> >>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.c >>> | 182 +++++++++++--------- >>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.inf >>> |=C2=A0=C2=A0 1 + >>> =C2=A0 2 files changed, 103 insertions(+), 80 deletions(-) >>> >>> diff --git >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.c >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.c >>> >>> index ed62299f9bbd..4ad7c0c8dbfa 100644 >>> --- >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.c >>> +++ >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.c >>> @@ -10,6 +10,7 @@ >>> =C2=A0 #include >>> =C2=A0 #include >>> =C2=A0 #include >>> +#include >>> =C2=A0 #include >>> =C2=A0 =C2=A0 // Module specific include files. >>> @@ -22,6 +23,29 @@ >>> =C2=A0 #include >>> =C2=A0 #include >>> =C2=A0 +#define ACPI_TABLE_PRESENT_INFO_LIST=C2=A0 BIT0 >>> +#define ACPI_TABLE_PRESENT_INSTALLED=C2=A0 BIT1 >>> + >>> +#define ACPI_TABLE_VERIFY_FADT=C2=A0=C2=A0 0 >>> +#define ACPI_TABLE_VERIFY_COUNT=C2=A0 6 >>> + >>> +typedef struct { >>> +=C2=A0 ESTD_ACPI_TABLE_ID=C2=A0=C2=A0=C2=A0 EstdTableId; >>> +=C2=A0 UINT32=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AcpiTableSignature; >>> +=C2=A0 CHAR8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AcpiTableName[sizeof (UINT32) + 1= ]; >>> +=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 IsMandatory; >>> +=C2=A0 UINT16=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Presence; >>> +} ACPI_TABLE_PRESENCE_INFO; >> >> I think it needs some documentation (also for mAcpiVerifyTables). >> >>> + >>> +ACPI_TABLE_PRESENCE_INFO mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] = =3D { >>> +=C2=A0 { EStdAcpiTableIdFadt, >>> EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, "FADT", TRUE,=C2= =A0 0 }, >>> +=C2=A0 { EStdAcpiTableIdMadt, >>> EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, "MADT", >>> TRUE,=C2=A0 0 }, >>> +=C2=A0 { EStdAcpiTableIdGtdt, >>> EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, "GTDT", >>> TRUE,=C2=A0 0 }, >>> +=C2=A0 { EStdAcpiTableIdDsdt, >>> EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, >>> "DSDT", TRUE,=C2=A0 0 }, >>> +=C2=A0 { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNAT= URE, >>> "DBG2", FALSE, 0 }, >>> +=C2=A0 { EStdAcpiTableIdSpcr, >>> EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, "SPCR", >>> FALSE, 0 }, >>> +}; >>> + >>> =C2=A0 /** This macro expands to a function that retrieves the ACPI = Table >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 List from the Configuration Manager. >>> =C2=A0 */ >>> @@ -395,6 +419,7 @@ BuildAndInstallAcpiTable ( >>> =C2=A0 =C2=A0=C2=A0=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Success. >>> =C2=A0=C2=A0=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 If mandatory table is not found. >>> +=C2=A0 @retval EFI_ALREADY_STARTED=C2=A0=C2=A0 If mandatory table fo= und in >>> AcpiTableInfo is already installed. >>> =C2=A0 **/ >>> =C2=A0 STATIC >>> =C2=A0 EFI_STATUS >>> @@ -404,75 +429,68 @@ VerifyMandatoryTablesArePresent ( >>> =C2=A0=C2=A0=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINT32=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 AcpiTableCount >>> =C2=A0=C2=A0=C2=A0 ) >>> =C2=A0 { >>> -=C2=A0 EFI_STATUS=C2=A0 Status; >>> -=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 FadtFound; >>> -=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 MadtFound; >>> -=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 GtdtFound; >>> -=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 DsdtFound; >>> -=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 Dbg2Found; >>> -=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 SpcrFound; >>> +=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status; >>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Handle; >>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Index; >>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 InstalledTableIndex; >>> +=C2=A0 EFI_ACPI_DESCRIPTION_HEADER=C2=A0 *DescHeader; >>> +=C2=A0 EFI_ACPI_TABLE_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ve= rsion; >>> +=C2=A0 EFI_ACPI_SDT_PROTOCOL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= *AcpiSdt; >>> =C2=A0 -=C2=A0 Status=C2=A0=C2=A0=C2=A0 =3D EFI_SUCCESS; >>> -=C2=A0 FadtFound =3D FALSE; >>> -=C2=A0 MadtFound =3D FALSE; >>> -=C2=A0 GtdtFound =3D FALSE; >>> -=C2=A0 DsdtFound =3D FALSE; >>> -=C2=A0 Dbg2Found =3D FALSE; >>> -=C2=A0 SpcrFound =3D FALSE; >>> =C2=A0=C2=A0=C2=A0 ASSERT (AcpiTableInfo !=3D NULL); >>> =C2=A0 +=C2=A0 Status =3D EFI_SUCCESS; >>> + >>> +=C2=A0 // Check against the statically initialized ACPI tables to se= e if >>> they are in ACPI info list >>> =C2=A0=C2=A0=C2=A0 while (AcpiTableCount-- !=3D 0) { >>> -=C2=A0=C2=A0=C2=A0 switch (AcpiTableInfo[AcpiTableCount].AcpiTableSi= gnature) { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case EFI_ACPI_6_2_FIXED_ACPI_DESCRIPT= ION_TABLE_SIGNATURE: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FadtFound =3D TRUE; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case EFI_ACPI_6_2_MULTIPLE_APIC_DESCR= IPTION_TABLE_SIGNATURE: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MadtFound =3D TRUE; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case EFI_ACPI_6_2_GENERIC_TIMER_DESCR= IPTION_TABLE_SIGNATURE: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GtdtFound =3D TRUE; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case >>> EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DsdtFound =3D TRUE; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_= SIGNATURE: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Dbg2Found =3D TRUE; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case >>> EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SpcrFound =3D TRUE; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 default: >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> +=C2=A0=C2=A0=C2=A0 for (Index =3D 0; Index < ACPI_TABLE_VERIFY_COUNT= ; Index++) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (AcpiTableInfo[AcpiTableCount].Acp= iTableSignature =3D=3D >>> mAcpiVerifyTables[Index].AcpiTableSignature) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mAcpiVerifyTables[Index].= Presence |=3D >>> ACPI_TABLE_PRESENT_INFO_LIST; >> >> Would it be possible to add a 'break' here ? >> >> Just a note for Sami: >> These double loops seem expensive, but I cannot find anything better >> and/or shorter. >> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> =C2=A0=C2=A0=C2=A0 } >>> =C2=A0 -=C2=A0 // We need at least the FADT, MADT, GTDT and the DSDT= tables to >>> boot >>> -=C2=A0 if (!FadtFound) { >>> -=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found= \n")); >>> -=C2=A0=C2=A0=C2=A0 Status =3D EFI_NOT_FOUND; >>> -=C2=A0 } >>> +=C2=A0 // They also might be published already, so we can search fro= m there >>> +=C2=A0 AcpiSdt =3D NULL; >>> +=C2=A0 Status=C2=A0 =3D gBS->LocateProtocol (&gEfiAcpiSdtProtocolGui= d, NULL, >>> (VOID **)&AcpiSdt); >>> =C2=A0 -=C2=A0 if (!MadtFound) { >>> -=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found= .\n")); >>> -=C2=A0=C2=A0=C2=A0 Status =3D EFI_NOT_FOUND; >>> +=C2=A0 if (EFI_ERROR (Status) || (AcpiSdt =3D=3D NULL)) { >>> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_WARN, "WARNING: Failed to locate AC= PI SDT protocol >>> (0x%p) - %r\n", AcpiSdt, Status)); >>> +=C2=A0=C2=A0=C2=A0 goto EvaluatePresence; >> >> I think this is ok to just print and return an error, unless you think >> about this could happen. >> >> >>> =C2=A0=C2=A0=C2=A0 } >>> =C2=A0 -=C2=A0 if (!GtdtFound) { >>> -=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found= .\n")); >>> -=C2=A0=C2=A0=C2=A0 Status =3D EFI_NOT_FOUND; >>> -=C2=A0 } >>> +=C2=A0 for (Index =3D 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) { >>> +=C2=A0=C2=A0=C2=A0 Handle=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0; >>> +=C2=A0=C2=A0=C2=A0 InstalledTableIndex =3D 0; >>> +=C2=A0=C2=A0=C2=A0 do { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D AcpiSdt->GetAcpiTable (Ins= talledTableIndex, >>> (EFI_ACPI_SDT_HEADER **)&DescHeader, &Version, &Handle); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> =C2=A0 -=C2=A0 if (!DsdtFound) { >>> -=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found= .\n")); >>> -=C2=A0=C2=A0=C2=A0 Status =3D EFI_NOT_FOUND; >>> -=C2=A0 } >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 InstalledTableIndex++; >>> +=C2=A0=C2=A0=C2=A0 } while (DescHeader->Signature !=3D >>> mAcpiVerifyTables[Index].AcpiTableSignature); >>> =C2=A0 -=C2=A0 if (!Dbg2Found) { >>> -=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not foun= d.\n")); >>> +=C2=A0=C2=A0=C2=A0 if (!EFI_ERROR (Status)) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mAcpiVerifyTables[Index].Presence |=3D >>> ACPI_TABLE_PRESENT_INSTALLED; >>> +=C2=A0=C2=A0=C2=A0 } >>> =C2=A0=C2=A0=C2=A0 } >>> =C2=A0 -=C2=A0 if (!SpcrFound) { >>> -=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not foun= d.\n")); >>> +EvaluatePresence: >>> +=C2=A0 for (Index =3D 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) { >>> +=C2=A0=C2=A0=C2=A0 if (mAcpiVerifyTables[Index].Presence =3D=3D 0) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (mAcpiVerifyTables[Index].IsMandat= ory) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "ERR= OR: %a Table not found.\n", >>> mAcpiVerifyTables[Index].AcpiTableName)); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D EFI_NOT_FOUND; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_WARN, "WARN= ING: %a Table not found.\n", >>> mAcpiVerifyTables[Index].AcpiTableName)); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> +=C2=A0=C2=A0=C2=A0 } else if (mAcpiVerifyTables[Index].Presence =3D=3D >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (ACPI_TABLE_PRESENT_INFO_LIST | >>> ACPI_TABLE_PRESENT_INSTALLED)) >>> +=C2=A0=C2=A0=C2=A0 { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "ERROR: %a Table= found while already >>> published.\n", mAcpiVerifyTables[Index].AcpiTableName)); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D EFI_ALREADY_STARTED; >>> +=C2=A0=C2=A0=C2=A0 } >>> =C2=A0=C2=A0=C2=A0 } >> Just a note for Sami: >> In the loop above we return the last invalid code, this should be ok. >> >> >>> =C2=A0 =C2=A0=C2=A0=C2=A0 return Status; >>> @@ -489,8 +507,9 @@ VerifyMandatoryTablesArePresent ( >>> =C2=A0=C2=A0=C2=A0 @param [in]=C2=A0 CfgMgrProtocol=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Pointer to the Configuration >>> Manager >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 Protocol Interface. >>> =C2=A0 -=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0 Success. >>> -=C2=A0 @retval EFI_NOT_FOUND If a mandatory table or a generator is = not >>> found. >>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Success. >>> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 If a mandatory table or a generator >>> is not found. >>> +=C2=A0 @retval EFI_ALREADY_STARTED=C2=A0=C2=A0 If mandatory table fo= und in >>> AcpiTableInfo is already installed. >>> =C2=A0 **/ >>> =C2=A0 STATIC >>> =C2=A0 EFI_STATUS >>> @@ -562,7 +581,7 @@ ProcessAcpiTables ( >>> =C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG (( >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Failed to find mandatory ACPI= Table(s)." >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Failed to verify mandatory AC= PI Table(s) presence." >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 " Status =3D %r\n", >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >>> @@ -570,29 +589,32 @@ ProcessAcpiTables ( >>> =C2=A0=C2=A0=C2=A0 } >>> =C2=A0 =C2=A0=C2=A0=C2=A0 // Add the FADT Table first. >>> -=C2=A0 for (Idx =3D 0; Idx < AcpiTableCount; Idx++) { >>> -=C2=A0=C2=A0=C2=A0 if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableId= Fadt) =3D=3D >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AcpiTableInfo[Idx].TableG= eneratorId) >>> -=C2=A0=C2=A0=C2=A0 { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D BuildAndInstallAcpiTable ( >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 TableFactoryProtocol, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 CfgMgrProtocol, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 AcpiTableProtocol, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 &AcpiTableInfo[Idx] >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG (( >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Faile= d to find build and install ACPI FADT Table." \ >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 " Status =3D = %r\n", >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return Status; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> +=C2=A0 if ((mAcpiVerifyTables[ACPI_TABLE_VERIFY_FADT].Presence & >>> ACPI_TABLE_PRESENT_INSTALLED) =3D=3D 0) { >>> +=C2=A0=C2=A0=C2=A0 // FADT is not yet installed >>> +=C2=A0=C2=A0=C2=A0 for (Idx =3D 0; Idx < AcpiTableCount; Idx++) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (CREATE_STD_ACPI_TABLE_GEN_ID (ESt= dAcpiTableIdFadt) =3D=3D >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AcpiTableInfo= [Idx].TableGeneratorId) >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D BuildAndInstal= lAcpiTable ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 TableFactoryProtocol, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CfgMgrProtocol, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AcpiTableProtocol, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &AcpiTableInfo[Idx] >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG (( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 D= EBUG_ERROR, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "= ERROR: Failed to find build and install ACPI FADT >>> Table." \ >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "= Status =3D %r\n", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 S= tatus >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )= ); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return Status= ; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> =C2=A0 -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> -=C2=A0=C2=A0=C2=A0 } >>> -=C2=A0 } // for >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> +=C2=A0=C2=A0=C2=A0 } // for >>> +=C2=A0 } >>> =C2=A0 =C2=A0=C2=A0=C2=A0 // Add remaining ACPI Tables >>> =C2=A0=C2=A0=C2=A0 for (Idx =3D 0; Idx < AcpiTableCount; Idx++) { >>> diff --git >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.inf >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.inf >>> >>> index 028c3d413cf8..5ca98c8b4895 100644 >>> --- >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.inf >>> +++ >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManager= Dxe.inf >>> @@ -36,6 +36,7 @@ [LibraryClasses] >>> =C2=A0 =C2=A0 [Protocols] >>> =C2=A0=C2=A0=C2=A0 gEfiAcpiTableProtocolGuid=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 # PROTOCOL >>> ALWAYS_CONSUMED >>> +=C2=A0 gEfiAcpiSdtProtocolGuid=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 # PROTOCOL >>> ALWAYS_CONSUMED >>> =C2=A0 =C2=A0=C2=A0=C2=A0 gEdkiiConfigurationManagerProtocolGuid=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # PROTOCOL >>> ALWAYS_CONSUMED >>> =C2=A0=C2=A0=C2=A0 gEdkiiDynamicTableFactoryProtocolGuid=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # PROTOCOL >>> ALWAYS_CONSUMED