[crac] RFR: 8373781: [CRaC] Permit -XX:CPUFeatures on other platforms [v5]

Timofei Pushkin tpushkin at openjdk.org
Tue Jan 6 13:36:34 UTC 2026


On Mon, 5 Jan 2026 15:28:06 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> Currently `-XX:CPUFeatures` option is available only on `x86_64`. This complicates creating multiarch container images that are meant to be universally runnable (with `-XX:CPUFeatures=generic`).
>> 
>> I propose to make this option available on all architectures, with the non-arch specific values:
>> * `generic`
>> * `native`
>> * `ignore`
>> 
>> The implementation on non-x86_64 will only validate the sanity of the value.
>> 
>> The related option `-XX:+ShowCPUFeatures` will print an informative message (saying that the option does not make much sense).
>> 
>> `-XX:+IgnoreCPUFeatures` will be permitted as well, but it will be a no-op on the other architectures.
>
> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fail on x86 non-Linux with not recognized CPUFeatures pattern

Just two minor things, since you are planning a follow-up maybe it'll be easier/faster to fix them there

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

> 954:   vm_exit_during_initialization(err_msg("VM option 'CPUFeatures=%s' must be of the form: %s", str_orig, buf + 1));
> 955:   return {};
> 956: #endif

I'd prefer to have either `#endif // LINUX` or `#endif // !LINUX` — there is a lot of ifdef-s around so it's a bit harder to read without such comments

test/jdk/jdk/crac/CPUFeatures/SimpleCPUFeaturesTest.java line 2:

> 1: /*
> 2:  * Copyright (c) 2023,2025, Azul Systems, Inc. All rights reserved.

Suggestion:

 * Copyright (c) 2023, 2025, Azul Systems, Inc. All rights reserved.

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

Marked as reviewed by tpushkin (Committer).

PR Review: https://git.openjdk.org/crac/pull/282#pullrequestreview-3630898922
PR Review Comment: https://git.openjdk.org/crac/pull/282#discussion_r2664927506
PR Review Comment: https://git.openjdk.org/crac/pull/282#discussion_r2664932337


More information about the crac-dev mailing list