[crac] RFR: Support -XX:+IgnoreCPUFeatures during -XX:CRaCRestoreFrom [v3]

Jan Kratochvil jkratochvil at openjdk.org
Mon Aug 14 09:41:28 UTC 2023


On Wed, 9 Aug 2023 20:00:27 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Jan Kratochvil has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>> 
>>  - Implement -XX:+IgnoreCPUFeatures
>>  - Merge branch 'crac' into crac-restoreignore
>>  - Split off crac_restore_finalize() from crac_restore().
>>  - Document -XX:CPUFeatures=ignore, reject !ignore during -XX:CRaCRestoreFrom
>>  - Support -XX:CPUFeatures=ignore during -XX:CRaCRestoreFrom
>
> src/hotspot/cpu/x86/vm_version_x86.cpp line 1219:
> 
>> 1217:   }
>> 1218:   return !*a && !*b;
>> 1219: }
> 
> Compiler can inline a call to strcmp if it recognizes the pattern, so this is not really safe. And since we are calling the argument check after VM_Crac::read_shm, it's a bit late to worry about libc... It may be just fine to leave the one who are give up the safety with possible crashes.

That was a gross mistake in this patch, I have fixed it so that it no longer crashes. That was the whole effort of the original patch so that it does not crash without any error if it is being restored on under-featured CPU.

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

PR Review Comment: https://git.openjdk.org/crac/pull/100#discussion_r1293217434


More information about the crac-dev mailing list