summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorJeff Brasen <jbrasen@nvidia.com>2022-12-14 23:07:06 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-06-17 12:09:43 +0000
commit9fc61309bf56aa7863e36b8f418a49ca6d8364d0 (patch)
treed000b1a8194389425e39c7b5cc7a991705d01b79 /ArmPkg
parent587100a95d7bfddc60bc5699ae0cca45914f1d81 (diff)
downloadedk2-9fc61309bf56aa7863e36b8f418a49ca6d8364d0.tar.gz
edk2-9fc61309bf56aa7863e36b8f418a49ca6d8364d0.tar.bz2
edk2-9fc61309bf56aa7863e36b8f418a49ca6d8364d0.zip
ArmPkg/ProcessorSubClassDxe: Limit values to 0xFF
The CoreCount, EnabledCore and ThreadCount counts should be set to 0xFF if value is greater than 255 per the SMBIOS specification. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index 9050588500..4f2d421337 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -709,11 +709,11 @@ AddSmbiosProcessorTypeTable (
Type4Record->L1CacheHandle = L1CacheHandle;
Type4Record->L2CacheHandle = L2CacheHandle;
Type4Record->L3CacheHandle = L3CacheHandle;
- Type4Record->CoreCount = MiscProcessorData.CoreCount;
+ Type4Record->CoreCount = MIN (MiscProcessorData.CoreCount, MAX_UINT8);
Type4Record->CoreCount2 = MiscProcessorData.CoreCount;
- Type4Record->EnabledCoreCount = MiscProcessorData.CoresEnabled;
+ Type4Record->EnabledCoreCount = MIN (MiscProcessorData.CoresEnabled, MAX_UINT8);
Type4Record->EnabledCoreCount2 = MiscProcessorData.CoresEnabled;
- Type4Record->ThreadCount = MiscProcessorData.ThreadCount;
+ Type4Record->ThreadCount = MIN (MiscProcessorData.ThreadCount, MAX_UINT8);
Type4Record->ThreadCount2 = MiscProcessorData.ThreadCount;
Type4Record->CurrentSpeed = GetCpuFrequency (ProcessorIndex);