public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: "Jeff Brasen (jbrasen@nvidia.com)" <jbrasen@nvidia.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "ardb+tianocore@kernel.org" <ardb+tianocore@kernel.org>,
	"quic_llindhol@quicinc.com" <quic_llindhol@quicinc.com>,
	nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v2] ArmPkg/ProcessorSubClassDxe: Limit counts to 0xFF
Date: Tue, 6 Feb 2024 17:24:50 +0000	[thread overview]
Message-ID: <E46F556E-53DD-4FC4-B5EF-F0A83E4118BA@arm.com> (raw)
In-Reply-To: <4268474daea2f8a4b7756c8182ea305278675478.1707233024.git.jbrasen@nvidia.com>

Hi Jeff,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 06/02/2024, 15:25, "Jeff Brasen" <jbrasen@nvidia.com <mailto:jbrasen@nvidia.com>> wrote:


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 <mailto:jbrasen@nvidia.com>>
---
.../ProcessorSubClassDxe/ProcessorSubClass.c | 42 +++++++++++++------
1 file changed, 30 insertions(+), 12 deletions(-)


diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index 9050588500..abb4c726de 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -702,19 +702,37 @@ AddSmbiosProcessorTypeTable (


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


- *LegacyVoltage = MiscProcessorData.Voltage;
- Type4Record->CurrentSpeed = MiscProcessorData.CurrentSpeed;
- Type4Record->MaxSpeed = MiscProcessorData.MaxSpeed;
- Type4Record->Status = ProcessorStatus.Data;
- Type4Record->L1CacheHandle = L1CacheHandle;
- Type4Record->L2CacheHandle = L2CacheHandle;
- Type4Record->L3CacheHandle = L3CacheHandle;
- Type4Record->CoreCount = MiscProcessorData.CoreCount;
- Type4Record->CoreCount2 = MiscProcessorData.CoreCount;
- Type4Record->EnabledCoreCount = MiscProcessorData.CoresEnabled;
+ *LegacyVoltage = MiscProcessorData.Voltage;
+ Type4Record->CurrentSpeed = MiscProcessorData.CurrentSpeed;
+ Type4Record->MaxSpeed = MiscProcessorData.MaxSpeed;
+ Type4Record->Status = ProcessorStatus.Data;
+ Type4Record->L1CacheHandle = L1CacheHandle;
+ Type4Record->L2CacheHandle = L2CacheHandle;
+ Type4Record->L3CacheHandle = L3CacheHandle;
+
+ if (MiscProcessorData.CoreCount > 255) {
+ Type4Record->CoreCount = 0xFF;
+ } else {
+ Type4Record->CoreCount = MiscProcessorData.CoreCount;
+ }
+
+ Type4Record->CoreCount2 = MiscProcessorData.CoreCount;
+
+ if (MiscProcessorData.CoresEnabled > 255) {
+ Type4Record->EnabledCoreCount = 0xFF;
+ } else {
+ Type4Record->EnabledCoreCount = MiscProcessorData.CoresEnabled;
+ }
+
Type4Record->EnabledCoreCount2 = MiscProcessorData.CoresEnabled;
- Type4Record->ThreadCount = MiscProcessorData.ThreadCount;
- Type4Record->ThreadCount2 = MiscProcessorData.ThreadCount;
+
+ if (MiscProcessorData.ThreadCount > 255) {
+ Type4Record->ThreadCount = 0xFF;
+ } else {
+ Type4Record->ThreadCount = MiscProcessorData.ThreadCount;
+ }
+
+ Type4Record->ThreadCount2 = MiscProcessorData.ThreadCount;


Type4Record->CurrentSpeed = GetCpuFrequency (ProcessorIndex);
Type4Record->ExternalClock =
-- 
2.34.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115184): https://edk2.groups.io/g/devel/message/115184
Mute This Topic: https://groups.io/mt/104199497/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



      reply	other threads:[~2024-02-06 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 15:24 [edk2-devel] [PATCH v2] ArmPkg/ProcessorSubClassDxe: Limit counts to 0xFF Jeff Brasen via groups.io
2024-02-06 17:24 ` Sami Mujawar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E46F556E-53DD-4FC4-B5EF-F0A83E4118BA@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox