Date   

Updated Event: TianoCore Community Meeting - EMEA / NAMO - Thursday, August 18, 2022 #cal-invite

Group Notification <noreply@...>
 

TianoCore Community Meeting - EMEA / NAMO

When:
Thursday, August 18, 2022
9:00am to 10:00am
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_N2UyMTVhZjUtOTk3Ni00MmI0LTg0NmItNzIwYTkyMGJhYzNh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d

Organizer: Miki Demeter

View Event

Description:

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: 111 422 379 4

Alternate VTC dialing instructions

Or call in (audio only)

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

Phone Conference ID: 482 062 805#

Find a local number | Reset PIN

Learn More | Meeting options


[Bug] patch owner send two same patches in Edk2Platform

Huang, Yanbo
 

Hi,

The patch owner Pranav Madhu send two same patches in different branch.

Does someone can help to fix it?

Text

Description automatically generated

 

Best Regards,

Yanbo Huang


Re: Confirm your yanbo.huang@intel.com email address

Huang, Yanbo
 

 

 

From: Groups.io Notification <noreply@groups.io>
Sent: Monday, August 1, 2022 4:00 PM
To: Huang, Yanbo <yanbo.huang@...>
Subject: [edk2-devel] Confirm your yanbo.huang@... email address

 

Hello,

Thank you for your interest in the https://edk2.groups.io/g/devel group at Groups.io. If you did not request or do not want to join devel@edk2.groups.io, please ignore this message.

If you only want to send and receive messages from devel@edk2.groups.io, reply to this email to confirm your email address and activate your membership.

If you want to use the resources and read messages on the website, please click on the link below to confirm your email address, set up a password, and choose other subscription settings:

Confirm account


Cheers,
The Groups.io Team


Re: EDK2 build error:Unknown fatal error when processing []

np l <lnpabcde@...>
 

OK! Thanks a lot, It's great to receive your reply!
So it's just a small but serious problem😂
Sorry to bother you!
Thanks again!!!


S, Ashraf Ali <ashraf.ali.s@...> 于2022年7月31日周日 22:45写道:

Hi

 

-p PLATFORMFILE, --platform=PLATFORMFILE

                        Build the platform specified by the DSC file name

                        argument, overriding target.txt's ACTIVE_PLATFORM

                        definition.

 

 

-a TARGETARCH, --arch=TARGETARCH

                        ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64

                        or EBC, which overrides target.txt's TARGET_ARCH

                        definition. To specify more archs, please repeat this

                        option.

 

 

Regards,

Ashraf Ali S

Intel Technology India Pvt. Ltd. 

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney
Sent: Sunday, July 31, 2022 8:53 AM
To: devel@edk2.groups.io; lnpabcde@...; Kinney, Michael D <michael.d.kinney@...>
Subject: Re: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

You should pass in .dsc file, not .dec file for -p  option of build.

 

Mike

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of np l
Sent: Saturday, July 30, 2022 7:02 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

Hi,

I got a fatal error with a command "build -p edk2\MdeModulePkg\MdeModulePkg.dec -a X64 -t VS2015x86".

(Python version is  2.7.15.Build tool is VS2015x86)

   But  UEFI\edk2\EmulatorPkg\EmulatorPkg.dec can be build successfully.

   I have update edk2 with "git pull" but the same error occured. 

   I also test it in another laptop with python  version 3.9.9 build tool VS2019,a same error occur.

 

What should I do?

 

error log as blow:

 

Thanks!

 


[PATCH] BaseTools: Add missing spaces for PCD expression values in AutoGenC

Konstantin Aladyshev
 

Currently the PCD values calculated from the expressions have different
formating from the simple byte arrays in AutoGenC.

Example:
The following definition in DEC:
gTokenSpaceGuid.PcdArray|{0x44, 0x33, 0x22, 0x11}|VOID*|0x55555555
gTokenSpaceGuid.PcdArrayByExpression|{UINT32(0x11223344)}|VOID*|0x66666666

Produces these strings in AutoGenC:
<...> _gPcd_<...>_PcdArray[4] =3D {0x44, 0x33, 0x22, 0x11};
<...> _gPcd_<...>_PcdArrayByExpression[4] =3D {0x44,0x33,0x22,0x11};

Add missing space character between the array elements to unify PCD value
formatting.

Signed-off-by: Konstantin Aladyshev <aladyshev22@...>
---
BaseTools/Source/Python/Common/Expression.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc=
e/Python/Common/Expression.py
index 31bf0e4b6c..b62efe6f9b 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -1026,7 +1026,7 @@ class ValueExpressionEx(ValueExpression):
Size +=3D ItemSize=0D
=0D
if Size > 0:=0D
- PcdValue =3D '{' + ','.join(AllPcdValueLis=
t) + '}'=0D
+ PcdValue =3D '{' + ', '.join(AllPcdValueLi=
st) + '}'=0D
else:=0D
raise BadExpression("Type: %s, Value: %s, %s"=
%(self.PcdType, PcdValue, Value))=0D
=0D
--=20
2.25.1


Re: Proposal to move Rust std work to edk2-staging

Michael Kubacki
 

Hi Ayush,

For the purposes of this work, please don't let process impede progress. The main purpose of moving to edk2-staging is to broaden exposure of the work and encourage additional collaboration. In particular, within the Tianocore/edk2 community.

As the author, you can choose how to best present your work to the communities - Rust and Tianocore.

I think it's reasonable to keep the edk2-staging repo light with documentation, examples, and edk2-specific changes that reference the Rust changes in your rust-lang/rust fork. The code in the edk2-staging repo should ultimately aim to transition to an edk2 PR as the edk2 contribution from the project.

Regards,
Michael

On 7/30/2022 6:01 AM, Ayush Singh wrote:
Hello everyone. The work on Rust std for UEFI has been progressing smoothly. Running Rust tests is now possible in it's entirety. The number of tests that fail is 133 (4 cause exception + 129 normal fails) out of 13,212 tests. Apart from the 4 tests that cause exceptions, most of the 129 other tests can be ignored since they are caused by needing dynamic linking and/or stack unwinding. So I think, it is time to start considering moving the project to a more appropriate repository before I open a PR upstream.
However, I do have some concerns regarding moving to edk2-staging:
1. Rust development workflow does not use Mailing lists and Patches. This might create friction for the purely `rustc` developers who might want to submit changes and are accustomed to PRs.
2. Rust project does not seem to care about maintaining a clean history (most of the merges are performed by bots in form of roll-up merges). This is much different from how edk2 projects are usually managed. The reason where this becomes a problem is having to do re-bases. While Rust provides strong guarantees for stability of user facing APIs, the internal std APIs are constantly changing. Combine that with no clean-history and the upstream PR will probably have to be re-based on latest master every few weeks (and it will likely need manual intervention).
I am planning on getting the code base ready for upstream PR before 15th August. The main things left to do is to publish new versions of `compiler_builtins` and `r-efi` crates, and refactor the code and UEFI documentation.
Yours Sincerely
Ayush Singh


How to operate I2C in UEFI app?

gordontcp@...
 

There is has an example of I2cDxe driver in edk2, the path is \MdeModulePkg\Bus\I2c\I2cDxe.
However, I can't find an I2C example related to the app.
I use the following function, try to get the I2C handle:

EFI_STATUS LocateI2CIO(void)
{
EFI_STATUS Status;
EFI_HANDLE* I2CIOHandleBuffer = NULL;
UINTNHandleIndex = 0;
UINTNHandleCount = 0;
//get the handles which supports
Status = gBS->LocateHandleBuffer(
  ByProtocol,
  &gEfiI2cIoProtocolGuid,
  NULL,
  &HandleCount,
  &I2CIOHandleBuffer
  );

But the return value is EFI_NOT_FOUND.
My system : Minnowboard Max.
By the way, I also loaded I2CDxe.efi,
Command : load I2CDxe.efi
The result is as follows:

EFI_STATUS
EFIAPI
I2cBusDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
EFI_STATUS Status;
EFI_I2C_ENUMERATE_PROTOCOL *I2cEnumerate;
EFI_I2C_HOST_PROTOCOL *I2cHost;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_DEVICE_PATH_PROTOCOL *DevPathNode;
BOOLEAN RemainingHasControllerNode;
UINT32 RemainingControllerNumber;
RemainingHasControllerNode = FALSE;
RemainingControllerNumber = 0;
//
// Determine if the I2c Enumerate Protocol is available
//
Status = gBS->OpenProtocol (
  Controller,
  &gEfiI2cEnumerateProtocolGuid,
  (VOID**)&I2cEnumerate,
  This->DriverBindingHandle,
  Controller,
  EFI_OPEN_PROTOCOL_BY_DRIVER
  );

The above function return value: Status : EFI_UNSUPPORTED

My questions are as follows:

1. Is there any full example in edk2 with I2C operation?

2. Do I need to load I2CDxe.efi before I2c operation?

3. Does I2cDxe.efi need to be modified to be loaded?

Any suggestion is greatly appreciated.

Thanks!

 


Re: [PATCH] MdePkg:Improved Smbios Type9 table and Smbios 3.5.0 spec changes

Sainadh Nagolu
 

Please help to review this Patch.


Re: [edk2-platforms:PATCH] Modify processor _UID ordering by CPU default fused in MADT

Donald Kuo
 

Thanks Jack

The changes looks good to me.

Donald

-----Original Message-----
From: Lin, JackX <jackx.lin@...>
Sent: Thursday, July 28, 2022 3:25 PM
To: devel@edk2.groups.io
Cc: Lin, JackX <jackx.lin@...>; Lin, JackX <jackx.lin@...>; Chiu, Chasel <chasel.chiu@...>; Dong, Eric <eric.dong@...>; Yao, Jiewen <jiewen.yao@...>; Ni, Ray <ray.ni@...>; Chaganty, Rangasai V <rangasai.v.chaganty@...>; Kuo, Donald <donald.kuo@...>; Kumar, Chandana C <chandana.c.kumar@...>; Palakshareddy; Palakshareddy, Lavanya C <lavanya.c.palakshareddy@...>
Subject: [edk2-platforms:PATCH] Modify processor _UID ordering by CPU default fused in MADT

BIOS should not reordering cpu processor_uid

Signed-off-by: JackX Lin <JackX.Lin@...>
Cc: Chasel Chiu <chasel.chiu@...>
Cc: Dong Eric <eric.dong@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Ray Ni <ray.ni@...>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@...>
Cc: Donald Kuo <Donald.Kuo@...>
Cc: Chandana C Kumar <chandana.c.kumar@...>
Cc: Palakshareddy, Lavanya C <lavanya.c.palakshareddy@...>
Cc: JackX Lin <JackX.Lin@...>
---
Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 99 ++++-----------------------------------------------------------------------------------------------
1 file changed, 4 insertions(+), 95 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index c7e87cbd7d..d0e8891918 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -62,33 +62,6 @@ EFI_CPU_ID_ORDER_MAP *mCpuApicIdOrderTable = NULL;
UINTN mNumberOfCpus = 0;
UINTN mNumberOfEnabledCPUs = 0;

-
-/**
- The function is called by PerformQuickSort to compare int values.
-
- @param[in] Left The pointer to first buffer.
- @param[in] Right The pointer to second buffer.
-
- @return -1 Buffer1 is less than Buffer2.
- @return 1 Buffer1 is greater than Buffer2.
-
-**/
-INTN
-EFIAPI
-ApicIdCompareFunction (
- IN CONST VOID *Left,
- IN CONST VOID *Right
- )
-{
- UINT32 LeftApicId;
- UINT32 RightApicId;
-
- LeftApicId = ((EFI_CPU_ID_ORDER_MAP *) Left)->ApicId;
- RightApicId = ((EFI_CPU_ID_ORDER_MAP *) Right)->ApicId;
-
- return (LeftApicId > RightApicId)? 1 : (-1); -}
-
/**
Print Cpu Apic ID Table

@@ -168,21 +141,16 @@ SortCpuLocalApicInTable (
EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer;
UINT32 Index;
UINT32 CurrProcessor;
- UINT32 BspApicId;
- EFI_CPU_ID_ORDER_MAP TempVal;
EFI_CPU_ID_ORDER_MAP *CpuIdMapPtr;
UINT32 CoreThreadMask;
- EFI_CPU_ID_ORDER_MAP *TempCpuApicIdOrderTable;
UINT32 Socket;

- Index = 0;
Status = EFI_SUCCESS;

if (mCpuOrderSorted) {
return Status;
}

- TempCpuApicIdOrderTable = AllocateZeroPool (mNumberOfCpus * sizeof (EFI_CPU_ID_ORDER_MAP));
CoreThreadMask = (UINT32) ((1 << mNumOfBitShift) - 1);

for (CurrProcessor = 0, Index = 0; CurrProcessor < mNumberOfCpus; CurrProcessor++, Index++) { @@ -192,7 +160,7 @@ SortCpuLocalApicInTable (
&ProcessorInfoBuffer
);

- CpuIdMapPtr = (EFI_CPU_ID_ORDER_MAP *) &TempCpuApicIdOrderTable[Index];
+ CpuIdMapPtr = (EFI_CPU_ID_ORDER_MAP *)
+ &mCpuApicIdOrderTable[Index];
if ((ProcessorInfoBuffer.StatusFlag & PROCESSOR_ENABLED_BIT) != 0) {
CpuIdMapPtr->ApicId = (UINT32)ProcessorInfoBuffer.ProcessorId;
CpuIdMapPtr->Thread = ProcessorInfoBuffer.Location.Thread;
@@ -214,74 +182,16 @@ SortCpuLocalApicInTable (
} //end if PROC ENABLE
} //end for CurrentProcessor

- //keep for debug purpose
DEBUG ((DEBUG_INFO, "::ACPI:: APIC ID Order Table Init. CoreThreadMask = %x, mNumOfBitShift = %x\n", CoreThreadMask, mNumOfBitShift));
- DebugDisplayReOrderTable (TempCpuApicIdOrderTable);

//
// Get Bsp Apic Id
//
- BspApicId = GetApicId ();
- DEBUG ((DEBUG_INFO, "BspApicId - 0x%x\n", BspApicId));
-
- //
- //check to see if 1st entry is BSP, if not swap it
- //
- if (TempCpuApicIdOrderTable[0].ApicId != BspApicId) {
- for (Index = 0; Index < mNumberOfCpus; Index++) {
- if ((TempCpuApicIdOrderTable[Index].Flags == 1) && (TempCpuApicIdOrderTable[Index].ApicId == BspApicId)) {
- CopyMem (&TempVal, &TempCpuApicIdOrderTable[Index], sizeof (EFI_CPU_ID_ORDER_MAP));
- CopyMem (&TempCpuApicIdOrderTable[Index], &TempCpuApicIdOrderTable[0], sizeof (EFI_CPU_ID_ORDER_MAP));
- CopyMem (&TempCpuApicIdOrderTable[0], &TempVal, sizeof (EFI_CPU_ID_ORDER_MAP));
- break;
- }
- }
-
- if (mNumberOfCpus <= Index) {
- DEBUG ((DEBUG_ERROR, "Asserting the SortCpuLocalApicInTable Index Bufferflow\n"));
- return EFI_INVALID_PARAMETER;
- }
- }
-
- //
- // 1. Sort TempCpuApicIdOrderTable,
- // sort it by using ApicId from minimum to maximum (Socket0 to SocketN), and the BSP must in the fist location of the table.
- // So, start sorting the table from the second element and total elements are mNumberOfCpus-1.
- //
- PerformQuickSort ((TempCpuApicIdOrderTable + 1), (mNumberOfCpus - 1), sizeof (EFI_CPU_ID_ORDER_MAP), (SORT_COMPARE) ApicIdCompareFunction);
+ DEBUG ((DEBUG_INFO, "BspApicId - 0x%x\n", GetApicId ()));

- //
- // 2. Sort and map the primary threads to the front of the CpuApicIdOrderTable
- //
- for (CurrProcessor = 0, Index = 0; Index < mNumberOfCpus; Index++) {
- if ((TempCpuApicIdOrderTable[Index].Thread) == 0) { // primary thread
- CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTable[Index], sizeof (EFI_CPU_ID_ORDER_MAP));
- CurrProcessor++;
- }
- }

//
- // 3. Sort and map the second threads to the middle of the CpuApicIdOrderTable
- //
- for (Index = 0; Index < mNumberOfCpus; Index++) {
- if ((TempCpuApicIdOrderTable[Index].Thread) == 1) { //second thread
- CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTable[Index], sizeof (EFI_CPU_ID_ORDER_MAP));
- CurrProcessor++;
- }
- }
-
- //
- // 4. Sort and map the not enabled threads to the bottom of the CpuApicIdOrderTable
- //
- for (Index = 0; Index < mNumberOfCpus; Index++) {
- if (TempCpuApicIdOrderTable[Index].Flags == 0) { // not enabled
- CopyMem (&mCpuApicIdOrderTable[CurrProcessor], &TempCpuApicIdOrderTable[Index], sizeof (EFI_CPU_ID_ORDER_MAP));
- CurrProcessor++;
- }
- }
-
- //
- // 5. Re-assign AcpiProcessorId for AcpiProcessorUid uses purpose.
+ // Fill in AcpiProcessorUid.
//
for (Socket = 0; Socket < FixedPcdGet32 (PcdMaxCpuSocketCount); Socket++) {
for (CurrProcessor = 0, Index = 0; CurrProcessor < mNumberOfCpus; CurrProcessor++) { @@ -292,8 +202,7 @@ SortCpuLocalApicInTable (
}
}

- //keep for debug purpose
- DEBUG ((DEBUG_INFO, "APIC ID Order Table ReOrdered\n"));
+ DEBUG ((DEBUG_INFO, "::ACPI:: APIC ID Order Table Init. CoreThreadMask = %x, mNumOfBitShift = %x\n", CoreThreadMask, mNumOfBitShift));
DebugDisplayReOrderTable (mCpuApicIdOrderTable);

mCpuOrderSorted = TRUE;
--
2.32.0.windows.2


Re: EDK2 build error:Unknown fatal error when processing []

Michael D Kinney
 

Passing in the wrong format file should generate a

proper error message instead of a python stack trace.

 

Please enter a Tianocore Bugzilla with the details from

your logs.

 

https://bugzilla.tianocore.org/

 

Thanks,

 

Mike

 

From: np l <lnpabcde@...>
Sent: Sunday, July 31, 2022 9:04 AM
To: S, Ashraf Ali <ashraf.ali.s@...>
Cc: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@...>
Subject: Re: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

OK! Thanks a lot, It's great to receive your reply!

So it's just a small but serious problem😂

Sorry to bother you!

Thanks again!!!

 

 

S, Ashraf Ali <ashraf.ali.s@...> 2022731日周日 22:45写道:

Hi

 

-p PLATFORMFILE, --platform=PLATFORMFILE

                        Build the platform specified by the DSC file name

                        argument, overriding target.txt's ACTIVE_PLATFORM

                        definition.

 

 

-a TARGETARCH, --arch=TARGETARCH

                        ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64

                        or EBC, which overrides target.txt's TARGET_ARCH

                        definition. To specify more archs, please repeat this

                        option.

 

 

Regards,

Ashraf Ali S

Intel Technology India Pvt. Ltd. 

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney
Sent: Sunday, July 31, 2022 8:53 AM
To: devel@edk2.groups.io; lnpabcde@...; Kinney, Michael D <michael.d.kinney@...>
Subject: Re: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

You should pass in .dsc file, not .dec file for -p  option of build.

 

Mike

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of np l
Sent: Saturday, July 30, 2022 7:02 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

Hi,

I got a fatal error with a command "build -p edk2\MdeModulePkg\MdeModulePkg.dec -a X64 -t VS2015x86".

(Python version is  2.7.15.Build tool is VS2015x86)

   But  UEFI\edk2\EmulatorPkg\EmulatorPkg.dec can be build successfully.

   I have update edk2 with "git pull" but the same error occured. 

   I also test it in another laptop with python  version 3.9.9 build tool VS2019,a same error occur.

 

What should I do?

 

error log as blow:

 

Thanks!

 


Re: EDK2 build error:Unknown fatal error when processing []

Ashraf Ali S
 

Hi

 

-p PLATFORMFILE, --platform=PLATFORMFILE

                        Build the platform specified by the DSC file name

                        argument, overriding target.txt's ACTIVE_PLATFORM

                        definition.

 

 

-a TARGETARCH, --arch=TARGETARCH

                        ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64

                        or EBC, which overrides target.txt's TARGET_ARCH

                        definition. To specify more archs, please repeat this

                        option.

 

 

Regards,

Ashraf Ali S

Intel Technology India Pvt. Ltd. 

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney
Sent: Sunday, July 31, 2022 8:53 AM
To: devel@edk2.groups.io; lnpabcde@...; Kinney, Michael D <michael.d.kinney@...>
Subject: Re: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

You should pass in .dsc file, not .dec file for -p  option of build.

 

Mike

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of np l
Sent: Saturday, July 30, 2022 7:02 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

Hi,

I got a fatal error with a command "build -p edk2\MdeModulePkg\MdeModulePkg.dec -a X64 -t VS2015x86".

(Python version is  2.7.15.Build tool is VS2015x86)

   But  UEFI\edk2\EmulatorPkg\EmulatorPkg.dec can be build successfully.

   I have update edk2 with "git pull" but the same error occured. 

   I also test it in another laptop with python  version 3.9.9 build tool VS2019,a same error occur.

 

What should I do?

 

error log as blow:

 

Thanks!

 


Re: [PATCH edk2-platforms v1 1/1] Platform/Ampere: Fix build break in JadePkg

Ard Biesheuvel
 

On Fri, 29 Jul 2022 at 23:07, Sami Mujawar <sami.mujawar@...> wrote:

The definition for ARM_PROCESSOR_TABLE has been removed by
commit c8af26627a4e9a3659255dc147d75596da08248e
as it is a pseudo ACPI table.

This causes the JadePkg builds to fail. Therefore, update
Ampere/JadePkg to reflect this change.

Signed-off-by: Sami Mujawar <sami.mujawar@...>
Apologies for missing this usage.

Reviewed-by: Ard Biesheuvel <ardb@...>

Pushed as f00b553b101c..7986a26aefad

---
Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c | 22 +++++++++++---------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c
index d5bc732b08bbfc61a24781f82f575b33b17d75d8..93dabce0e68ab090ac86ec8066ab1b40372e4746 100644
--- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c
+++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c
@@ -1,6 +1,7 @@
/** @file

Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
+ Copyright (c) 2022, ARM Ltd. All rights reserved.<BR>

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

@@ -115,7 +116,8 @@ SratAddGiccAffinity (
EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *SratGiccAffinity
)
{
- ARM_PROCESSOR_TABLE *ArmProcessorTable;
+ VOID *Hob;
+ UINTN NumberOfEntries;
ARM_CORE_INFO *ArmCoreInfoTable;
UINTN Count, NumNode, Idx;
UINT32 AcpiProcessorUid;
@@ -123,22 +125,22 @@ SratAddGiccAffinity (
UINT8 Core;
UINT8 Cpm;

- for (Idx = 0; Idx < gST->NumberOfTableEntries; Idx++) {
- if (CompareGuid (&gArmMpCoreInfoGuid, &(gST->ConfigurationTable[Idx].VendorGuid))) {
- ArmProcessorTable = (ARM_PROCESSOR_TABLE *)gST->ConfigurationTable[Idx].VendorTable;
- ArmCoreInfoTable = ArmProcessorTable->ArmCpus;
- break;
- }
+ Hob = GetFirstGuidHob (&gArmMpCoreInfoGuid);
+ if (Hob == NULL) {
+ return EFI_NOT_FOUND;
}

- if (Idx == gST->NumberOfTableEntries) {
+ ArmCoreInfoTable = (ARM_CORE_INFO*)GET_GUID_HOB_DATA (Hob);
+ NumberOfEntries = GET_GUID_HOB_DATA_SIZE (Hob)/sizeof (ARM_CORE_INFO);
+
+ if (NumberOfEntries == 0) {
return EFI_INVALID_PARAMETER;
}

Count = 0;
NumNode = 0;
- while (Count != ArmProcessorTable->NumberOfEntries) {
- for (Idx = 0; Idx < ArmProcessorTable->NumberOfEntries; Idx++ ) {
+ while (Count != NumberOfEntries) {
+ for (Idx = 0; Idx < NumberOfEntries; Idx++ ) {
Socket = GET_MPIDR_AFF1 (ArmCoreInfoTable[Idx].Mpidr);
Core = GET_MPIDR_AFF0 (ArmCoreInfoTable[Idx].Mpidr);
Cpm = Core >> PLATFORM_CPM_UID_BIT_OFFSET;
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'






[PATCH v3 6/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config

Kun Qin
 

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

This change added a switch case handling for PCI_SS_CONFIG during SSDT
generation. This will allow PCI config case return EFI_SUCCESS instead of
EFI_INVALID_PARAMETER.

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

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>
---

Notes:
v2:
- Added Reviewed-by tag [Pierre]
=20=20=20=20
v3:
- No change

DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c |=
5 +++++
1 file changed, 5 insertions(+)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG=
enerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG=
enerator.c
index 658a089c8f1f..740271b504ca 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato=
r.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato=
r.c
@@ -603,6 +603,11 @@ GeneratePciCrs (
);=0D
break;=0D
=0D
+ case PCI_SS_CONFIG:=0D
+ // Do nothing=0D
+ Status =3D EFI_SUCCESS;=0D
+ break;=0D
+=0D
default:=0D
Status =3D EFI_INVALID_PARAMETER;=0D
} // switch=0D
--=20
2.37.1.windows.1


[PATCH v3 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space

Kun Qin
 

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

Certain OSes will complain if the ECAM config space is not reserved in
the ACPI namespace.

This change adds a function to reserve PNP motherboard resources for a
given PCI node.

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>
---

Notes:
v2:
- Only create RES0 after config space checking [Pierre]
=20=20=20=20
v3:
- Updated function names and descriptions [Pierre]
- Moved translation calculation to CONFIG case [Pierre]

DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c |=
171 ++++++++++++++++++++
1 file changed, 171 insertions(+)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG=
enerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG=
enerator.c
index ceffe2838c03..658a089c8f1f 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato=
r.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato=
r.c
@@ -616,6 +616,169 @@ GeneratePciCrs (
return Status;=0D
}=0D
=0D
+/** Generate a RES0 device node to reserve PNP motherboard resources=0D
+ for a given PCI node.=0D
+=0D
+ @param [in] PciNode Parent PCI node handle of the generated=0D
+ resource object.=0D
+ @param [out] CrsNode CRS node of the AML tree to populate.=0D
+=0D
+ @retval EFI_SUCCESS The function completed successfully.=0D
+ @retval EFI_INVALID_PARAMETER Invalid input parameter.=0D
+ @retval EFI_OUT_OF_RESOURCES Could not allocate memory.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+GenerateMotherboardDevice (=0D
+ IN AML_OBJECT_NODE_HANDLE PciNode,=0D
+ OUT AML_OBJECT_NODE_HANDLE *CrsNode=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ UINT32 EisaId;=0D
+ AML_OBJECT_NODE_HANDLE ResNode;=0D
+=0D
+ if (CrsNode =3D=3D NULL) {=0D
+ ASSERT (0);=0D
+ return EFI_INVALID_PARAMETER;=0D
+ }=0D
+=0D
+ // ASL: Device (RES0) {}=0D
+ Status =3D AmlCodeGenDevice ("RES0", PciNode, &ResNode);=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
+ // ASL: Name (_HID, EISAID ("PNP0C02"))=0D
+ Status =3D AmlGetEisaIdFromString ("PNP0C02", &EisaId); /* PNP Motherboa=
rd Resources */=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
+ Status =3D AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NULL);=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
+ // ASL: Name (_CRS, ResourceTemplate () {})=0D
+ Status =3D AmlCodeGenNameResourceTemplate ("_CRS", ResNode, CrsNode);=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
+ return Status;=0D
+}=0D
+=0D
+/** Reserves ECAM space for PCI config space=0D
+=0D
+ @param [in] Generator The SSDT Pci generator.=0D
+ @param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D
+ Protocol interface.=0D
+ @param [in] PciInfo Pci device information.=0D
+ @param [in, out] PciNode RootNode of the AML tree to populate.=
=0D
+=0D
+ @retval EFI_SUCCESS The function completed successfully.=0D
+ @retval EFI_INVALID_PARAMETER Invalid parameter.=0D
+ @retval EFI_OUT_OF_RESOURCES Could not allocate memory.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+ReserveEcamSpace (=0D
+ IN ACPI_PCI_GENERATOR *Generator,=
=0D
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtoc=
ol,=0D
+ IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,=0D
+ IN OUT AML_OBJECT_NODE_HANDLE PciNode=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ AML_OBJECT_NODE_HANDLE CrsNode;=0D
+ BOOLEAN Translation;=0D
+ UINT32 Index;=0D
+ CM_ARM_OBJ_REF *RefInfo;=0D
+ UINT32 RefCount;=0D
+ CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo;=0D
+ BOOLEAN IsPosDecode;=0D
+=0D
+ // Get the array of CM_ARM_OBJ_REF referencing the=0D
+ // CM_ARM_PCI_ADDRESS_MAP_INFO objects.=0D
+ Status =3D GetEArmObjCmRef (=0D
+ CfgMgrProtocol,=0D
+ PciInfo->AddressMapToken,=0D
+ &RefInfo,=0D
+ &RefCount=0D
+ );=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
+ for (Index =3D 0; Index < RefCount; Index++) {=0D
+ // Get CM_ARM_PCI_ADDRESS_MAP_INFO structures one by one.=0D
+ Status =3D GetEArmObjPciAddressMapInfo (=0D
+ CfgMgrProtocol,=0D
+ RefInfo[Index].ReferenceToken,=0D
+ &AddrMapInfo,=0D
+ NULL=0D
+ );=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
+ switch (AddrMapInfo->SpaceCode) {=0D
+ case PCI_SS_CONFIG:=0D
+ Translation =3D (AddrMapInfo->CpuAddress !=3D AddrMapInfo->PciAddr=
ess);=0D
+ if (AddrMapInfo->CpuAddress >=3D AddrMapInfo->PciAddress) {=0D
+ IsPosDecode =3D TRUE;=0D
+ } else {=0D
+ IsPosDecode =3D FALSE;=0D
+ }=0D
+=0D
+ Status =3D GenerateMotherboardDevice (PciNode, &CrsNode);=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ break;=0D
+ }=0D
+=0D
+ Status =3D AmlCodeGenRdQWordMemory (=0D
+ FALSE,=0D
+ IsPosDecode,=0D
+ TRUE,=0D
+ TRUE,=0D
+ FALSE, // non-cacheable=0D
+ TRUE,=0D
+ 0,=0D
+ AddrMapInfo->PciAddress,=0D
+ AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,=
=0D
+ Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->Pc=
iAddress : 0,=0D
+ AddrMapInfo->AddressSize,=0D
+ 0,=0D
+ NULL,=0D
+ 0,=0D
+ TRUE,=0D
+ CrsNode,=0D
+ NULL=0D
+ );=0D
+ break;=0D
+ default:=0D
+ break;=0D
+ } // switch=0D
+=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+ }=0D
+=0D
+ return Status;=0D
+}=0D
+=0D
/** Generate a Pci device.=0D
=0D
@param [in] Generator The SSDT Pci generator.=0D
@@ -702,9 +865,17 @@ GeneratePciDevice (
return Status;=0D
}=0D
=0D
+ // Add the PNP Motherboard Resources Device to reserve ECAM space=0D
+ Status =3D ReserveEcamSpace (Generator, CfgMgrProtocol, PciInfo, PciNode=
);=0D
+ if (EFI_ERROR (Status)) {=0D
+ ASSERT (0);=0D
+ return Status;=0D
+ }=0D
+=0D
// Add the template _OSC method.=0D
Status =3D AddOscMethod (PciInfo, PciNode);=0D
ASSERT_EFI_ERROR (Status);=0D
+=0D
return Status;=0D
}=0D
=0D
--=20
2.37.1.windows.1


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

Kun Qin
 

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 <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>
---

Notes:
v2:
- Function description updates [Sami]
- Refactorized the table verification [Pierre]
=20=20=20=20
v3:
- Added descriptions for new structures [Pierre]
- Added check for SDT protocol PCD before using it [Pierre]

DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c =
| 214 ++++++++++++--------
DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf=
| 4 +
2 files changed, 138 insertions(+), 80 deletions(-)

diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableMa=
nagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableMa=
nagerDxe.c
index ed62299f9bbd..7f3deef08a66 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx=
e.c
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx=
e.c
@@ -10,6 +10,7 @@
#include <Library/DebugLib.h>=0D
#include <Library/PcdLib.h>=0D
#include <Library/UefiBootServicesTableLib.h>=0D
+#include <Protocol/AcpiSystemDescriptionTable.h>=0D
#include <Protocol/AcpiTable.h>=0D
=0D
// Module specific include files.=0D
@@ -22,6 +23,58 @@
#include <Protocol/DynamicTableFactoryProtocol.h>=0D
#include <SmbiosTableGenerator.h>=0D
=0D
+///=0D
+/// Bit definitions for acceptable ACPI table presence formats.=0D
+/// Currently only ACPI tables present in the ACPI info list and=0D
+/// already installed will count towards "Table Present" during=0D
+/// verification routine.=0D
+///=0D
+#define ACPI_TABLE_PRESENT_INFO_LIST BIT0=0D
+#define ACPI_TABLE_PRESENT_INSTALLED BIT1=0D
+=0D
+///=0D
+/// Order of ACPI table being verified during presence inspection.=0D
+///=0D
+#define ACPI_TABLE_VERIFY_FADT 0=0D
+#define ACPI_TABLE_VERIFY_MADT 1=0D
+#define ACPI_TABLE_VERIFY_GTDT 2=0D
+#define ACPI_TABLE_VERIFY_DSDT 3=0D
+#define ACPI_TABLE_VERIFY_DBG2 4=0D
+#define ACPI_TABLE_VERIFY_SPCR 5=0D
+#define ACPI_TABLE_VERIFY_COUNT 6=0D
+=0D
+///=0D
+/// Private data structure to verify the presence of mandatory=0D
+/// or optional ACPI tables.=0D
+///=0D
+typedef struct {=0D
+ /// ESTD ID for the ACPI table of interest.=0D
+ ESTD_ACPI_TABLE_ID EstdTableId;=0D
+ /// Standard UINT32 ACPI signature.=0D
+ UINT32 AcpiTableSignature;=0D
+ /// 4 character ACPI table name (the 5th char8 is for null terminator).=
=0D
+ CHAR8 AcpiTableName[sizeof (UINT32) + 1];=0D
+ /// Indicator on whether the ACPI table is required.=0D
+ BOOLEAN IsMandatory;=0D
+ /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_*=0D
+ /// This field should be initialized to 0 and will be populated during=0D
+ /// verification routine.=0D
+ UINT16 Presence;=0D
+} ACPI_TABLE_PRESENCE_INFO;=0D
+=0D
+///=0D
+/// We require the FADT, MADT, GTDT and the DSDT tables to boot.=0D
+/// This list also include optional ACPI tables: DBG2, SPCR.=0D
+///=0D
+ACPI_TABLE_PRESENCE_INFO mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] =3D {=
=0D
+ { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATU=
RE, "FADT", TRUE, 0 },=0D
+ { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGN=
ATURE, "MADT", TRUE, 0 },=0D
+ { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGN=
ATURE, "GTDT", TRUE, 0 },=0D
+ { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TA=
BLE_SIGNATURE, "DSDT", TRUE, 0 },=0D
+ { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, =
"DBG2", FALSE, 0 },=0D
+ { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABL=
E_SIGNATURE, "SPCR", FALSE, 0 },=0D
+};=0D
+=0D
/** This macro expands to a function that retrieves the ACPI Table=0D
List from the Configuration Manager.=0D
*/=0D
@@ -395,6 +448,7 @@ BuildAndInstallAcpiTable (
=0D
@retval EFI_SUCCESS Success.=0D
@retval EFI_NOT_FOUND If mandatory table is not found.=0D
+ @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo =
is already installed.=0D
**/=0D
STATIC=0D
EFI_STATUS=0D
@@ -404,75 +458,71 @@ VerifyMandatoryTablesArePresent (
IN UINT32 AcpiTableCount=0D
)=0D
{=0D
- EFI_STATUS Status;=0D
- BOOLEAN FadtFound;=0D
- BOOLEAN MadtFound;=0D
- BOOLEAN GtdtFound;=0D
- BOOLEAN DsdtFound;=0D
- BOOLEAN Dbg2Found;=0D
- BOOLEAN SpcrFound;=0D
+ EFI_STATUS Status;=0D
+ UINTN Handle;=0D
+ UINTN Index;=0D
+ UINTN InstalledTableIndex;=0D
+ EFI_ACPI_DESCRIPTION_HEADER *DescHeader;=0D
+ EFI_ACPI_TABLE_VERSION Version;=0D
+ EFI_ACPI_SDT_PROTOCOL *AcpiSdt;=0D
=0D
- Status =3D EFI_SUCCESS;=0D
- FadtFound =3D FALSE;=0D
- MadtFound =3D FALSE;=0D
- GtdtFound =3D FALSE;=0D
- DsdtFound =3D FALSE;=0D
- Dbg2Found =3D FALSE;=0D
- SpcrFound =3D FALSE;=0D
ASSERT (AcpiTableInfo !=3D NULL);=0D
=0D
+ Status =3D EFI_SUCCESS;=0D
+=0D
+ // Check against the statically initialized ACPI tables to see if they a=
re in ACPI info list=0D
while (AcpiTableCount-- !=3D 0) {=0D
- switch (AcpiTableInfo[AcpiTableCount].AcpiTableSignature) {=0D
- case EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE:=0D
- FadtFound =3D TRUE;=0D
- break;=0D
- case EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE:=0D
- MadtFound =3D TRUE;=0D
- break;=0D
- case EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE:=0D
- GtdtFound =3D TRUE;=0D
- break;=0D
- case EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE:=
=0D
- DsdtFound =3D TRUE;=0D
- break;=0D
- case EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE:=0D
- Dbg2Found =3D TRUE;=0D
- break;=0D
- case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE:=0D
- SpcrFound =3D TRUE;=0D
- break;=0D
- default:=0D
+ for (Index =3D 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) {=0D
+ if (AcpiTableInfo[AcpiTableCount].AcpiTableSignature =3D=3D mAcpiVer=
ifyTables[Index].AcpiTableSignature) {=0D
+ mAcpiVerifyTables[Index].Presence |=3D ACPI_TABLE_PRESENT_INFO_LIS=
T;=0D
+ // Found this table, skip the rest.=0D
break;=0D
+ }=0D
}=0D
}=0D
=0D
- // We need at least the FADT, MADT, GTDT and the DSDT tables to boot=0D
- if (!FadtFound) {=0D
- DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found\n"));=0D
- Status =3D EFI_NOT_FOUND;=0D
- }=0D
+ // They also might be published already, so we can search from there=0D
+ if (FeaturePcdGet (PcdInstallAcpiSdtProtocol)) {=0D
+ AcpiSdt =3D NULL;=0D
+ Status =3D gBS->LocateProtocol (&gEfiAcpiSdtProtocolGuid, NULL, (VOID=
**)&AcpiSdt);=0D
=0D
- if (!MadtFound) {=0D
- DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found.\n"));=0D
- Status =3D EFI_NOT_FOUND;=0D
- }=0D
+ if (EFI_ERROR (Status) || (AcpiSdt =3D=3D NULL)) {=0D
+ DEBUG ((DEBUG_ERROR, "ERROR: Failed to locate ACPI SDT protocol (0x%=
p) - %r\n", AcpiSdt, Status));=0D
+ return Status;=0D
+ }=0D
=0D
- if (!GtdtFound) {=0D
- DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found.\n"));=0D
- Status =3D EFI_NOT_FOUND;=0D
- }=0D
+ for (Index =3D 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) {=0D
+ Handle =3D 0;=0D
+ InstalledTableIndex =3D 0;=0D
+ do {=0D
+ Status =3D AcpiSdt->GetAcpiTable (InstalledTableIndex, (EFI_ACPI_S=
DT_HEADER **)&DescHeader, &Version, &Handle);=0D
+ if (EFI_ERROR (Status)) {=0D
+ break;=0D
+ }=0D
=0D
- if (!DsdtFound) {=0D
- DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found.\n"));=0D
- Status =3D EFI_NOT_FOUND;=0D
- }=0D
+ InstalledTableIndex++;=0D
+ } while (DescHeader->Signature !=3D mAcpiVerifyTables[Index].AcpiTab=
leSignature);=0D
=0D
- if (!Dbg2Found) {=0D
- DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not found.\n"));=0D
+ if (!EFI_ERROR (Status)) {=0D
+ mAcpiVerifyTables[Index].Presence |=3D ACPI_TABLE_PRESENT_INSTALLE=
D;=0D
+ }=0D
+ }=0D
}=0D
=0D
- if (!SpcrFound) {=0D
- DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not found.\n"));=0D
+ for (Index =3D 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) {=0D
+ if (mAcpiVerifyTables[Index].Presence =3D=3D 0) {=0D
+ if (mAcpiVerifyTables[Index].IsMandatory) {=0D
+ DEBUG ((DEBUG_ERROR, "ERROR: %a Table not found.\n", mAcpiVerifyTa=
bles[Index].AcpiTableName));=0D
+ Status =3D EFI_NOT_FOUND;=0D
+ } else {=0D
+ DEBUG ((DEBUG_WARN, "WARNING: %a Table not found.\n", mAcpiVerifyT=
ables[Index].AcpiTableName));=0D
+ }=0D
+ } else if (mAcpiVerifyTables[Index].Presence =3D=3D=0D
+ (ACPI_TABLE_PRESENT_INFO_LIST | ACPI_TABLE_PRESENT_INSTALLE=
D))=0D
+ {=0D
+ DEBUG ((DEBUG_ERROR, "ERROR: %a Table found while already published.=
\n", mAcpiVerifyTables[Index].AcpiTableName));=0D
+ Status =3D EFI_ALREADY_STARTED;=0D
+ }=0D
}=0D
=0D
return Status;=0D
@@ -489,8 +539,9 @@ VerifyMandatoryTablesArePresent (
@param [in] CfgMgrProtocol Pointer to the Configuration Manager=0D
Protocol Interface.=0D
=0D
- @retval EFI_SUCCESS Success.=0D
- @retval EFI_NOT_FOUND If a mandatory table or a generator is not found.=
=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_NOT_FOUND If a mandatory table or a generator is not=
found.=0D
+ @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo =
is already installed.=0D
**/=0D
STATIC=0D
EFI_STATUS=0D
@@ -562,7 +613,7 @@ ProcessAcpiTables (
if (EFI_ERROR (Status)) {=0D
DEBUG ((=0D
DEBUG_ERROR,=0D
- "ERROR: Failed to find mandatory ACPI Table(s)."=0D
+ "ERROR: Failed to verify mandatory ACPI Table(s) presence."=0D
" Status =3D %r\n",=0D
Status=0D
));=0D
@@ -570,29 +621,32 @@ ProcessAcpiTables (
}=0D
=0D
// Add the FADT Table first.=0D
- for (Idx =3D 0; Idx < AcpiTableCount; Idx++) {=0D
- if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) =3D=3D=0D
- AcpiTableInfo[Idx].TableGeneratorId)=0D
- {=0D
- Status =3D BuildAndInstallAcpiTable (=0D
- TableFactoryProtocol,=0D
- CfgMgrProtocol,=0D
- AcpiTableProtocol,=0D
- &AcpiTableInfo[Idx]=0D
- );=0D
- if (EFI_ERROR (Status)) {=0D
- DEBUG ((=0D
- DEBUG_ERROR,=0D
- "ERROR: Failed to find build and install ACPI FADT Table." \=0D
- " Status =3D %r\n",=0D
- Status=0D
- ));=0D
- return Status;=0D
- }=0D
+ if ((mAcpiVerifyTables[ACPI_TABLE_VERIFY_FADT].Presence & ACPI_TABLE_PRE=
SENT_INSTALLED) =3D=3D 0) {=0D
+ // FADT is not yet installed=0D
+ for (Idx =3D 0; Idx < AcpiTableCount; Idx++) {=0D
+ if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) =3D=3D=0D
+ AcpiTableInfo[Idx].TableGeneratorId)=0D
+ {=0D
+ Status =3D BuildAndInstallAcpiTable (=0D
+ TableFactoryProtocol,=0D
+ CfgMgrProtocol,=0D
+ AcpiTableProtocol,=0D
+ &AcpiTableInfo[Idx]=0D
+ );=0D
+ if (EFI_ERROR (Status)) {=0D
+ DEBUG ((=0D
+ DEBUG_ERROR,=0D
+ "ERROR: Failed to find build and install ACPI FADT Table." \=0D
+ " Status =3D %r\n",=0D
+ Status=0D
+ ));=0D
+ return Status;=0D
+ }=0D
=0D
- break;=0D
- }=0D
- } // for=0D
+ break;=0D
+ }=0D
+ } // for=0D
+ }=0D
=0D
// Add remaining ACPI Tables=0D
for (Idx =3D 0; Idx < AcpiTableCount; Idx++) {=0D
diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableMa=
nagerDxe.inf b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTable=
ManagerDxe.inf
index 028c3d413cf8..ad8b3d037c16 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx=
e.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx=
e.inf
@@ -34,8 +34,12 @@ [LibraryClasses]
UefiBootServicesTableLib=0D
UefiDriverEntryPoint=0D
=0D
+[FeaturePcd]=0D
+ gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol ## CONSUMES=0D
+=0D
[Protocols]=0D
gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED=
=0D
+ gEfiAcpiSdtProtocolGuid # PROTOCOL ALWAYS_CONSUMED=
=0D
=0D
gEdkiiConfigurationManagerProtocolGuid # PROTOCOL ALWAYS_CONSUMED=
=0D
gEdkiiDynamicTableFactoryProtocolGuid # PROTOCOL ALWAYS_CONSUMED=
=0D
--=20
2.37.1.windows.1


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

Kun Qin
 

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

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@...>
Reviewed-by: Sami Mujawar <sami.mujawar@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>
---

Notes:
v2:
- Added Reviewed-by tag [Sami]
- Added Reviewed-by tag [Pierre]
=20=20=20=20
v3:
- No change.

DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | =
78 +++++++++++++++++++-
1 file changed, 75 insertions(+), 3 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTok=
enFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectToke=
nFixer.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;=0D
}=0D
=0D
+/** EArmObjNamedComponent token fixer.=0D
+=0D
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.=0D
+=0D
+ @param [in] CmObject Pointer to the Configuration Manager Object.=0D
+ @param [in] Token Token to be updated in the CmObject.=0D
+=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D
+ @retval EFI_UNSUPPORTED Not supported.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+TokenFixerNamedComponentNode (=0D
+ IN CM_OBJ_DESCRIPTOR *CmObject,=0D
+ IN CM_OBJECT_TOKEN Token=0D
+ )=0D
+{=0D
+ ASSERT (CmObject !=3D NULL);=0D
+ ((CM_ARM_NAMED_COMPONENT_NODE *)CmObject->Data)->Token =3D Token;=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
+/** EArmObjRootComplex token fixer.=0D
+=0D
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.=0D
+=0D
+ @param [in] CmObject Pointer to the Configuration Manager Object.=0D
+ @param [in] Token Token to be updated in the CmObject.=0D
+=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D
+ @retval EFI_UNSUPPORTED Not supported.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+TokenFixerRootComplexNode (=0D
+ IN CM_OBJ_DESCRIPTOR *CmObject,=0D
+ IN CM_OBJECT_TOKEN Token=0D
+ )=0D
+{=0D
+ ASSERT (CmObject !=3D NULL);=0D
+ ((CM_ARM_ROOT_COMPLEX_NODE *)CmObject->Data)->Token =3D Token;=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
+/** EArmObjSmmuV3 token fixer.=0D
+=0D
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.=0D
+=0D
+ @param [in] CmObject Pointer to the Configuration Manager Object.=0D
+ @param [in] Token Token to be updated in the CmObject.=0D
+=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D
+ @retval EFI_UNSUPPORTED Not supported.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+TokenFixerSmmuV3Node (=0D
+ IN CM_OBJ_DESCRIPTOR *CmObject,=0D
+ IN CM_OBJECT_TOKEN Token=0D
+ )=0D
+{=0D
+ ASSERT (CmObject !=3D NULL);=0D
+ ((CM_ARM_SMMUV3_NODE *)CmObject->Data)->Token =3D Token;=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
/** TokenFixer functions table.=0D
=0D
A CmObj having a CM_OBJECT_TOKEN field might need to have its=0D
@@ -90,10 +162,10 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] =3D {
NULL, ///< 16 - Hypervisor Vendor Id=0D
NULL, ///< 17 - Fixed feature flags for FADT=
=0D
TokenFixerItsGroup, ///< 18 - ITS Group=0D
- TokenFixerNotImplemented, ///< 19 - Named Component=0D
- TokenFixerNotImplemented, ///< 20 - Root Complex=0D
+ TokenFixerNamedComponentNode, ///< 19 - Named Component=0D
+ TokenFixerRootComplexNode, ///< 20 - Root Complex=0D
TokenFixerNotImplemented, ///< 21 - SMMUv1 or SMMUv2=0D
- TokenFixerNotImplemented, ///< 22 - SMMUv3=0D
+ TokenFixerSmmuV3Node, ///< 22 - SMMUv3=0D
TokenFixerNotImplemented, ///< 23 - PMCG=0D
NULL, ///< 24 - GIC ITS Identifier Array=0D
NULL, ///< 25 - ID Mapping Array=0D
--=20
2.37.1.windows.1


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

Kun Qin
 

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

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@...>
Reviewed-by: Sami Mujawar <sami.mujawar@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>
---

Notes:
v2:
- Added Reviewed-by tag [Sami]
- Added Reviewed-by tag [Pierre]
=20=20=20=20
v3:
- No change.

DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | =
2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTok=
enFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectToke=
nFixer.c
index 80d0aa17bc1a..84e4bb7e3bc8 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer=
.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer=
.c
@@ -60,7 +60,7 @@ TokenFixerItsGroup (
)=0D
{=0D
ASSERT (CmObject !=3D NULL);=0D
- ((CM_ARM_ITS_GROUP_NODE *)CmObject)->Token =3D Token;=0D
+ ((CM_ARM_ITS_GROUP_NODE *)CmObject->Data)->Token =3D Token;=0D
return EFI_SUCCESS;=0D
}=0D
=0D
--=20
2.37.1.windows.1


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

Kun Qin
 

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

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@...>
Reviewed-by: Sami Mujawar <sami.mujawar@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>
---

Notes:
v2:
- Added Reviewed-by tag [Sami]
- Added Reviewed-by tag [Pierre]
=20=20=20=20
v3:
- No change.

DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf =
| 1 +
1 file changed, 1 insertion(+)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlat=
RepoLib.inf b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPla=
tRepoLib.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]=0D
AcpiHelperLib=0D
BaseLib=0D
+ MemoryAllocationLib=0D
--=20
2.37.1.windows.1


[PATCH v3 0/6] Enhance DynamicTablesPkg modules

Kun Qin
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

This patch series is a follow-up of previous submission:
https://edk2.groups.io/g/devel/message/91926

The main changes between v2 and v3 patches are:
- Added reviewed-by collected from previous iteration
- Added descriptions for newly introduced structures
- Updated functions names

Current DynamicTablesPkg provide great support for creating dynamic ACPI
tables during boot time.

However, there are some modules needs minor tweaks to expand support and
compatibility for OS requirements and platform needs.

This patch series proposes a few fixes to resolve minor issues discovered
in DynamicPlatRepoLib, AcpiSsdtPcieLibArm and DynamicTableManagerDxe.

Patch v3 branch: https://github.com/kuqin12/edk2/tree/dynamic_update_v3

Cc: Sami Mujawar <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>
Cc: Pierre Gondois <pierre.gondois@...>

Kun Qin (6):
DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to inf
DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing
DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers
DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed
tables
DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM
space
DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI
config

DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 214 ++++++++++++--------
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 176 ++++++++++++++++
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | 80 +++++++-
DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 +
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf | 1 +
5 files changed, 391 insertions(+), 84 deletions(-)

--
2.37.1.windows.1


Re: EDK2 build error:Unknown fatal error when processing []

Michael D Kinney
 

You should pass in .dsc file, not .dec file for -p  option of build.

 

Mike

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of np l
Sent: Saturday, July 30, 2022 7:02 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2 build error:Unknown fatal error when processing []

 

Hi,

I got a fatal error with a command "build -p edk2\MdeModulePkg\MdeModulePkg.dec -a X64 -t VS2015x86".

(Python version is  2.7.15.Build tool is VS2015x86)

   But  UEFI\edk2\EmulatorPkg\EmulatorPkg.dec can be build successfully.

   I have update edk2 with "git pull" but the same error occured. 

   I also test it in another laptop with python  version 3.9.9 build tool VS2019,a same error occur.

 

What should I do?

 

error log as blow:

 

Thanks!

 

4621 - 4640 of 96543