RFR: 8345296: AArch64: VM crashes with SIGILL when prctl is disallowed [v2]
Evgeny Astigeevich
eastigeevich at openjdk.org
Mon Dec 2 15:47:45 UTC 2024
On Mon, 2 Dec 2024 14:17:45 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/vm_version_aarch64.cpp line 453:
>>
>>> 451: } else {
>>> 452: _initial_sve_vector_length = vl;
>>> 453: }
>>
>> I think we need to disable SVE in `VM_Version::get_os_cpu_info` in `src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp`:
>>
>>
>> if (auxv2 & HWCAP2_SVE2) _features |= CPU_SVE2;
>> if (auxv2 & HWCAP2_SVEBITPERM) _features |= CPU_SVEBITPERM;
>>
>> if (prctl(PR_SVE_GET_VL) == -1) {
>> warning("Unable to get SVE vector length on this system. Disabling SVE.");
>> _features &= ~CPU_SVE;
>> }
>
> I think this part later in the same method does the sync for us already:
> https://github.com/openjdk/jdk/blob/b8233989e7605268dda908e6b639ca373789792b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp#L590-L597
Maybe it's worth to move your new code under IF at line 518?
if (UseSVE > 0) {
int vl = get_current_sve_vector_length();
if ((FLAG_IS_DEFAULT(MaxVectorSize)) {
MaxVectorSize = vl;
}
if (vl < 0) {
warning("Unable to get SVE vector length on this system. Disabling SVE. Specify -XX:UseSVE=0 to avoid this warning.");
FLAG_SET_DEFAULT(UseSVE, 0);
} else if (MaxVectorSize < FloatRegister::sve_vl_min) {
...
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22479#discussion_r1866087358
More information about the hotspot-dev
mailing list