[crac] RFR: 8368929: [CRaC] Move CPUFeatures check to C/R engine
Radim Vansa
rvansa at openjdk.org
Wed Oct 1 12:24:53 UTC 2025
On Wed, 1 Oct 2025 08:45:57 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> Right now the logic checking if CPU features used before checkpoint match current CPU features is in VM code. VM stores and retrieves CPU features through C/R API's user_data extension. This is convenient when we have a single image that can be either accepted or rejected, but does not offer the flexibility for C/R engine to select the best image for current execution environment.
>>
>> The goal of this issue is to move to a declarative API that will express the requirements using more abstract means, labels (for CPU architecture) and bitmaps (for CPU features).
>
> src/hotspot/share/runtime/crac.cpp line 527:
>
>> 525: // Since the check itself is delegated to the C/R Engine we will simply
>> 526: // skip the check here (or prevent storing the features in the image).
>> 527: #ifdef __x86_64__
>
> One should not use `#ifdef` as it may lead to compilation errors on other arches.
How is this different from creating an arch-specific method with different implementations? To me that look just like a boilerplate (and the presence is only checked for currently compiled arch - so I won't make sure that the code work on all archs).
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/266#discussion_r2394387387
More information about the crac-dev
mailing list