Skip to content

Commit 21b76f3

Browse files
author
Kerem Kat
committed
8345296: AArch64: VM crashes with SIGILL when prctl is disallowed
Reviewed-by: shade, phh Backport-of: 3c60f0b2bb75150d49da9ab94d88b767275de5e2
1 parent 29c1188 commit 21b76f3

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/hotspot/cpu/aarch64/register_aarch64.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -165,7 +165,13 @@ class FloatRegister {
165165
max_slots_per_register = 4,
166166
save_slots_per_register = 2,
167167
slots_per_neon_register = 4,
168-
extra_save_slots_per_neon_register = slots_per_neon_register - save_slots_per_register
168+
extra_save_slots_per_neon_register = slots_per_neon_register - save_slots_per_register,
169+
neon_vl = 16,
170+
// VLmax: The maximum sve vector length is determined by the hardware
171+
// sve_vl_min <= VLmax <= sve_vl_max.
172+
sve_vl_min = 16,
173+
// Maximum supported vector length across all CPUs
174+
sve_vl_max = 256
169175
};
170176

171177
class FloatRegisterImpl: public AbstractRegisterImpl {

src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "precompiled.hpp"
2727
#include "pauth_aarch64.hpp"
28+
#include "register_aarch64.hpp"
2829
#include "runtime/arguments.hpp"
2930
#include "runtime/globals_extension.hpp"
3031
#include "runtime/java.hpp"
@@ -440,7 +441,19 @@ void VM_Version::initialize() {
440441
}
441442

442443
if (UseSVE > 0) {
443-
_initial_sve_vector_length = get_current_sve_vector_length();
444+
int vl = get_current_sve_vector_length();
445+
if (vl < 0) {
446+
warning("Unable to get SVE vector length on this system. "
447+
"Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.");
448+
FLAG_SET_DEFAULT(UseSVE, 0);
449+
} else if ((vl == 0) || ((vl % FloatRegister::sve_vl_min) != 0) || !is_power_of_2(vl)) {
450+
warning("Detected SVE vector length (%d) should be a power of two and a multiple of %d. "
451+
"Disabling SVE. Specify -XX:UseSVE=0 to shun this warning.",
452+
vl, FloatRegister::sve_vl_min);
453+
FLAG_SET_DEFAULT(UseSVE, 0);
454+
} else {
455+
_initial_sve_vector_length = vl;
456+
}
444457
}
445458

446459
// This machine allows unaligned memory accesses

0 commit comments

Comments
 (0)