Skip to content

Commit 944835f

Browse files
committed
ArmPkg/ProcessorSubClassDxe: Limit CoreCount to 0xFF
The CoreCount and EnabledCore counts should be set to 0xFF if value is greater than 255 per the SMBIOS specification. Signed-off-by: Jeff Brasen <[email protected]> Change-Id: I8e3e6e519d4444575a4573d24ac0d291aec532f0 Reviewed-on: https://git-master.nvidia.com/r/c/3rdparty/edk2/+/2828322 Reviewed-by: svcacv <[email protected]> Reviewed-by: Nick Ramirez <[email protected]> GVS: Gerrit_Virtual_Submit <[email protected]> (cherry picked from commit 2a5998a59dada5d04824ce28f8d039c3ba5a6a30) Reviewed-on: https://git-master.nvidia.com/r/c/3rdparty/edk2/+/2832413 Reviewed-by: svc-sw-mobile-l4t <[email protected]> Reviewed-by: Ashish Singhal <[email protected]> Tested-by: Ashish Singhal <[email protected]>
1 parent 97c3f5b commit 944835f

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -702,19 +702,32 @@ AddSmbiosProcessorTypeTable (
702702

703703
LegacyVoltage = (UINT8 *)&Type4Record->Voltage;
704704

705-
*LegacyVoltage = MiscProcessorData.Voltage;
706-
Type4Record->CurrentSpeed = MiscProcessorData.CurrentSpeed;
707-
Type4Record->MaxSpeed = MiscProcessorData.MaxSpeed;
708-
Type4Record->Status = ProcessorStatus.Data;
709-
Type4Record->L1CacheHandle = L1CacheHandle;
710-
Type4Record->L2CacheHandle = L2CacheHandle;
711-
Type4Record->L3CacheHandle = L3CacheHandle;
712-
Type4Record->CoreCount = MiscProcessorData.CoreCount;
713-
Type4Record->CoreCount2 = MiscProcessorData.CoreCount;
714-
Type4Record->EnabledCoreCount = MiscProcessorData.CoresEnabled;
705+
*LegacyVoltage = MiscProcessorData.Voltage;
706+
Type4Record->CurrentSpeed = MiscProcessorData.CurrentSpeed;
707+
Type4Record->MaxSpeed = MiscProcessorData.MaxSpeed;
708+
Type4Record->Status = ProcessorStatus.Data;
709+
Type4Record->L1CacheHandle = L1CacheHandle;
710+
Type4Record->L2CacheHandle = L2CacheHandle;
711+
Type4Record->L3CacheHandle = L3CacheHandle;
712+
713+
if (MiscProcessorData.CoreCount > 255) {
714+
Type4Record->CoreCount = 0xFF;
715+
} else {
716+
Type4Record->CoreCount = MiscProcessorData.CoreCount;
717+
}
718+
719+
Type4Record->CoreCount2 = MiscProcessorData.CoreCount;
720+
721+
if (MiscProcessorData.CoresEnabled > 255) {
722+
Type4Record->EnabledCoreCount = 0xFF;
723+
} else {
724+
Type4Record->EnabledCoreCount = MiscProcessorData.CoresEnabled;
725+
}
726+
715727
Type4Record->EnabledCoreCount2 = MiscProcessorData.CoresEnabled;
716-
Type4Record->ThreadCount = MiscProcessorData.ThreadCount;
717-
Type4Record->ThreadCount2 = MiscProcessorData.ThreadCount;
728+
729+
Type4Record->ThreadCount = MiscProcessorData.ThreadCount;
730+
Type4Record->ThreadCount2 = MiscProcessorData.ThreadCount;
718731

719732
Type4Record->CurrentSpeed = GetCpuFrequency (ProcessorIndex);
720733
Type4Record->ExternalClock =

0 commit comments

Comments
 (0)