RFR: Store cpu features in AOTCodeCache header
Vladimir Kozlov
kvn at openjdk.org
Sun Jul 13 19:48:55 UTC 2025
On Fri, 4 Jul 2025 20:30:45 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
> This is the initial version of storing cpu features in the AOTCodeCache to verify runtime env has the same cpu capabilities as the assembly env. It covers both x86 and aarch64.
> AOTCodeCache header is updated to store the cpu features in arch-dependent form (although its same for currently supported architectures - x86 and aarch64).
>
> It also fixes a bug - the `polling_page_vectors_safepoint_handler_blob` can be null if AVX is not present on a system. This causes crash as this blob's entry point is stored in the address table.
> I came across this when I did the assembly run with -XX:UseAVX=0 option.
I have few comments.
src/hotspot/cpu/x86/vm_version_x86.hpp line 373:
> 371: decl(FXSR, fxsr, 2) \
> 372: decl(HT, ht, 3) \
> 373: \
Please, revert alignment change to reduce size of changes. We can do it in mainline later.
src/hotspot/share/code/aotCodeCache.cpp line 653:
> 651: _gc = (uint)Universe::heap()->kind();
> 652: _cpu_features_size = (uint)VM_Version::cpu_features_size();
> 653: void* cpu_features_buffer = (void*)(this+1);
I don't like. Store it in separate space and reference (offset in archive) it from Config.
src/hotspot/share/code/aotCodeCache.cpp line 3253:
> 3251: #ifdef COMPILER2
> 3252: // polling_page_vectors_safepoint_handler_blob can be nullptr if AVX feature is not present or is disabled
> 3253: if (SharedRuntime::polling_page_vectors_safepoint_handler_blob() != nullptr) {
I will push this separately.
src/hotspot/share/code/aotCodeCache.hpp line 273:
> 271: AOTCodeAddressTable() :
> 272: _extrs_addr(nullptr),
> 273: _stubs_addr(nullptr),
I pushed it already into premain.
-------------
PR Review: https://git.openjdk.org/leyden/pull/84#pullrequestreview-3014291728
PR Review Comment: https://git.openjdk.org/leyden/pull/84#discussion_r2203503575
PR Review Comment: https://git.openjdk.org/leyden/pull/84#discussion_r2203505000
PR Review Comment: https://git.openjdk.org/leyden/pull/84#discussion_r2203503980
PR Review Comment: https://git.openjdk.org/leyden/pull/84#discussion_r2203505373
More information about the leyden-dev
mailing list