[edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in MpInitLib

Laszlo Ersek lersek at redhat.com
Wed Feb 26 16:20:43 UTC 2020


On 02/26/20 16:46, Duran, Leo wrote:
> BTW,
> 
> I also considered adding a flag to CPU_MP_DATA to make the usage of PlatformId a bit more explicit.
> E.g., something like CpuMpData->CpuData[ProcessorNumber].IsValidPlatformId... So the init code would look like this:
> 
>   //
>   // NOTE: PlatformId is not relevant on AMD platforms.
>   //
>   if (StandardSignatureIsAuthenticAMD ()) {
>     CpuMpData->CpuData[ProcessorNumber].IsValidPlatformId = FALSE;
>   else {
>     PlatformIdMsr.Uint64 = AsmReadMsr64 (MSR_IA32_PLATFORM_ID);
>     CpuMpData->CpuData[ProcessorNumber].PlatformId = (UINT8)PlatformIdMsr.Bits.PlatformId;
>     CpuMpData->CpuData[ProcessorNumber].IsValidPlatformId = TRUE;
>   }
> 
> This way "IsValidPlatformId" could be checked prior to using "PlatformId".
> Anyway, that seemed a bit overkill, so I opted against it... thoughts?

I think a global flag is justified; in the above approach,
"IsValidPlatformId" would not vary across "ProcessorNumber", so it does
look like useless generality.

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54889): https://edk2.groups.io/g/devel/message/54889
Mute This Topic: https://groups.io/mt/71541516/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list