diff --git a/openjdk-11.spec b/openjdk-11.spec index 6501055e71ea6793f1afc9830b52dfcfbd98b92b..ec9c2682c2674c0239d635bee355a854195e5c3a 100644 --- a/openjdk-11.spec +++ b/openjdk-11.spec @@ -773,7 +773,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: 1 +Release: 2 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -915,6 +915,7 @@ Patch99: huawei-AArch64-Incorrect-matching-rule.patch # 11.0.27 Patch100: huawei-remove-provides-in-kaeprovider-module-info.patch +Patch101: zhaoxin_processors_support.patch ############################################ # @@ -1220,6 +1221,7 @@ pushd %{top_level_dir_name} %patch97 -p1 %patch99 -p1 %patch100 -p1 +%patch101 -p1 %endif %endif %ifarch loongarch64 @@ -1756,6 +1758,9 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect %endif %changelog +* Fri Sep 5 2025 vicwang-oc -1:11.0.28.6-2 +- add zhaoxin_processors_support.patch + * Thu Jul 17 2025 Benshuai5D -1:11.0.28.6-1 - add huawei-remove-provides-in-kaeprovider-module-info.patch diff --git a/zhaoxin_processors_support.patch b/zhaoxin_processors_support.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed5edbc2cf1694961a0c7c24a4a24fe1254baaa5 --- /dev/null +++ b/zhaoxin_processors_support.patch @@ -0,0 +1,87 @@ +diff --git a/src/hotspot/cpu/x86/vm_version_ext_x86.cpp b/src/hotspot/cpu/x86/vm_version_ext_x86.cpp +index 968428db59..6496788e88 100644 +--- a/src/hotspot/cpu/x86/vm_version_ext_x86.cpp ++++ b/src/hotspot/cpu/x86/vm_version_ext_x86.cpp +@@ -398,6 +398,7 @@ int VM_Version_Ext::number_of_sockets(void) { + + const char* VM_Version_Ext::cpu_family_description(void) { + int cpu_family_id = extended_cpu_family(); ++ int cpu_model_id = extended_cpu_model(); + if (is_amd()) { + if (cpu_family_id < ExtendedFamilyIdLength_AMD) { + return _family_id_amd[cpu_family_id]; +@@ -411,6 +412,22 @@ const char* VM_Version_Ext::cpu_family_description(void) { + return _family_id_intel[cpu_family_id]; + } + } ++ if (is_zx()) { ++ if (cpu_family_id == 7) { ++ switch (cpu_model_id) { ++ case 0x1B: ++ return "wudaokou"; ++ case 0x3B: ++ return "lujiazui"; ++ case 0x5B: ++ return "yongfeng"; ++ case 0x6B: ++ return "shijidadao"; ++ } ++ } else if (cpu_family_id == 6) { ++ return "zhangjiang"; ++ } ++ } + return "Unknown x86"; + } + +@@ -427,6 +444,9 @@ int VM_Version_Ext::cpu_type_description(char* const buf, size_t buf_len) { + } else if (is_amd()) { + cpu_type = "AMD"; + x64 = cpu_is_em64t() ? " AMD64" : ""; ++ } else if (is_zx()) { ++ cpu_type = "Zhaoxin"; ++ x64 = cpu_is_em64t() ? "x86_64" : ""; + } else { + cpu_type = "Unknown x86"; + x64 = cpu_is_em64t() ? " x86_64" : ""; +diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp +index eb96bd5e87..476d3f947b 100644 +--- a/src/hotspot/cpu/x86/vm_version_x86.cpp ++++ b/src/hotspot/cpu/x86/vm_version_x86.cpp +@@ -681,9 +681,17 @@ void VM_Version::get_processor_features() { + if (UseSSE < 1) + _features &= ~CPU_SSE; + +- //since AVX instructions is slower than SSE in some ZX cpus, force USEAVX=0. +- if (is_zx() && ((cpu_family() == 6) || (cpu_family() == 7))) { +- UseAVX = 0; ++ //ZX cpus specific settings ++ if (is_zx() && FLAG_IS_DEFAULT(UseAVX)) { ++ if (cpu_family() == 7) { ++ if (extended_cpu_model() == 0x5B || extended_cpu_model() == 0x6B) { ++ UseAVX = 1; ++ } else if (extended_cpu_model() == 0x1B || extended_cpu_model() == 0x3B) { ++ UseAVX = 0; ++ } ++ } else if (cpu_family() == 6) { ++ UseAVX = 0; ++ } + } + + // first try initial setting and detect what we can support +diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp +index 3e8f1245c7..5e74d83a07 100644 +--- a/src/hotspot/cpu/x86/vm_version_x86.hpp ++++ b/src/hotspot/cpu/x86/vm_version_x86.hpp +@@ -910,6 +910,12 @@ public: + } else { + return 128; // Athlon + } ++ } else if (is_zx()) { // ZX ++ if (supports_sse2()) { ++ return 256; ++ } else { ++ return 128; ++ } + } else { // Intel + if (supports_sse3() && cpu_family() == 6) { + if (supports_sse4_2() && supports_ht()) { // Nehalem based cpus