RFR(XXS): JDK-8007069 VM_Version_x86 cores per cpu is wrong for cpuid 0xb topology case

Markus Grönlund markus.gronlund at oracle.com
Wed Jan 30 09:45:16 PST 2013


Hi Mikael,

I wonder if you are looking at the right section in the manual (and which manual?) here? 

I am using information in Intel Application note 485:

http://www.intel.com/content/www/us/en/processors/processor-identification-cpuid-instruction-note.html

Section 5.1.12 page 41 describes CPUID 0xb. Essentially, together with EAX=0xb, you pass in subleafs (0, 1, 2...) in ECX for the different levels in the cpu topology you are interested in. Results are given in EBX[15:0] [31:16] == reserved.


"There's also a cores_per_cpu in CPUID 04h EAX[31:26] (aka. dcp_cpuid4_eax.bits.cores_per_cpu), do you happen to know what the difference is? Is that maybe a better candidate for this?"

CPUID04 EAX[31:26] is giving you the number of cores [per cpu package] using the legacy "initial APICID (8-bits)" systems. This combined with CPUID 01[logical threads per cpu package] is the legacy way of cpu identification. It is cannot give you as much info as topology however.

Processors supporting CPUID 0xb is using 3-level 2xAPICID (32-bit) for identification (SMT, Core, Pkg), and does not use "initial APICID".

So:

EAX=0xb, ECX=0 == EBX[15:0] == no_of_logical_threads_per_core == (stored in _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus)
EAX=0xb, ECX=1 == EBX[15:0] == no_of_cores_per_pkg == (stored in _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus)
...

Hope this clarifies

Cheers
Markus





-----Original Message-----
From: Mikael Vidstedt 
Sent: den 30 januari 2013 17:30
To: Markus Grönlund
Cc: hotspot-dev at openjdk.java.net
Subject: Re: RFR(XXS): JDK-8007069 VM_Version_x86 cores per cpu is wrong for cpuid 0xb topology case


Looking at the Intel manual for CPUID 0Bh it basically says that one should not use the value in EBX[15:0] for anything other than "...display/diagnostic purposes". There's also a cores_per_cpu in CPUID 04h EAX[31:26] (aka. dcp_cpuid4_eax.bits.cores_per_cpu), do you happen to know what the difference is? Is that maybe a better candidate for this?

Cheers,
Mikael

On 1/29/2013 2:10 AM, Markus Grönlund wrote:
> Hi again,
>
> Apologies for posting the wrong webrev link, this is the one I wanted to submit:
>
> Bug: https://jbs.oracle.com/bugs/browse/JDK-8007069
> Webrev:  http://cr.openjdk.java.net/~mgronlun/8007069/webrev01/
>
>
> Thanks Mikael for the heads up
>
> Cheers
> Markus
>
>
>
> -----Original Message-----
> From: Mikael Gerdin
> Sent: den 29 januari 2013 10:59
> To: Markus Grönlund
> Cc: hotspot-dev at openjdk.java.net
> Subject: Re: RFR(XXS): JDK-8007069 VM_Version_x86 cores per cpu is 
> wrong for cpuid 0xb topology case
>
> Markus,
>
> On 2013-01-29 10:54, Markus Grönlund wrote:
>> Hi all,
>>
>>
>>
>> Kindly asking for review for the following very simple change in the logic for number of cores for CPUID 0xb topology.
>>
>>
>>
>> Bug: https://jbs.oracle.com/bugs/browse/JDK-8007069
>>
>> Webrev:  
>> http://wikifiles.se.oracle.com/dev/mgronlun/webrevs/8007069/webrev01/
> This URL is not available from outside Oracle.
>
> /Mikael
>
>>
>>
>> Also need someone to sponsor this putback.
>>
>>
>>
>> Thanks in advance
>>
>> Markus
>>



More information about the hotspot-dev mailing list