Re: [PATCH V11 14/47] UefiCpuPkg: Enable Tdx support in MpInitLib

Ni, Ray

+ CopyMem (ProcessorInfoBuffer, &gTdxProcessorInformation, sizeof (EFI_PROCESSOR_INFORMATION));

You may not directly copy the whole structure to ProcessorInfoBuffer.

Because per the structure definition(below), ExtendedInformation is only filled when
CPU_V2_EXTENDED_TOPOLOGY is set in ProcessorNumber.

This behavior is to be backward compatible with old caller that passes old structure (without ExtendedInformation)
and support new caller that passes new structure requiring ExtendedInformation.

So, the correct behavior is to only fill ExtendedInformation when CPU_V2_EXTENDED_TOPOLOGY is set in ProcessorNumber.
The CPU_V2_EXTENDED_TOPOLOGY is a flag to tell callee that caller provides a big enough buffer for ExtendedInformation.

UINT32 StatusFlag;
/// The physical location of the processor, including the physical package number
/// that identifies the cartridge, the physical core number within package, and
/// logical thread number within core.
/// The extended information of the processor. This field is filled only when
/// CPU_V2_EXTENDED_TOPOLOGY is set in parameter ProcessorNumber.

Join to automatically receive all group messages.