Skip to content

Commit 755c9e7

Browse files
authored
Merge pull request #2146 from SAP/pr-jdk-27+3
Merge to tag jdk-27+3
2 parents de7b2ce + 3da886c commit 755c9e7

File tree

656 files changed

+15052
-6282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+15052
-6282
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
<img align="right" width=350 src="https://sapmachine.io/assets/images/logo_circular.svg">
44

55
# [](#SapMachine) SapMachine
6-
SapMachine is a downstream fork of the [OpenJDK](https://openjdk.org/) project. Its purpose is to build and support a binary distribution of OpenJDK for SAP customers and partners.
6+
SapMachine is a downstream fork of the [OpenJDK](https://openjdk.org/) project, aimed at providing a binary distribution of OpenJDK for SAP customers and partners.
77

8-
While maintaining SapMachine, SAP is committed to ensuring the continued success of the Java platform and the OpenJDK project and therefore works in an OpenJDK-upstream-first model. To learn more about our engagement in the OpenJDK, visit [this site](https://sapmachine.io/docs/sap-in-openjdk).
8+
SAP is committed to the ongoing success of the Java platform and the OpenJDK project, maintaining SapMachine in an OpenJDK-upstream-first model. Additional information regarding SAP's engagement in OpenJDK is available on the [SAP OpenJDK Engagement page](https://sapmachine.io/docs/sap-in-openjdk).
99

10-
More details about SapMachine, such as *installation instructions*, *frequently asked questions*, *the maintenance and support statement*, and more are available in the [documentation pages](https://sapmachine.io/docs).
10+
Further details about SapMachine, including *installation instructions*, *frequently asked questions*, *the maintenance and support statement*, can be found on the [documentation pages](https://sapmachine.io/docs).
1111

12-
## Have an issue?
13-
If it's SapMachine specific please let us know by filing a [new issue](https://github.com/SAP/SapMachine/issues/new).
12+
## Issues
13+
For SapMachine-specific concerns, please file a [new issue](https://github.com/SAP/SapMachine/issues/new).
1414

15-
General JVM/JDK bugs are maintained directly in the [OpenJDK Bug System](https://bugs.openjdk.org/). You can open a SapMachine issue with a reference to an open or resolved OpenJDK bug if you want us to resolve the issue or downport the fix to a specific SapMachine version. If you find a general JVM/JDK bug in SapMachine and don't have editor access to the OpenJDK Bug System you can open an issue here and we'll take care to open a corresponding OpenJDK bug for it.
15+
General JVM/JDK bugs are managed in the [OpenJDK Bug System](https://bugs.openjdk.org/). A SapMachine issue can be opened with reference to an existing OpenJDK bug for requesting resolution or backporting the fix to a specific SapMachine version. If a general JVM/JDK bug is found in SapMachine without editor access to the OpenJDK Bug System, an issue can be opened here, and a corresponding OpenJDK bug will be filed by us.
1616

17-
Since SapMachine tracks the OpenJDK, every SapMachine release contains all the fixes/changes of the corresponding OpenJDK release it is based on.
17+
Since SapMachine tracks the OpenJDK, every SapMachine release contains all the fixes/changes of the corresponding OpenJDK release on which it is based.
1818

1919
## Contributing
20-
We currently do not accept external contributions for this project. If you want to improve the code or fix a bug please consider contributing directly to the upstream [OpenJDK](https://openjdk.org/contribute/) project. Our repositories will be regularly synced with OpenJDK, so any improvements in upstream will become effective in SapMachine as well.
20+
External contributions to this project are currently not accepted. For code improvements or bug fixes, contributions should be directed to the upstream [OpenJDK](https://openjdk.org/contribute/) project. Repositories are regularly synced with OpenJDK, ensuring that upstream improvements are realized in SapMachine.
2121

2222
## License
23-
This project is run under the same licensing terms as the upstream OpenJDK project. Please see the [LICENSE](LICENSE) file in the top-level directory for more information.
23+
This project is run under the same licensing terms as the upstream OpenJDK project. Additional information is available in the [LICENSE](LICENSE) file in the top-level directory.

make/autoconf/flags-ldflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
6363
fi
6464
6565
BASIC_LDFLAGS_JVM_ONLY=""
66-
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing"
66+
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing $DEBUG_PREFIX_CFLAGS"
6767
6868
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
6969
7070
elif test "x$TOOLCHAIN_TYPE" = xclang; then
7171
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
7272
-fPIC"
7373
74-
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing"
74+
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing $DEBUG_PREFIX_CFLAGS"
7575
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
7676
7777
if test "x$OPENJDK_TARGET_OS" = xlinux; then

make/modules/java.desktop/lib/ClientLibraries.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
226226
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
227227
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
228228
OPTIMIZATION := SIZE, \
229+
LINK_TIME_OPTIMIZATION := true, \
229230
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
230231
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
231232
$(ICONV_CFLAGS), \

src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,18 @@ static void restore_live_registers(StubAssembler* sasm, bool restore_fpu_registe
310310
__ add(sp, sp, 32 * wordSize);
311311
}
312312

313+
#ifdef R18_RESERVED
314+
/*
315+
Do not modify r18_tls when restoring registers if it is a reserved register. On Windows,
316+
for example, r18_tls is used to store the pointer to the current thread's TEB (where TLS
317+
variables are stored). Therefore, modifying r18_tls would corrupt the TEB pointer.
318+
*/
319+
__ pop(RegSet::range(r0, r17), sp);
320+
__ ldp(zr, r19, Address(__ post(sp, 2 * wordSize)));
321+
__ pop(RegSet::range(r20, r29), sp);
322+
#else
313323
__ pop(RegSet::range(r0, r29), sp);
324+
#endif
314325
}
315326

316327
static void restore_live_registers_except_r0(StubAssembler* sasm, bool restore_fpu_registers = true) {
@@ -323,8 +334,20 @@ static void restore_live_registers_except_r0(StubAssembler* sasm, bool restore_f
323334
__ add(sp, sp, 32 * wordSize);
324335
}
325336

337+
#ifdef R18_RESERVED
338+
/*
339+
Do not modify r18_tls when restoring registers if it is a reserved register. On Windows,
340+
for example, r18_tls is used to store the pointer to the current thread's TEB (where TLS
341+
variables are stored). Therefore, modifying r18_tls would corrupt the TEB pointer.
342+
*/
343+
__ ldp(zr, r1, Address(__ post(sp, 2 * wordSize)));
344+
__ pop(RegSet::range(r2, r17), sp);
345+
__ ldp(zr, r19, Address(__ post(sp, 2 * wordSize)));
346+
__ pop(RegSet::range(r20, r29), sp);
347+
#else
326348
__ ldp(zr, r1, Address(__ post(sp, 16)));
327349
__ pop(RegSet::range(r2, r29), sp);
350+
#endif
328351
}
329352

330353

src/hotspot/cpu/riscv/assembler_riscv.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,6 +2662,9 @@ enum Nf {
26622662
INSN(vsha2ch_vv, 0b1110111, 0b010, 0b1, 0b101110);
26632663
INSN(vsha2cl_vv, 0b1110111, 0b010, 0b1, 0b101111);
26642664

2665+
// Vector GHASH (Zvkg) Extension
2666+
INSN(vghsh_vv, 0b1110111, 0b010, 0b1, 0b101100);
2667+
26652668
#undef INSN
26662669

26672670
#define INSN(NAME, op, funct3, Vs1, funct6) \

src/hotspot/cpu/riscv/globals_riscv.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
123123
product(bool, UseZvkn, false, EXPERIMENTAL, \
124124
"Use Zvkn group extension, Zvkned, Zvknhb, Zvkb, Zvkt") \
125125
product(bool, UseCtxFencei, false, EXPERIMENTAL, \
126-
"Use PR_RISCV_CTX_SW_FENCEI_ON to avoid explicit icache flush")
126+
"Use PR_RISCV_CTX_SW_FENCEI_ON to avoid explicit icache flush") \
127+
product(bool, UseZvkg, false, EXPERIMENTAL, "Use Zvkg instructions")
127128

128129
#endif // CPU_RISCV_GLOBALS_RISCV_HPP

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,8 +2655,7 @@ class StubGenerator: public StubCodeGenerator {
26552655
// x10 - input length
26562656
//
26572657
address generate_cipherBlockChaining_encryptAESCrypt() {
2658-
assert(UseAESIntrinsics, "Must be");
2659-
assert(UseZvkn, "need AES instructions (Zvkned extension) support");
2658+
assert(UseAESIntrinsics, "need AES instructions (Zvkned extension) support");
26602659
__ align(CodeEntryAlignment);
26612660
StubId stub_id = StubId::stubgen_cipherBlockChaining_encryptAESCrypt_id;
26622661
StubCodeMark mark(this, stub_id);
@@ -2745,8 +2744,7 @@ class StubGenerator: public StubCodeGenerator {
27452744
// x10 - input length
27462745
//
27472746
address generate_cipherBlockChaining_decryptAESCrypt() {
2748-
assert(UseAESIntrinsics, "Must be");
2749-
assert(UseZvkn, "need AES instructions (Zvkned extension) support");
2747+
assert(UseAESIntrinsics, "need AES instructions (Zvkned extension) support");
27502748
__ align(CodeEntryAlignment);
27512749
StubId stub_id = StubId::stubgen_cipherBlockChaining_decryptAESCrypt_id;
27522750
StubCodeMark mark(this, stub_id);
@@ -2950,9 +2948,7 @@ class StubGenerator: public StubCodeGenerator {
29502948
// x10 - input length
29512949
//
29522950
address generate_counterMode_AESCrypt() {
2953-
assert(UseAESCTRIntrinsics, "Must be");
2954-
assert(UseZvkn, "need AES instructions (Zvkned extension) support");
2955-
assert(UseZbb, "need basic bit manipulation (Zbb extension) support");
2951+
assert(UseAESCTRIntrinsics, "need AES instructions (Zvkned extension) and Zbb extension support");
29562952

29572953
__ align(CodeEntryAlignment);
29582954
StubId stub_id = StubId::stubgen_counterMode_AESCrypt_id;
@@ -3001,6 +2997,63 @@ class StubGenerator: public StubCodeGenerator {
30012997
return start;
30022998
}
30032999

3000+
/**
3001+
* Arguments:
3002+
*
3003+
* Input:
3004+
* c_rarg0 - current state address
3005+
* c_rarg1 - H key address
3006+
* c_rarg2 - data address
3007+
* c_rarg3 - number of blocks
3008+
*
3009+
* Output:
3010+
* Updated state at c_rarg0
3011+
*/
3012+
address generate_ghash_processBlocks() {
3013+
assert(UseGHASHIntrinsics, "need GHASH instructions (Zvkg extension) and Zvbb support");
3014+
3015+
__ align(CodeEntryAlignment);
3016+
StubId stub_id = StubId::stubgen_ghash_processBlocks_id;
3017+
StubCodeMark mark(this, stub_id);
3018+
3019+
address start = __ pc();
3020+
__ enter();
3021+
3022+
Register state = c_rarg0;
3023+
Register subkeyH = c_rarg1;
3024+
Register data = c_rarg2;
3025+
Register blocks = c_rarg3;
3026+
3027+
VectorRegister partial_hash = v1;
3028+
VectorRegister hash_subkey = v2;
3029+
VectorRegister cipher_text = v3;
3030+
3031+
const unsigned int BLOCK_SIZE = 16;
3032+
3033+
__ vsetivli(x0, 2, Assembler::e64, Assembler::m1);
3034+
__ vle64_v(hash_subkey, subkeyH);
3035+
__ vrev8_v(hash_subkey, hash_subkey);
3036+
__ vle64_v(partial_hash, state);
3037+
__ vrev8_v(partial_hash, partial_hash);
3038+
3039+
__ vsetivli(x0, 4, Assembler::e32, Assembler::m1);
3040+
Label L_ghash_loop;
3041+
__ bind(L_ghash_loop);
3042+
__ vle32_v(cipher_text, data);
3043+
__ addi(data, data, BLOCK_SIZE);
3044+
__ vghsh_vv(partial_hash, hash_subkey, cipher_text);
3045+
__ subi(blocks, blocks, 1);
3046+
__ bnez(blocks, L_ghash_loop);
3047+
3048+
__ vsetivli(x0, 2, Assembler::e64, Assembler::m1);
3049+
__ vrev8_v(partial_hash, partial_hash);
3050+
__ vse64_v(partial_hash, state);
3051+
__ leave();
3052+
__ ret();
3053+
3054+
return start;
3055+
}
3056+
30043057
// code for comparing 8 characters of strings with Latin1 and Utf16 encoding
30053058
void compare_string_8_x_LU(Register tmpL, Register tmpU,
30063059
Register strL, Register strU, Label& DIFF) {
@@ -7227,6 +7280,10 @@ static const int64_t right_3_bits = right_n_bits(3);
72277280
StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt();
72287281
}
72297282

7283+
if (UseGHASHIntrinsics) {
7284+
StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks();
7285+
}
7286+
72307287
if (UsePoly1305Intrinsics) {
72317288
StubRoutines::_poly1305_processBlocks = generate_poly1305_processBlocks();
72327289
}

src/hotspot/cpu/riscv/vm_version_riscv.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,22 @@ void VM_Version::c2_initialize() {
457457
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
458458
}
459459
}
460+
461+
if (UseZvkg) {
462+
if (FLAG_IS_DEFAULT(UseGHASHIntrinsics) && UseZvbb) {
463+
FLAG_SET_DEFAULT(UseGHASHIntrinsics, true);
464+
}
465+
466+
if (UseGHASHIntrinsics && !UseZvbb) {
467+
warning("Cannot enable UseGHASHIntrinsics on cpu without UseZvbb support");
468+
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
469+
}
470+
} else {
471+
if (UseGHASHIntrinsics) {
472+
warning("Cannot enable UseGHASHIntrinsics on cpu without UseZvkg support");
473+
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
474+
}
475+
}
460476
}
461477

462478
#endif // COMPILER2

src/hotspot/cpu/riscv/vm_version_riscv.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ class VM_Version : public Abstract_VM_Version {
289289
decl(Zvfh , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvfh, &ext_v, &ext_Zfh, nullptr)) \
290290
/* Shorthand for Zvkned + Zvknhb + Zvkb + Zvkt */ \
291291
decl(Zvkn , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvkn, &ext_v, nullptr)) \
292+
/* Zvkg crypto extension for ghash and gcm */ \
293+
decl(Zvkg , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvkg, &ext_v, nullptr)) \
292294

293295
#define DECLARE_RV_EXT_FEATURE(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
294296
struct ext_##PRETTY##RVExtFeatureValue : public RVExtFeatureValue { \

src/hotspot/cpu/x86/assembler_x86.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ const int FPUStateSizeInWords = 2688 / wordSize;
449449
// imm8[1:0] = 00 (min) / 01 (max)
450450
//
451451
// [1] https://www.intel.com/content/www/us/en/content-details/856721/intel-advanced-vector-extensions-10-2-intel-avx10-2-architecture-specification.html?wapkw=AVX10
452-
const int AVX10_MINMAX_MAX_COMPARE_SIGN = 0x5;
453-
const int AVX10_MINMAX_MIN_COMPARE_SIGN = 0x4;
452+
const int AVX10_2_MINMAX_MAX_COMPARE_SIGN = 0x5;
453+
const int AVX10_2_MINMAX_MIN_COMPARE_SIGN = 0x4;
454454

455455
// The Intel x86/Amd64 Assembler: Pure assembler doing NO optimizations on the instruction
456456
// level (e.g. mov rax, 0 is not translated into xor rax, rax!); i.e., what you write

0 commit comments

Comments
 (0)