Compare commits

..

No commits in common. "44032e71289bb08e9263f1f8419a6f3626c69ad5" and "ea0ffba6ea72ad61fa798ec3cb3cc550b796b139" have entirely different histories.

9 changed files with 30528 additions and 5775 deletions

View File

@ -158,8 +158,8 @@ index 6672d26a5..c3e8ceb35 100644
+JDKOPT_DETECT_KAE
JDKOPT_DETECT_INTREE_EC
LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4
index 9d64b31bf..e20eafa60 100644
--- a/make/autoconf/jdk-options.m4

File diff suppressed because it is too large Load Diff

View File

@ -367,4 +367,4 @@ index 000000000..85b49171c
--- /dev/null
+++ b/version.txt
@@ -0,0 +1 @@
+11.0.26.0.13
+11.0.22.0.13

View File

@ -18679,10 +18679,10 @@ index 0000000000..80dff0c762
+
diff --git a/src/hotspot/cpu/loongarch/loongarch_64.ad b/src/hotspot/cpu/loongarch/loongarch_64.ad
new file mode 100644
index 0000000000..c10f0b70cf
index 0000000000..cc3824a402
--- /dev/null
+++ b/src/hotspot/cpu/loongarch/loongarch_64.ad
@@ -0,0 +1,13928 @@
@@ -0,0 +1,13917 @@
+//
+// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2015, 2023, Loongson Technology. All rights reserved.
@ -25123,17 +25123,6 @@ index 0000000000..c10f0b70cf
+ ins_pipe(empty);
+%}
+
+instruct same_addr_load_fence() %{
+ match(SameAddrLoadFence);
+ ins_cost(400);
+
+ format %{ "MEMBAR @ same_addr_load_fence" %}
+ ins_encode %{
+ __ dbar(0x700);
+ %}
+ ins_pipe(pipe_slow);
+%}
+
+//----------Move Instructions--------------------------------------------------
+instruct castX2P(mRegP dst, mRegL src) %{
+ match(Set dst (CastX2P src));
@ -38057,13 +38046,13 @@ index 0000000000..49302590c3
+#endif // CPU_LOONGARCH_MACROASSEMBLER_LOONGARCH_INLINE_HPP
diff --git a/src/hotspot/cpu/loongarch/macroAssembler_loongarch_trig.cpp b/src/hotspot/cpu/loongarch/macroAssembler_loongarch_trig.cpp
new file mode 100644
index 0000000000..6e27a69747
index 0000000000..3ed4c36651
--- /dev/null
+++ b/src/hotspot/cpu/loongarch/macroAssembler_loongarch_trig.cpp
@@ -0,0 +1,1626 @@
@@ -0,0 +1,1625 @@
+/* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Cavium. All rights reserved. (By BELLSOFT)
+ * Copyright (c) 2022, 2024, Loongson Technology. All rights reserved.
+ * Copyright (c) 2022, Loongson Technology. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
@ -38962,7 +38951,7 @@ index 0000000000..6e27a69747
+ b(Q_DONE);
+ bind(JX_IS_0);
+ if (UseLASX) {
+ xvfmul_d(v28, v18, v6); // f[0,3] * x[0]
+ xvfmul_d(v28, v18, v6); // f[0,1] * x[0]
+ fmul_d(v30, v19, v6); // f[4] * x[0]
+ } else {
+ vfmul_d(v28, v18, v6); // f[0,1] * x[0]
@ -39191,7 +39180,6 @@ index 0000000000..6e27a69747
+ st_w(tmp2, SCR2, 0);
+ addi_w(SCR1, SCR1, 24);
+ addi_w(jz, jz, 1);
+ alsl_d(SCR2, jz, iqBase, 2 - 1);
+ st_w(tmp3, SCR2, 0); // iq[jz] = (int) fw
+ b(Z_ZERO_CHECK_DONE);
+ bind(Z_IS_LESS_THAN_TWO24B);
@ -104804,7 +104792,7 @@ index 3687754e71..791e4ed43f 100644
void generate_c1_load_barrier_stub(LIR_Assembler* ce,
ZLoadBarrierStubC1* stub) const;
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 2842a11f92..4f58ec4be3 100644
index 0af357ea56..66a8006780 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -23,6 +23,12 @@
@ -104820,7 +104808,7 @@ index 2842a11f92..4f58ec4be3 100644
// no precompiled headers
#include "jvm.h"
#include "classfile/classLoader.hpp"
@@ -4060,6 +4066,8 @@ size_t os::Linux::find_large_page_size() {
@@ -4068,6 +4074,8 @@ size_t os::Linux::find_large_page_size() {
IA64_ONLY(256 * M)
PPC_ONLY(4 * M)
S390_ONLY(1 * M)
@ -108494,31 +108482,6 @@ index 2b0fa83c1a..270e0bc180 100644
+const bool ZPlatformLoadBarrierTestResultInRegister = false;
+
#endif // OS_CPU_LINUX_X86_ZGLOBALS_LINUX_X86_HPP
diff --git a/src/hotspot/share/adlc/formssel.cpp b/src/hotspot/share/adlc/formssel.cpp
index f810fde767..90f733cdf9 100644
--- a/src/hotspot/share/adlc/formssel.cpp
+++ b/src/hotspot/share/adlc/formssel.cpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
// FORMS.CPP - Definitions for ADL Parser Forms Classes
#include "adlc.hpp"
@@ -4109,6 +4115,7 @@ bool MatchRule::is_ideal_membar() const {
!strcmp(_opType,"MemBarVolatile") ||
!strcmp(_opType,"MemBarCPUOrder") ||
!strcmp(_opType,"MemBarStoreStore") ||
+ !strcmp(_opType,"SameAddrLoadFence" ) ||
!strcmp(_opType,"OnSpinWait");
}
diff --git a/src/hotspot/share/asm/codeBuffer.cpp b/src/hotspot/share/asm/codeBuffer.cpp
index 4912f88056..a420f7807b 100644
--- a/src/hotspot/share/asm/codeBuffer.cpp
@ -109909,46 +109872,6 @@ index 84815adea8..57e29f1295 100644
__ move(dirty, card_addr);
__ branch_destination(L_already_dirty->label());
} else {
diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
index 5452756444..62adf9971e 100644
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
#include "precompiled.hpp"
#include "gc/shared/c2/barrierSetC2.hpp"
#include "opto/arraycopynode.hpp"
@@ -197,6 +203,8 @@ public:
bool is_volatile = (decorators & MO_SEQ_CST) != 0;
bool is_acquire = (decorators & MO_ACQUIRE) != 0;
+ bool is_relaxed = (decorators & MO_RELAXED) != 0;
+ bool is_unsafe = (decorators & C2_UNSAFE_ACCESS) != 0;
// If reference is volatile, prevent following volatiles ops from
// floating up before the volatile access.
@@ -227,6 +235,13 @@ public:
assert(_leading_membar == NULL || support_IRIW_for_not_multiple_copy_atomic_cpu, "no leading membar expected");
Node* mb = kit->insert_mem_bar(Op_MemBarAcquire, n);
mb->as_MemBar()->set_trailing_load();
+ } else if (is_relaxed && is_unsafe) {
+#ifdef LOONGARCH64
+ assert(kit != NULL, "unsupported at optimization time");
+ Node* n = _access.raw_access();
+ Node* mb = kit->insert_mem_bar(Op_SameAddrLoadFence, n);
+ mb->as_MemBar()->set_trailing_load();
+#endif
}
}
}
diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
index f51d186484..506f0301fe 100644
--- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
@ -110256,56 +110179,6 @@ index 6c631f5458..9865106720 100644
}
// Note that the forwardee is not the same thing as the displaced_mark.
diff --git a/src/hotspot/share/opto/classes.hpp b/src/hotspot/share/opto/classes.hpp
index 7a9bd91117..b46e9bcf5b 100644
--- a/src/hotspot/share/opto/classes.hpp
+++ b/src/hotspot/share/opto/classes.hpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
#include "utilities/macros.hpp"
// The giant table of Node classes.
@@ -217,6 +223,7 @@ macro(StoreFence)
macro(MemBarReleaseLock)
macro(MemBarVolatile)
macro(MemBarStoreStore)
+macro(SameAddrLoadFence)
macro(MergeMem)
macro(MinD)
macro(MinF)
diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
index da06b47400..510438d675 100644
--- a/src/hotspot/share/opto/compile.cpp
+++ b/src/hotspot/share/opto/compile.cpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
@@ -3448,6 +3454,7 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
n->set_req(MemBarNode::Precedent, top());
}
break;
+ case Op_SameAddrLoadFence:
case Op_MemBarAcquire: {
if (n->as_MemBar()->trailing_load() && n->req() > MemBarNode::Precedent) {
// At parse time, the trailing MemBarAcquire for a volatile load
diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp
index 569fbc6d69..c1f1b82ffa 100644
--- a/src/hotspot/share/opto/compile.hpp
@ -110319,63 +110192,6 @@ index 569fbc6d69..c1f1b82ffa 100644
MAX_inst_size = 2048,
#else
MAX_inst_size = 1024,
diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp
index e194386b56..d5e6dd71a7 100644
--- a/src/hotspot/share/opto/memnode.cpp
+++ b/src/hotspot/share/opto/memnode.cpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "compiler/compileLog.hpp"
@@ -3190,6 +3196,7 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {
case Op_MemBarReleaseLock: return new MemBarReleaseLockNode(C, atp, pn);
case Op_MemBarVolatile: return new MemBarVolatileNode(C, atp, pn);
case Op_MemBarCPUOrder: return new MemBarCPUOrderNode(C, atp, pn);
+ case Op_SameAddrLoadFence: return new SameAddrLoadFenceNode(C, atp, pn);
case Op_OnSpinWait: return new OnSpinWaitNode(C, atp, pn);
case Op_Initialize: return new InitializeNode(C, atp, pn);
case Op_MemBarStoreStore: return new MemBarStoreStoreNode(C, atp, pn);
diff --git a/src/hotspot/share/opto/memnode.hpp b/src/hotspot/share/opto/memnode.hpp
index e4676977e1..bf1efbf835 100644
--- a/src/hotspot/share/opto/memnode.hpp
+++ b/src/hotspot/share/opto/memnode.hpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
#ifndef SHARE_VM_OPTO_MEMNODE_HPP
#define SHARE_VM_OPTO_MEMNODE_HPP
@@ -1293,6 +1299,14 @@ public:
virtual uint ideal_reg() const { return 0; } // not matched in the AD file
};
+// Used to prevent LoadLoad reorder for same address.
+class SameAddrLoadFenceNode: public MemBarNode {
+public:
+ SameAddrLoadFenceNode(Compile* C, int alias_idx, Node* precedent)
+ : MemBarNode(C, alias_idx, precedent) {}
+ virtual int Opcode() const;
+};
+
class OnSpinWaitNode: public MemBarNode {
public:
OnSpinWaitNode(Compile* C, int alias_idx, Node* precedent)
diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp
index b6540e06a3..52d1fc9fb9 100644
--- a/src/hotspot/share/opto/output.cpp
@ -110522,7 +110338,7 @@ index ce23aafa8f..d3dfb74d5b 100644
assert(_owner != Self, "invariant");
assert(_Responsible != Self, "invariant");
diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp
index 1c540bb621..0e44240d40 100644
index e0f4a2af1f..09cc4b1ba5 100644
--- a/src/hotspot/share/runtime/os.cpp
+++ b/src/hotspot/share/runtime/os.cpp
@@ -22,6 +22,12 @@
@ -110581,31 +110397,6 @@ index e086f794cd..f480195775 100644
static const double
S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */
S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */
diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp
index adce6da6a3..db099a2985 100644
--- a/src/hotspot/share/runtime/vmStructs.cpp
+++ b/src/hotspot/share/runtime/vmStructs.cpp
@@ -22,6 +22,12 @@
*
*/
+/*
+ * This file has been modified by Loongson Technology in 2023, These
+ * modifications are Copyright (c) 2023, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
#include "precompiled.hpp"
#include "ci/ciField.hpp"
#include "ci/ciInstance.hpp"
@@ -1642,6 +1648,7 @@ typedef PaddedEnd<ObjectMonitor> PaddedObjectMonitor;
declare_c2_type(StoreFenceNode, MemBarNode) \
declare_c2_type(MemBarVolatileNode, MemBarNode) \
declare_c2_type(MemBarCPUOrderNode, MemBarNode) \
+ declare_c2_type(SameAddrLoadFenceNode, MemBarNode) \
declare_c2_type(OnSpinWaitNode, MemBarNode) \
declare_c2_type(InitializeNode, MemBarNode) \
declare_c2_type(ThreadLocalNode, Node) \
diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp
index c758fc5743..a8c4638f6a 100644
--- a/src/hotspot/share/utilities/globalDefinitions.hpp
@ -110881,7 +110672,7 @@ index 8318e8e021..07064e76ee 100644
// This C bool type must be int for compatibility with Linux calls and
// it would be a mistake to equivalence it to C++ bool on many platforms
diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c
index c22b5d1cb3..36d6343960 100644
index de5254d859..eefe55959c 100644
--- a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c
+++ b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c
@@ -22,6 +22,12 @@
@ -110897,12 +110688,12 @@ index c22b5d1cb3..36d6343960 100644
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -151,7 +157,7 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
return false;
}
return true;
-#elif defined(PTRACE_GETREGS_REQ)
+#elif defined(PTRACE_GETREGS_REQ) && !defined(loongarch64)
@@ -142,7 +148,7 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
#define PTRACE_GETREGS_REQ PT_GETREGS
#endif
-#ifdef PTRACE_GETREGS_REQ
+#if defined(PTRACE_GETREGS_REQ) && !defined(loongarch64)
if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {
print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid);
return false;
@ -116794,7 +116585,7 @@ index 127bb6abcd..c9277604ae 100644
Platform.isSolaris();
}
diff --git a/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
index 126a43a900..55bd135f6e 100644
index 77458554b7..05aee6b84c 100644
--- a/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
+++ b/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
@@ -45,7 +45,7 @@ import java.util.Set;
@ -116834,8 +116625,35 @@ index 7990c49a1f..025048c6b0 100644
}
}
}
diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java
index b14daf6c6d..da33514c75 100644
--- a/test/jdk/sun/security/pkcs11/PKCS11Test.java
+++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java
@@ -21,6 +21,12 @@
* questions.
*/
+/*
+ * This file has been modified by Loongson Technology in 2022, These
+ * modifications are Copyright (c) 2021, 2022, Loongson Technology, and are made
+ * available on the same license terms set forth above.
+ */
+
// common infrastructure for SunPKCS11 tests
import java.io.BufferedReader;
@@ -747,6 +753,9 @@ public abstract class PKCS11Test {
"/usr/lib64/" });
osMap.put("Linux-ppc64-64", new String[] { "/usr/lib64/" });
osMap.put("Linux-ppc64le-64", new String[] { "/usr/lib64/" });
+ osMap.put("Linux-mips64el-64", new String[]{"/usr/lib64/"});
+ osMap.put("Linux-loongarch64-64", new String[]{"/usr/lib/loongarch64-linux-gnu/",
+ "/usr/lib64/" });
osMap.put("Linux-s390x-64", new String[] { "/usr/lib64/" });
osMap.put("Windows-x86-32", new String[] {});
osMap.put("Windows-amd64-64", new String[] {});
diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java
index 6269373c2b..440ec4664f 100644
index 5b3f1889cb..aaf8867a7c 100644
--- a/test/lib/jdk/test/lib/Platform.java
+++ b/test/lib/jdk/test/lib/Platform.java
@@ -21,6 +21,12 @@
@ -116850,8 +116668,8 @@ index 6269373c2b..440ec4664f 100644
+
package jdk.test.lib;
import java.io.BufferedReader;
@@ -229,6 +235,14 @@ public class Platform {
import java.io.FileNotFoundException;
@@ -226,6 +232,14 @@ public class Platform {
return isArch("(i386)|(x86(?!_64))");
}

View File

@ -1,232 +0,0 @@
diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
index faf109ab1..ab83d2a6b 100644
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
@@ -121,7 +121,8 @@ public:
static int get_initial_sve_vector_length() { return _initial_sve_vector_length; };
static bool is_hisi_enabled() {
- if (_cpu == CPU_HISILICON && (_model == 0xd01 || _model == 0xd02 || _model == 0xd03)) {
+ if (_cpu == CPU_HISILICON && (_model == 0xd01 || _model == 0xd02 || _model == 0xd03 ||
+ _model == 0xd22 || _model == 0xd45)) {
return true;
}
return false;
diff --git a/make/hotspot/symbols/symbols-shared b/make/hotspot/symbols/symbols-shared
index 5d26d1028..d955c25f2 100644
--- a/make/hotspot/symbols/symbols-shared
+++ b/make/hotspot/symbols/symbols-shared
@@ -28,6 +28,7 @@ jio_snprintf
jio_vfprintf
jio_vsnprintf
JNI_CreateJavaVM
+JNI_SetCParam
JNI_GetCreatedJavaVMs
JNI_GetDefaultJavaVMInitArgs
JVM_FindClassFromBootLoader
diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
index 9c2bdbbad..552267b0f 100644
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
@@ -413,3 +413,28 @@ void VM_Version::initialize() {
UNSUPPORTED_OPTION(CriticalJNINatives);
}
+
+int VM_Version::get_cpu_model() {
+ int cpu_lines = 0;
+ if (FILE *f = fopen("/proc/cpuinfo", "r")) {
+ char buf[128], *p;
+ while (fgets(buf, sizeof (buf), f) != NULL) {
+ if ((p = strchr(buf, ':')) != NULL) {
+ long v = strtol(p+1, NULL, 0);
+ if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
+ _cpu = v;
+ cpu_lines++;
+ } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
+ _variant = v;
+ } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {
+ if (_model != v) _model2 = _model;
+ _model = v;
+ } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) {
+ _revision = v;
+ }
+ }
+ }
+ fclose(f);
+ }
+ return cpu_lines;
+}
\ No newline at end of file
diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
index f03da8710..faf109ab1 100644
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
@@ -112,6 +112,7 @@ public:
CPU_DMB_ATOMICS = (1 << 31),
};
+ static int get_cpu_model();
static int cpu_family() { return _cpu; }
static int cpu_model() { return _model; }
static int cpu_model2() { return _model2; }
diff --git a/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp
index 9084daeaa..0d7e03cd8 100644
--- a/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp
+++ b/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp
@@ -46,6 +46,35 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
return pd_get_top_frame(fr_addr, ucontext, isInJava);
}
+inline unsigned int stringHash(const char* str) {
+ unsigned int seed = 13;
+ unsigned int hash = 0;
+ while(*str) {
+ hash = hash * seed + (*str++);
+ }
+
+ return (hash & 0x7fffffff);
+}
+
+void JavaThread::os_linux_aarch64_options(int apc, char **name) {
+ if (name == NULL) {
+ return;
+ }
+ VM_Version::get_cpu_model();
+ if (VM_Version::is_hisi_enabled()) {
+ int i = 0;
+ int step = 0;
+ while (name[i] != NULL) {
+ if (stringHash(name[i]) == 1396789436) {
+ if (FLAG_IS_DEFAULT(ActiveProcessorCount) && (UseG1GC || UseParallelGC || UseZGC) && apc > 8)
+ FLAG_SET_DEFAULT(ActiveProcessorCount, 8);
+ break;
+ }
+ i++;
+ }
+ }
+}
+
bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) {
assert(this->is_Java_thread(), "must be JavaThread");
JavaThread* jt = (JavaThread *)this;
diff --git a/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp b/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp
index 985b664aa..521ac0dcc 100644
--- a/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp
+++ b/src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp
@@ -55,6 +55,8 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);
+ static void os_linux_aarch64_options(int apc, char **name);
+
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
private:
bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp
index 289283dca..0b2138d98 100644
--- a/src/hotspot/share/prims/jni.cpp
+++ b/src/hotspot/share/prims/jni.cpp
@@ -3951,6 +3951,11 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) {
DT_RETURN_MARK_DECL(CreateJavaVM, jint
, HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref));
+const char** argv_for_execvp;
+_JNI_IMPORT_OR_EXPORT_ void JNICALL JNI_SetCParam(char** raw_argv) {
+ argv_for_execvp = (const char**)raw_argv;
+}
+
static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) {
HOTSPOT_JNI_CREATEJAVAVM_ENTRY((void **) vm, penv, args);
diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp
index 1c540bb62..214bb21f9 100644
--- a/src/hotspot/share/runtime/os.cpp
+++ b/src/hotspot/share/runtime/os.cpp
@@ -447,6 +447,11 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) {
}
void os::init_before_ergo() {
+#ifdef AARCH64
+ // global variables
+ extern char** argv_for_execvp;
+ JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp);
+#endif
initialize_initial_active_processor_count();
// We need to initialize large page support here because ergonomics takes some
// decisions depending on large page support and the calculated large page size.
diff --git a/src/java.base/share/native/include/jni.h b/src/java.base/share/native/include/jni.h
index e15503f4d..4aaa75685 100644
--- a/src/java.base/share/native/include/jni.h
+++ b/src/java.base/share/native/include/jni.h
@@ -1948,6 +1948,9 @@ JNI_GetDefaultJavaVMInitArgs(void *args);
_JNI_IMPORT_OR_EXPORT_ jint JNICALL
JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+_JNI_IMPORT_OR_EXPORT_ void JNICALL
+JNI_SetCParam(char** raw_argv);
+
_JNI_IMPORT_OR_EXPORT_ jint JNICALL
JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c
index a38ddae63..120d8f33b 100644
--- a/src/java.base/share/native/libjli/java.c
+++ b/src/java.base/share/native/libjli/java.c
@@ -284,6 +284,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argv */
ifn.CreateJavaVM = 0;
ifn.GetDefaultJavaVMInitArgs = 0;
+ ifn.raw_argv = argv;
if (JLI_IsTraceLauncher()) {
start = CounterGet();
@@ -1524,6 +1525,7 @@ InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
i, args.options[i].optionString);
}
+ ifn->SetCParam(ifn->raw_argv);
r = ifn->CreateJavaVM(pvm, (void **)penv, &args);
JLI_MemFree(options);
return r == JNI_OK;
diff --git a/src/java.base/share/native/libjli/java.h b/src/java.base/share/native/libjli/java.h
index 45acece27..43ca5cf39 100644
--- a/src/java.base/share/native/libjli/java.h
+++ b/src/java.base/share/native/libjli/java.h
@@ -77,13 +77,16 @@
* Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
*/
typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
+typedef void (JNICALL *SetCParam_t)(char** raw_argv);
typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
typedef jint (JNICALL *GetCreatedJavaVMs_t)(JavaVM **vmBuf, jsize bufLen, jsize *nVMs);
typedef struct {
CreateJavaVM_t CreateJavaVM;
+ SetCParam_t SetCParam;
GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
GetCreatedJavaVMs_t GetCreatedJavaVMs;
+ char** raw_argv;
} InvocationFunctions;
JNIEXPORT int JNICALL
diff --git a/src/java.base/unix/native/libjli/java_md_solinux.c b/src/java.base/unix/native/libjli/java_md_solinux.c
index 160f91975..7526c0d9f 100644
--- a/src/java.base/unix/native/libjli/java_md_solinux.c
+++ b/src/java.base/unix/native/libjli/java_md_solinux.c
@@ -615,6 +615,13 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
return JNI_FALSE;
}
+ ifn->SetCParam = (SetCParam_t)
+ dlsym(libjvm, "JNI_SetCParam");
+ if (ifn->SetCParam == NULL) {
+ JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+ return JNI_FALSE;
+ }
+
ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
if (ifn->GetDefaultJavaVMInitArgs == NULL) {
--
2.21.0.windows.1

View File

@ -120,18 +120,19 @@ index 122a01901..c131bd493 100644
+ File.separator + "security" + File.separator + "cacerts";
// The numbers of certs now.
- private static final int COUNT = 112;
+ private static final int COUNT = 109;
- private static final int COUNT = 108;
+ private static final int COUNT = 105;
// SHA-256 of cacerts, can be generated with
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
private static final String CHECKSUM
- = "8F:E0:6F:7F:21:59:33:A6:43:F3:48:FD:A3:4A:8E:28:35:AA:DD:6E:A5:43:56:F1:28:34:48:DF:5C:D2:7C:72";
+ = "20:83:CF:5E:F7:A9:E6:C6:06:ED:2C:28:3E:CE:AF:B9:BF:9D:26:CB:29:0C:E2:CF:B8:4F:DF:E9:59:5F:A6:3C";
- = "81:D4:84:F6:92:78:A4:82:25:06:DC:42:25:C9:5D:6C:63:E4:99:CE:BC:ED:66:B3:8C:BA:E6:BA:6B:34:0F:01";
+ = "2F:05:4C:2D:16:ED:2B:56:D6:07:03:A9:49:C4:A2:E6:16:2C:0D:92:FD:C8:6C:28:DF:77:26:A9:E7:D8:12:47";
// map of cert alias to SHA-256 fingerprint
@SuppressWarnings("serial")
@@ -110,8 +110,6 @@ public class VerifyCACerts {
private static final Map<String, String> FINGERPRINT_MAP = new HashMap<>() {
@@ -109,8 +109,6 @@ public class VerifyCACerts {
"7E:37:CB:8B:4C:47:09:0C:AB:36:55:1B:A6:F4:5D:B8:40:68:0F:BA:16:6A:95:2D:B1:00:71:7F:43:05:3F:C2");
put("digicerthighassuranceevrootca [jdk]",
"74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF");
@ -140,7 +141,7 @@ index 122a01901..c131bd493 100644
put("geotrustprimaryca [jdk]",
"37:D5:10:06:C5:12:EA:AB:62:64:21:F1:EC:8C:92:01:3F:C5:F8:2A:E9:8E:E5:33:EB:46:19:B8:DE:B4:D0:6C");
put("geotrustprimarycag2 [jdk]",
@@ -146,10 +144,6 @@ public class VerifyCACerts {
@@ -145,10 +143,6 @@ public class VerifyCACerts {
"96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
put("letsencryptisrgx2 [jdk]",
"69:72:9B:8E:15:A8:6E:FC:17:7A:57:AF:B7:17:1D:FC:64:AD:D2:8C:2F:CA:8C:F1:50:7E:34:45:3C:CB:14:70");
@ -151,7 +152,7 @@ index 122a01901..c131bd493 100644
put("quovadisrootca1g3 [jdk]",
"8A:86:6F:D1:B2:76:B5:7E:57:8E:92:1C:65:82:8A:2B:ED:58:E9:F2:F2:88:05:41:34:B7:F1:F4:BF:C9:CC:74");
put("quovadisrootca2 [jdk]",
@@ -291,12 +285,6 @@ public class VerifyCACerts {
@@ -282,12 +276,6 @@ public class VerifyCACerts {
add("addtrustexternalca [jdk]");
// Valid until: Sat May 30 10:44:50 GMT 2020
add("addtrustqualifiedca [jdk]");

View File

@ -22,9 +22,6 @@
# Enable release builds by default on relevant arches.
%bcond_without release
# Disable global LTO
%define _lto_cflags %{nil}
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
# This fixes detailed NMT and other tools which need minimal debug info.
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
@ -128,14 +125,14 @@
# New Version-String scheme-style defines
%global majorver 11
%global securityver 26
%global securityver 23
# buildjdkver is usually same as %%{majorver},
# but in time of bootstrap of next jdk, it is majorver-1,
# and this it is better to change it here, on single place
%global buildjdkver %{majorver}
%ifnarch loongarch64 ppc64le
%global vendor_version_string BiSheng
%global vendor_version_string Bisheng
%endif
%ifarch loongarch64
%global vendor_version_string Loongson
@ -149,12 +146,12 @@
%global origin_nice OpenJDK
%global top_level_dir_name %{origin}
%global minorver 0
%global buildver 4
%global buildver 9
%global patchver 0
%global project jdk-updates
%global repo jdk11u
%global revision jdk-11.0.26-ga
%global revision jdk-11.0.23-ga
%global full_revision %{project}-%{repo}-%{revision}
# priority must be 7 digits in total
# setting to 1, so debug ones can have 0
@ -698,9 +695,6 @@ Provides: java-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
Provides: jre-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
Provides: java-headless%{?1} = %{epoch}:%{version}-%{release}
Provides: jre-headless%{?1} = %{epoch}:%{version}-%{release}
# To fix /usr/bin/jjs not provided
Provides: /usr/bin/jjs
}
%define java_devel_rpo() %{expand:
@ -768,7 +762,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
Name: java-%{javaver}-%{origin}
Version: %{newjavaver}.%{buildver}
Release: 1
Release: 6
# 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
@ -797,7 +791,7 @@ Group: Development/Languages
# The test code includes copies of NSS under the Mozilla Public License v2.0
# The PCSClite headers are under a BSD with advertising license
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA-MD
License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
URL: http://openjdk.java.net/
@ -814,6 +808,15 @@ Source9: jconsole.desktop.in
# nss configuration file
Source11: nss.cfg.in
############################################
#
# RPM/distribution specific patches
#
############################################
# NSS via SunPKCS11 Provider (disabled comment
# due to memory leak).
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
############################################
#
# LoongArch64 specific patches
@ -899,9 +902,6 @@ Patch92: 8295068-SSLEngine-throws-NPE-parsing-Certificate.patch
# 11.0.23
Patch93: Cache-byte-when-constructing-String-with-duplicate-c.patch
# 11.0.25
Patch94: change-ActivePrcoessorCount-only-for-HBase.patch
############################################
#
# riscv64 specific patches
@ -1194,7 +1194,6 @@ pushd %{top_level_dir_name}
%patch91 -p1
%patch92 -p1
%patch93 -p1
%patch94 -p1
%endif
%endif
%ifarch loongarch64
@ -1202,6 +1201,8 @@ pushd %{top_level_dir_name}
%endif
popd # openjdk
# %patch1000
# Extract systemtap tapsets
%if %{with_systemtap}
tar --strip-components=1 -x -I xz -f %{SOURCE8}
@ -1290,7 +1291,7 @@ bash ../configure \
--with-version-opt="" \
--with-vendor-version-string="%{vendor_version_string}" \
%ifnarch loongarch64 ppc64le
--with-vendor-name="BiSheng" \
--with-vendor-name="Bisheng" \
%endif
%ifarch loongarch64
--with-vendor-name="Loongson" \
@ -1587,10 +1588,9 @@ else
end
end
-- run content of included file with fake args
arg = nil; -- it is better to null the arg up, no meter if they exists or not, and use cjc as module in unified way, instead of relaying on "main" method during require "copy_jdk_configs.lua"
cjc = require "copy_jdk_configs.lua"
args = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect this 'main', so it should run under all circumstances, except fatal error
arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
cjc.mainProgram(arg)
%post
%{post_script %{nil}}
@ -1715,52 +1715,6 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
%changelog
* Wed Feb 12 2025 Dingli Zhang <dingli@iscas.ac.cn> - 1:11.0.26.4-1
- update riscv64 port to 11.0.26
* Wed Jan 22 2025 Autistic_boyya <wangzhongyi7@huawei.com> - 1:11.0.26.4-0
- modified G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch
* Fri Dec 27 2024 Dingli Zhang <dingli@iscas.ac.cn> - 1:11.0.25.9-4
- Fix build error on docker for riscv64
- Fix bogus date in changelog
* Wed Nov 6 2024 Pan Xuefeng <panxuefeng@loongson.cn> - 1:11.0.25.9-3
- update LoongArch64 port to 11.0.25
* Wed Oct 23 2024 Dingli Zhang <dingli@iscas.ac.cn> - 1:11.0.25.9-2
- update riscv64 port to 11.0.25
* Mon Oct 21 2024 wuyafang <wuyafang@huawei.com> - 1:11.0.25.9-1
- disable lto in spec
- add Provides: /usr/bin/jjs
- update license
* Wed Oct 16 2024 wuyafang <wuyafang@huawei.com> - 1:11.0.25.9-0
- upgrade to 11.0.25+9(GA)
- change default ActiveProcessorCount only for HBase
* Fri Aug 30 2024 songliyang <songliyang@kylinos.cn> - 1.11.0.24.8-6
- update License
* Thu Aug 1 2024 aoqi <aoqi@loongson.cn> - 1.11.0.24.8-5
- update LoongArch64 port to 11.0.24
* Thu Jul 29 2024 DXwangg <wangjiawei80@huawei.com> - 1.11.0.24.8-4
- modified delete_expired_certificates.patch
* Thu Jul 25 2024 songliyang <songliyang@kylinos.cn> - 1.11.0.24.8-3
- update Loongarch support patch to fix the error while applying in prep stage
* Tue Jul 23 2024 songliyang <songliyang@kylinos.cn> - 1.11.0.24.8-2
- null the arg to solve openjdk-headless install error
* Thu Jul 18 2024 Dingli Zhang <dingli@iscas.ac.cn> - 1.11.0.24.8-1
- update riscv64 port to 11.0.24
* Thu Jul 18 2024 DXwangg <wangjiawei80@huawei.com> - 1.11.0.24.8-0
- update to 11.0.24+8(GA)
* Thu Jun 20 2024 aoqi <aoqi@loongson.cn> - 1.11.0.23.9-6
- update LoongArch64 port to 11.0.23

View File

@ -0,0 +1,11 @@
diff -r 5b86f66575b7 src/share/lib/security/java.security-linux
--- openjdk/src/java.base/share/conf/security/java.security Tue May 16 13:29:05 2017 -0700
+++ openjdk/src/java.base/share/conf/security/java.security Tue Jun 06 14:05:12 2017 +0200
@@ -83,6 +83,7 @@
#ifndef solaris
security.provider.tbd=SunPKCS11
#endif
+#security.provider.tbd=SunPKCS11 ${java.home}/lib/security/nss.cfg
#
# A list of preferred providers for specific algorithms. These providers will