Skip to content

Commit 3f1ba56

Browse files
Kerem Katshipilev
authored andcommitted
8345296: AArch64: VM crashes with SIGILL when prctl is disallowed
Reviewed-by: shade Backport-of: 3c60f0b2bb75150d49da9ab94d88b767275de5e2
1 parent 6400a16 commit 3f1ba56

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

src/hotspot/cpu/aarch64/register_aarch64.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,13 @@ class FloatRegisterImpl: public AbstractRegisterImpl {
140140
max_slots_per_register = 8,
141141
save_slots_per_register = 2,
142142
slots_per_neon_register = 4,
143-
extra_save_slots_per_neon_register = slots_per_neon_register - save_slots_per_register
143+
extra_save_slots_per_neon_register = slots_per_neon_register - save_slots_per_register,
144+
neon_vl = 16,
145+
// VLmax: The maximum sve vector length is determined by the hardware
146+
// sve_vl_min <= VLmax <= sve_vl_max.
147+
sve_vl_min = 16,
148+
// Maximum supported vector length across all CPUs
149+
sve_vl_max = 256
144150
};
145151

146152
// construction

src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525

2626
#include "precompiled.hpp"
27+
#include "register_aarch64.hpp"
2728
#include "runtime/arguments.hpp"
2829
#include "runtime/globals_extension.hpp"
2930
#include "runtime/java.hpp"
@@ -400,14 +401,27 @@ void VM_Version::initialize() {
400401
if (FLAG_IS_DEFAULT(UseSVE)) {
401402
FLAG_SET_DEFAULT(UseSVE, (_features & CPU_SVE2) ? 2 : 1);
402403
}
403-
if (UseSVE > 0) {
404-
_initial_sve_vector_length = get_current_sve_vector_length();
405-
}
406404
} else if (UseSVE > 0) {
407405
warning("UseSVE specified, but not supported on current CPU. Disabling SVE.");
408406
FLAG_SET_DEFAULT(UseSVE, 0);
409407
}
410408

409+
if (UseSVE > 0) {
410+
int vl = get_current_sve_vector_length();
411+
if (vl < 0) {
412+
warning("Unable to get SVE vector length on this system. "
413+
"Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.");
414+
FLAG_SET_DEFAULT(UseSVE, 0);
415+
} else if ((vl == 0) || ((vl % FloatRegisterImpl::sve_vl_min) != 0) || !is_power_of_2(vl)) {
416+
warning("Detected SVE vector length (%d) should be a power of two and a multiple of %d. "
417+
"Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.",
418+
vl, FloatRegisterImpl::sve_vl_min);
419+
FLAG_SET_DEFAULT(UseSVE, 0);
420+
} else {
421+
_initial_sve_vector_length = vl;
422+
}
423+
}
424+
411425
// This machine allows unaligned memory accesses
412426
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
413427
FLAG_SET_DEFAULT(UseUnalignedAccesses, true);

0 commit comments

Comments
 (0)