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

Min Xu

On March 28, 2022 4:25 PM, Ni Ray wrote:

+ CopyMem (ProcessorInfoBuffer, &gTdxProcessorInformation, sizeof

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.
Thanks much for the review comments. It will be fixed in the next version.

UINT32 StatusFlag;
/// The physical location of the processor, including the physical package
/// 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.