Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/

#include "logging/log.hpp"
#include "logging/logMessage.hpp"
#include "os_linux.hpp"
#include "riscv_hwprobe.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
Expand Down Expand Up @@ -163,7 +165,18 @@ void RiscvHwprobe::add_features_from_query_result() {
VM_Version::ext_C.enable_feature();
}
if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_IMA_V)) {
VM_Version::ext_V.enable_feature();
// Linux signal return bug when using vector with vlen > 128b in pre 6.8.5.
long major, minor, patch;
os::Linux::kernel_version(&major, &minor, &patch);
if (os::Linux::kernel_version_compare(major, minor, patch, 6, 8, 5) == -1) {
LogMessage(os) log;
if (log.is_info()) {
log.info("Linux kernels before 6.8.5 (current %ld.%ld.%ld) have a known bug when using Vector and signals.", major, minor, patch);
log.info("Vector not enabled automatically via hwprobe, but can be turned on with -XX:+UseRVV.");
}
} else {
VM_Version::ext_V.enable_feature();
}
}
if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZBA)) {
VM_Version::ext_Zba.enable_feature();
Expand Down