RFR: 8353572: x86: AMD platforms miss the check for CLWB feature flag [v2]

Vladimir Ivanov vlivanov at openjdk.org
Wed Apr 9 17:40:39 UTC 2025


On Wed, 9 Apr 2025 09:49:01 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Noticed this when doing [JDK-8353558](https://bugs.openjdk.org/browse/JDK-8353558). We only check for CLWB feature flag for Intel platforms. But AMD APM (Rev. 3.36—March 2024) tells me there is a CLWB flag in CPUID Fn0000_0007_EBX_x0 leaf as well. It is in the same place as the flag for Intel.
>> 
>> Additional testing:
>>  - [x] Ad-hoc tests on Ryzen 5950X
>
> Aleksey Shipilev 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 three additional commits since the last revision:
> 
>  - More feature flag commonning
>  - Merge branch 'master' into JDK-8353572-amd-clwb
>  - Fix

src/hotspot/cpu/x86/vm_version_x86.cpp line 3118:

> 3116:     // We do not know if these are supported by ZX,
> 3117:     // so we cannot trust common CPUID bit for it.
> 3118:     result &= ~CPU_CLWB;

I'd prefer to completely drop this adjustment, but if you do want to keep it, I'd add an assert (and/or a warning?) to fire when CLWB bit is present on ZX CPUs.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24385#discussion_r2035832615


More information about the hotspot-dev mailing list