18 Star 1 Fork 19

src-openEuler/openjdk-21

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Backport-JDK-8348384-RISC-V-Disable-auto-enable-Vect.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
From 0310b533d409704f349b9e9bf861ee6afb9d67ee Mon Sep 17 00:00:00 2001
From: Dingli Zhang <dingli@iscas.ac.cn>
Date: Mon, 17 Mar 2025 16:31:52 +0800
Subject: [PATCH] Backport JDK-8348384: RISC-V: Disable auto-enable Vector on
buggy kernels
diff --git a/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp b/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
index 243c4b850ee..991ce07bb7c 100644
--- a/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
@@ -25,6 +25,8 @@
#include "precompiled.hpp"
#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"
@@ -134,7 +136,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();
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/openjdk-21.git
git@gitee.com:src-openeuler/openjdk-21.git
src-openeuler
openjdk-21
openjdk-21
master

搜索帮助