RFR: 8374926: EnableX86ECoreOpts was not enabled on some hybrid CPU [v3]
Yasumasa Suenaga
ysuenaga at openjdk.org
Wed Jan 14 05:31:46 UTC 2026
On Wed, 14 Jan 2026 04:23:19 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'origin/master' into ecoreopt-hybrid
>> - Merge remote-tracking branch 'origin/master' into ecoreopt-hybrid
>> - Use supports_hybrid() to check for EnableX86ECoreOpts
>> - Add comments for CPU models
>
> src/hotspot/cpu/x86/vm_version_x86.cpp line 924:
>
>> 922: // Check if processor has Intel Ecore
>> 923: if (FLAG_IS_DEFAULT(EnableX86ECoreOpts) && is_intel() && is_intel_server_family() &&
>> 924: (supports_hybrid() ||
>
> It is not easy to determine if a listed model number will report as "hybrid". But from what I can find 0xDD is:
>
> #define INTEL_ATOM_DARKMONT_X IFM(6, 0xDD) /* Clearwater Forest */
>
> which is E-Core architecture, like Sierra Forest, not a hybrid.
>
> Is there something else in CPUID we can read to determine the presence of E-Core and so avoid still needing hard-coded lists that need to be maintained?
I checked Chapter 21 in [SDM vol.1](https://cdrdv2.intel.com/v1/dl/getContent/671436), but I couldn't find out the flag which can be used for checking E-Core. However I think we can use CORE_TYPE from CPUID Leaf 1Ah (Native Model ID Enumeration).
CORE_TYPE reports tye type of logical processor issued `CPUID` instruction. If it runs on all E-Core architecture like Sierra Forest, CORE_TYPE should report 20h (Atom), and then we can determine we can set `EnableX86ECoreOpts`.
I've made an example to check CORE_TYPE, and I think similar logic can be implemented on HotSpot. Is it reasonable? I can add it if it sounds good.
https://github.com/YaSuenag/garakuta/blob/master/check-hybrid-cores/hy-core-check.c#L97-L128
asm volatile(
"movl $0x1A, %%eax\n"
"xorl %%ecx, %%ecx\n"
"cpuid"
: "=a"(core_info) : : "ebx", "ecx", "edx"
);
<snip>
int core_type = core_info >> 24;
<snip>
printf("logical processor domain = %d, core domain = %d, type = 0x%x, native model id = 0x%x\n", logical_processors, cores, core_type, native_model_id);
On hybrid CPU, we don't know where `CPUID` is issued (without pinning), it means we can see "Core" (P-Core) in some case, but we can use hybrid flag which is already introduced in HotSpot to determine E-Core exists.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29149#discussion_r2689015303
More information about the hotspot-dev
mailing list