From: "Gerd Hoffmann" <kraxel@redhat.com>
To: Abdul Lateef Attar <abdattar@amd.com>
Cc: devel@edk2.groups.io,
Abdul Lateef Attar <AbdulLateef.Attar@amd.com>,
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 10:41:07 +0100 [thread overview]
Message-ID: <kru4vaurfhn3kmtaqadquqsozj5inkdzeszwffvafz6mtf4yqx@mhwyhvxkxm4g> (raw)
In-Reply-To: <030184fe0cac804e7f3c98569ebedaf67c71fc50.1705387772.git.AbdulLateef.Attar@amd.com>
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 (#113882): https://edk2.groups.io/g/devel/message/113882
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]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-01-16 9:41 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 [this message]
2024-01-16 13:14 ` Abdul Lateef Attar via groups.io
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=kru4vaurfhn3kmtaqadquqsozj5inkdzeszwffvafz6mtf4yqx@mhwyhvxkxm4g \
--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