qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 3/3] acpi: cpuhp: add CPHP_GET_CPU_ID_CMD command


From: Laszlo Ersek
Subject: Re: [RFC 3/3] acpi: cpuhp: add CPHP_GET_CPU_ID_CMD command
Date: Fri, 11 Oct 2019 10:07:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 10/10/19 21:26, Eduardo Habkost wrote:

> Topology info is already available on CPUID.

Independently of everything else, thanks for pointing this out.

The edk2 library called "LocalApicLib" has two relevant functions:

> /**
>   Get Package ID/Core ID/Thread ID of a processor.
>
>   The algorithm assumes the target system has symmetry across physical
>   package  boundaries with respect to the number of logical processors
>   per package,  number of cores per package.
>
>   @param[in]  InitialApicId  Initial APIC ID of the target logical processor.
>   @param[out]  Package       Returns the processor package ID.
>   @param[out]  Core          Returns the processor core ID.
>   @param[out]  Thread        Returns the processor thread ID.
> **/
> VOID
> EFIAPI
> GetProcessorLocationByApicId (
>   IN  UINT32  InitialApicId,
>   OUT UINT32  *Package  OPTIONAL,
>   OUT UINT32  *Core    OPTIONAL,
>   OUT UINT32  *Thread  OPTIONAL
>   );
>
> /**
>   Get Package ID/Module ID/Tile ID/Die ID/Core ID/Thread ID of a processor.
>
>   The algorithm assumes the target system has symmetry across physical
>   package boundaries with respect to the number of threads per core, number of
>   cores per module, number of modules per tile, number of tiles per die, 
> number
>   of dies per package.
>
>   @param[in]   InitialApicId Initial APIC ID of the target logical processor.
>   @param[out]  Package       Returns the processor package ID.
>   @param[out]  Die           Returns the processor die ID.
>   @param[out]  Tile          Returns the processor tile ID.
>   @param[out]  Module        Returns the processor module ID.
>   @param[out]  Core          Returns the processor core ID.
>   @param[out]  Thread        Returns the processor thread ID.
> **/
> VOID
> EFIAPI
> GetProcessorLocation2ByApicId (
>   IN  UINT32  InitialApicId,
>   OUT UINT32  *Package  OPTIONAL,
>   OUT UINT32  *Die      OPTIONAL,
>   OUT UINT32  *Tile     OPTIONAL,
>   OUT UINT32  *Module   OPTIONAL,
>   OUT UINT32  *Core     OPTIONAL,
>   OUT UINT32  *Thread   OPTIONAL
>   );

They are implemented with heavy CPUID usage.

So... just give me the APIC-ID. That's the primary key in edk2 for identifying
x86 processors.

Thanks
Laszlo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]