[crac] RFR: 8355974: [CRaC] Move CPUFeatures verification to the parent process of JVM [v8]
Timofei Pushkin
tpushkin at openjdk.org
Wed Apr 30 18:08:06 UTC 2025
On Wed, 30 Apr 2025 15:23:45 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> There was originally a mistake:
>> - restoring JVM did restore the image
>> - the restored JVM started checking whether CPU Features of the new host >= CPU Features of the checkpoint host
>>
>> That is difficult as glibc is already configured (IFUNC) in the image for the checkpoint host and calling any such glibc functions in the restored image will crash (as the advanced instructions from misconfigured IFUNC are not available). Some glibc functions had to be reimplemented in a dummy way inside JVM due to this misdesign.
>>
>> This patch changes it to:
>> - restoring JVM checks `cpufeatures` user data in the image against current CPU Features
>> - the restored JVM is started only if the CPU Features are satisfied, restored JVM no longer has to verify anything
>>
>> The patch is a bit of a kitchen sink, there are various improvements of the CPU Features code.
>
> Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:
>
> Refactor cpufeatures_check/cpufeatures_load etc.
src/hotspot/share/runtime/crac.cpp line 532:
> 530: }
> 531: if (!VM_Version::cpu_features_binary_check(present ? &data : nullptr)) {
> 532: log_error(crac)("Image %s has incompatible CPU features in its user data %s", CRaCRestoreFrom, engine.cpufeatures_userdata_name);
I think the user doesn't really need to know the name of the user data in this case, just that the image is incompatible with their CPU. Omitting this would also allow making `cpufeatures_userdata_name` a .cpp static as it was before.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/227#discussion_r2069204397
More information about the crac-dev
mailing list