public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abdul Lateef Attar via groups.io" <AbdulLateef.Attar=amd.com@groups.io>
To: Gerd Hoffmann <kraxel@redhat.com>, Abdul Lateef Attar <abdattar@amd.com>
Cc: devel@edk2.groups.io, Ray Ni <ray.ni@intel.com>,
	Rahul Kumar <rahul1.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/BaseXApicX2ApicLib: Implements AMD extended cpu topology
Date: Tue, 16 Jan 2024 18:44:09 +0530	[thread overview]
Message-ID: <8c473d92-86de-43af-8a45-ee145eab2e8b@amd.com> (raw)
In-Reply-To: <kru4vaurfhn3kmtaqadquqsozj5inkdzeszwffvafz6mtf4yqx@mhwyhvxkxm4g>

Thanks Gerd for providing the inputs.

I'll enhance the logic accordingly and submit the V2 patch.

Thanks

AbduL

On 16-01-2024 15:11, Gerd Hoffmann wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Tue, Jan 16, 2024 at 12:31:21PM +0530, Abdul Lateef Attar wrote:
>> From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
>>
>> This patch adds support for AMD's new extended topology.
>> If processor supports CPUID 80000026 leaf then obtain
>> the topology information using new method.
>> +  /// Check if extended toplogy supported
>> +  AsmCpuid (CPUID_EXTENDED_FUNCTION, &MaxExtendedCpuIdIndex, NULL, NULL, NULL);
>> +  if (MaxExtendedCpuIdIndex < AMD_CPUID_EXTENDED_TOPOLOGY) {
>> +    GetProcessorLocationByApicId (InitialApicId, Package, Core, Thread);
>> +    return;
>> +  }
> Sure this is correct?
>
> On Intel processors checking MaxExtendedCpuIdIndex alone is not enough,
> see commit 170d4ce8e90a ("UefiCpuPkg/BaseXApicX2ApicLib: fix
> CPUID_V2_EXTENDED_TOPOLOGY detection")
>
> Especially in virtual machines it can happen that the vCPU supports
> extended cpuid leaf N but does not support N-1, so checking
> MaxExtendedCpuIdIndex alone looks rather fragile to me.
>
> take care,
>    Gerd
>


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



  reply	other threads:[~2024-01-16 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  7:01 [edk2-devel] [PATCH v1 0/2] AMD CPU extended topology Abdul Lateef Attar via groups.io
2024-01-16  7:01 ` [edk2-devel] [PATCH v1 1/2] MdePkg: Adds AMD Extended CPU topology CPUID Abdul Lateef Attar via groups.io
2024-01-16  7:01 ` [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/BaseXApicX2ApicLib: Implements AMD extended cpu topology Abdul Lateef Attar via groups.io
2024-01-16  9:41   ` Gerd Hoffmann
2024-01-16 13:14     ` Abdul Lateef Attar via groups.io [this message]
2024-01-17  2:15   ` Ni, Ray

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=8c473d92-86de-43af-8a45-ee145eab2e8b@amd.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