Update to aarch64-shenandoah-jdk8u212-b02.

Remove patches included upstream
- JDK-8197429/PR3546/RH153662{2,3}
- JDK-8184309/PR3596
- JDK-8210647/RH1632174
- JDK-8029661/PR3642/RH1477159
- JDK-8145096/PR3693
Re-generate patches
- JDK-8203030
Add casts to resolve s390 ambiguity in calls to log2_intptr
Move JDK-8219772 to correct section as not yet upstreamed
Add new clhsdb and hsdb binaries.

Resolves: rhbz#1680640
This commit is contained in:
Andrew Hughes 2019-04-16 05:55:21 +01:00
parent 2f0cb2fea7
commit c7048023e9
10 changed files with 108 additions and 2952 deletions

1
.gitignore vendored
View File

@ -134,3 +134,4 @@
/tapsets-icedtea-3.11.0.tar.xz /tapsets-icedtea-3.11.0.tar.xz
/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u201-b13.tar.xz /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u201-b13.tar.xz
/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u202-b08.tar.xz /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u202-b08.tar.xz
/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u212-b02.tar.xz

View File

@ -226,7 +226,7 @@
# note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there.
%global shenandoah_project aarch64-port %global shenandoah_project aarch64-port
%global shenandoah_repo jdk8u-shenandoah %global shenandoah_repo jdk8u-shenandoah
%global shenandoah_revision aarch64-shenandoah-jdk8u202-b08 %global shenandoah_revision aarch64-shenandoah-jdk8u212-b02
# Define old aarch64/jdk8u tree variables for compatibility # Define old aarch64/jdk8u tree variables for compatibility
%global project %{shenandoah_project} %global project %{shenandoah_project}
%global repo %{shenandoah_repo} %global repo %{shenandoah_repo}
@ -578,6 +578,8 @@ exit 0
%dir %{_jvmdir}/%{jredir -- %{?1}} %dir %{_jvmdir}/%{jredir -- %{?1}}
%dir %{_jvmdir}/%{jredir -- %{?1}}/bin %dir %{_jvmdir}/%{jredir -- %{?1}}/bin
%dir %{_jvmdir}/%{jredir -- %{?1}}/lib %dir %{_jvmdir}/%{jredir -- %{?1}}/lib
%{_jvmdir}/%{jredir -- %{?1}}/bin/clhsdb
%{_jvmdir}/%{jredir -- %{?1}}/bin/hsdb
%{_jvmdir}/%{jredir -- %{?1}}/bin/java %{_jvmdir}/%{jredir -- %{?1}}/bin/java
%{_jvmdir}/%{jredir -- %{?1}}/bin/jjs %{_jvmdir}/%{jredir -- %{?1}}/bin/jjs
%{_jvmdir}/%{jredir -- %{?1}}/bin/keytool %{_jvmdir}/%{jredir -- %{?1}}/bin/keytool
@ -723,7 +725,9 @@ exit 0
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/include %dir %{_jvmdir}/%{sdkdir -- %{?1}}/include
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib %dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/appletviewer %{_jvmdir}/%{sdkdir -- %{?1}}/bin/appletviewer
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/clhsdb
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/extcheck %{_jvmdir}/%{sdkdir -- %{?1}}/bin/extcheck
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/hsdb
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/idlj %{_jvmdir}/%{sdkdir -- %{?1}}/bin/idlj
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar %{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jarsigner %{_jvmdir}/%{sdkdir -- %{?1}}/bin/jarsigner
@ -1116,6 +1120,8 @@ Patch540: pr3575-rh1567204-system_cacerts_database_handling_no_longer_affect_jss
Patch300: pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch Patch300: pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch
# PR3655: Allow use of system crypto policy to be disabled by the user # PR3655: Allow use of system crypto policy to be disabled by the user
Patch301: pr3655-toggle_system_crypto_policy.patch Patch301: pr3655-toggle_system_crypto_policy.patch
# JDK-8219772: EXTRA_CFLAGS not being picked up for assembler files
Patch110: jdk8219772-extra_c_cxx_flags_not_picked_for_assembler_source.patch
############################################# #############################################
# #
@ -1134,6 +1140,8 @@ Patch103: pr3593-s390_use_z_format_specifier_for_size_t_arguments_as_size_t_not_
Patch105: jdk8199936-pr3533-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x.patch Patch105: jdk8199936-pr3533-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x.patch
# AArch64: PR3519: Fix further functions with a missing return value (AArch64) # AArch64: PR3519: Fix further functions with a missing return value (AArch64)
Patch106: pr3519-fix_further_functions_with_a_missing_return_value.patch Patch106: pr3519-fix_further_functions_with_a_missing_return_value.patch
# S390 ambiguous log2_intptr calls
Patch107: s390-8214206_fix.patch
############################################# #############################################
# #
@ -1149,16 +1157,12 @@ Patch106: pr3519-fix_further_functions_with_a_missing_return_value.patch
Patch502: pr2462-resolve_disabled_warnings_for_libunpack_and_the_unpack200_binary.patch Patch502: pr2462-resolve_disabled_warnings_for_libunpack_and_the_unpack200_binary.patch
# S8154313: Generated javadoc scattered all over the place # S8154313: Generated javadoc scattered all over the place
Patch400: jdk8154313-generated_javadoc_scattered_all_over_the_place.patch Patch400: jdk8154313-generated_javadoc_scattered_all_over_the_place.patch
# 8197429, PR3546, RH153662{2,3}: 32 bit java app started via JNI crashes with larger stack sizes
Patch561: jdk8197429-pr3546-rh1536622-increased_stack_guard_causes_segfaults_on_x86_32.patch
# 8171000, PR3542, RH1402819: Robot.createScreenCapture() crashes in wayland mode # 8171000, PR3542, RH1402819: Robot.createScreenCapture() crashes in wayland mode
Patch563: jdk8171000-pr3542-rh1402819-robot_createScreenCapture_crashes_in_wayland_mode.patch Patch563: jdk8171000-pr3542-rh1402819-robot_createScreenCapture_crashes_in_wayland_mode.patch
# 8197546, PR3542, RH1402819: Fix for 8171000 breaks Solaris + Linux builds # 8197546, PR3542, RH1402819: Fix for 8171000 breaks Solaris + Linux builds
Patch564: jdk8197546-pr3542-rh1402819-fix_for_8171000_breaks_solaris_linux_builds.patch Patch564: jdk8197546-pr3542-rh1402819-fix_for_8171000_breaks_solaris_linux_builds.patch
# PR3591: Fix for bug 3533 doesn't add -mstackrealign to JDK code # PR3591: Fix for bug 3533 doesn't add -mstackrealign to JDK code
Patch571: jdk8199936-pr3591-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x_jdk.patch Patch571: jdk8199936-pr3591-enable_mstackrealign_on_x86_linux_as_well_as_x86_mac_os_x_jdk.patch
# 8184309, PR3596: Build warnings from GCC 7.1 on Fedora 26
Patch572: jdk8184309-pr3596-build_warnings_from_gcc_7_1_on_fedora_26.patch
# 8141570, PR3548: Fix Zero interpreter build for --disable-precompiled-headers # 8141570, PR3548: Fix Zero interpreter build for --disable-precompiled-headers
Patch573: jdk8141570-pr3548-fix_zero_interpreter_build_for_disable_precompiled_headers.patch Patch573: jdk8141570-pr3548-fix_zero_interpreter_build_for_disable_precompiled_headers.patch
# 8143245, PR3548: Zero build requires disabled warnings # 8143245, PR3548: Zero build requires disabled warnings
@ -1177,8 +1181,6 @@ Patch202: jdk8035341-allow_using_system_installed_libpng.patch
Patch203: jdk8042159-allow_using_system_installed_lcms2.patch Patch203: jdk8042159-allow_using_system_installed_lcms2.patch
# 8210761: libjsig is being compiled without optimization # 8210761: libjsig is being compiled without optimization
Patch620: jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch Patch620: jdk8210761-rh1632174-libjsig_is_being_compiled_without_optimization.patch
# 8210647: libsaproc is being compiled without optimization
Patch621: jdk8210647-rh1632174-libsaproc_is_being_compiled_without_optimization.patch
# 8210416: [linux] Poor StrictMath performance due to non-optimized compilation # 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
Patch622: jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch Patch622: jdk8210416-rh1632174-compile_fdlibm_with_o2_ffp_contract_off_on_gcc_clang_arches.patch
# 8210425: [x86] sharedRuntimeTrig/sharedRuntimeTrans compiled without optimization # 8210425: [x86] sharedRuntimeTrig/sharedRuntimeTrans compiled without optimization
@ -1193,29 +1195,13 @@ Patch625: jdk8210425-rh1632174-03-compile_with_o2_and_ffp_contract_off_as_for_fd
############################################# #############################################
# #
# Patches appearing in 8u212 # Patches appearing in 8u222
# #
# This section includes patches which are present # This section includes patches which are present
# in the listed OpenJDK 8u release and should be # in the listed OpenJDK 8u release and should be
# able to be removed once that release is out # able to be removed once that release is out
# and used by this RPM. # and used by this RPM.
############################################# #############################################
# 8219772: EXTRA_CFLAGS not being picked up for assembler files
Patch110: jdk8219772-extra_c_cxx_flags_not_picked_for_assembler_source.patch
#############################################
#
# Patches appearing in 8u211
#
# This section includes patches which are present
# in the listed OpenJDK 8u release and should be
# able to be removed once that release is out
# and used by this RPM.
#############################################
# JDK-8029661, PR3642, RH1477159: Support TLS v1.2 algorithm in SunPKCS11 provider
Patch585: jdk8029661-pr3642-rh1477159-add_tlsv1_2_support_to_pkcs11_provider.patch
# JDK-8145096, PR3693: Undefined behaviour in HotSpot
Patch588: jdk8145096-pr3693-undefined_behaviour.patch
############################################# #############################################
# #
@ -1576,6 +1562,7 @@ sh %{SOURCE12}
# s390 build fixes # s390 build fixes
%patch102 %patch102
%patch103 %patch103
%patch107
# AArch64 fixes # AArch64 fixes
%patch106 %patch106
@ -1599,24 +1586,19 @@ sh %{SOURCE12}
%patch528 %patch528
%patch529 %patch529
%patch530 %patch530
%patch561
%patch563 %patch563
%patch564 %patch564
%patch571 %patch571
%patch572
%patch573 %patch573
%patch574 %patch574
%patch575 %patch575
%patch576 %patch576
%patch577 %patch577
%patch620 %patch620
%patch621
%patch622 %patch622
%patch623 %patch623
%patch624 %patch624
%patch625 %patch625
%patch585
%patch588
%patch110 %patch110
# RPM-only fixes # RPM-only fixes
@ -2285,6 +2267,21 @@ require "copy_jdk_configs.lua"
%endif %endif
%changelog %changelog
* Tue Apr 09 2019 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.212.b02-0
- Update to aarch64-shenandoah-jdk8u212-b02.
- Remove patches included upstream
- JDK-8197429/PR3546/RH153662{2,3}
- JDK-8184309/PR3596
- JDK-8210647/RH1632174
- JDK-8029661/PR3642/RH1477159
- JDK-8145096/PR3693
- Re-generate patches
- JDK-8203030
- Add casts to resolve s390 ambiguity in calls to log2_intptr
- Move JDK-8219772 to correct section as not yet upstreamed
- Add new clhsdb and hsdb binaries.
- Resolves: rhbz#1680640
* Sun Apr 07 2019 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.202.b08-0 * Sun Apr 07 2019 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.202.b08-0
- Update to aarch64-shenandoah-jdk8u202-b08. - Update to aarch64-shenandoah-jdk8u202-b08.
- Remove patches included upstream - Remove patches included upstream

View File

@ -1,280 +0,0 @@
# HG changeset patch
# User aph
# Date 1549014450 -3600
# Fri Feb 01 10:47:30 2019 +0100
# Node ID f43f77de876acfbf29c02803418d4d06d83e7dc3
# Parent 28f68e5c6fb323c521a489cfc92e8a129379378f
8145096: Undefined behaviour in HotSpot
Summary: Fix some integer overflows
Reviewed-by: jrose, kvn, kbarrett, adinn, iklam
diff --git openjdk.orig/hotspot/src/os/posix/vm/os_posix.cpp openjdk/hotspot/src/os/posix/vm/os_posix.cpp
--- openjdk.orig/hotspot/src/os/posix/vm/os_posix.cpp
+++ openjdk/hotspot/src/os/posix/vm/os_posix.cpp
@@ -604,7 +604,11 @@
strncpy(buffer, "none", size);
const struct {
- int i;
+ // NB: i is an unsigned int here because SA_RESETHAND is on some
+ // systems 0x80000000, which is implicitly unsigned. Assignining
+ // it to an int field would be an overflow in unsigned-to-signed
+ // conversion.
+ unsigned int i;
const char* s;
} flaginfo [] = {
{ SA_NOCLDSTOP, "SA_NOCLDSTOP" },
diff --git openjdk.orig/hotspot/src/share/vm/opto/addnode.cpp openjdk/hotspot/src/share/vm/opto/addnode.cpp
--- openjdk.orig/hotspot/src/share/vm/opto/addnode.cpp
+++ openjdk/hotspot/src/share/vm/opto/addnode.cpp
@@ -344,8 +344,8 @@
const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const {
const TypeInt *r0 = t0->is_int(); // Handy access
const TypeInt *r1 = t1->is_int();
- int lo = r0->_lo + r1->_lo;
- int hi = r0->_hi + r1->_hi;
+ int lo = java_add(r0->_lo, r1->_lo);
+ int hi = java_add(r0->_hi, r1->_hi);
if( !(r0->is_con() && r1->is_con()) ) {
// Not both constants, compute approximate result
if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) {
@@ -462,8 +462,8 @@
const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const {
const TypeLong *r0 = t0->is_long(); // Handy access
const TypeLong *r1 = t1->is_long();
- jlong lo = r0->_lo + r1->_lo;
- jlong hi = r0->_hi + r1->_hi;
+ jlong lo = java_add(r0->_lo, r1->_lo);
+ jlong hi = java_add(r0->_hi, r1->_hi);
if( !(r0->is_con() && r1->is_con()) ) {
// Not both constants, compute approximate result
if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) {
diff --git openjdk.orig/hotspot/src/share/vm/opto/loopTransform.cpp openjdk/hotspot/src/share/vm/opto/loopTransform.cpp
--- openjdk.orig/hotspot/src/share/vm/opto/loopTransform.cpp
+++ openjdk/hotspot/src/share/vm/opto/loopTransform.cpp
@@ -1310,8 +1310,8 @@
limit = new (C) Opaque2Node( C, limit );
register_new_node( limit, opaq_ctrl );
}
- if (stride_con > 0 && ((limit_type->_lo - stride_con) < limit_type->_lo) ||
- stride_con < 0 && ((limit_type->_hi - stride_con) > limit_type->_hi)) {
+ if (stride_con > 0 && (java_subtract(limit_type->_lo, stride_con) < limit_type->_lo) ||
+ stride_con < 0 && (java_subtract(limit_type->_hi, stride_con) > limit_type->_hi)) {
// No underflow.
new_limit = new (C) SubINode(limit, stride);
} else {
diff --git openjdk.orig/hotspot/src/share/vm/opto/mulnode.cpp openjdk/hotspot/src/share/vm/opto/mulnode.cpp
--- openjdk.orig/hotspot/src/share/vm/opto/mulnode.cpp
+++ openjdk/hotspot/src/share/vm/opto/mulnode.cpp
@@ -244,13 +244,13 @@
double d = (double)hi1;
// Compute all endpoints & check for overflow
- int32 A = lo0*lo1;
+ int32 A = java_multiply(lo0, lo1);
if( (double)A != a*c ) return TypeInt::INT; // Overflow?
- int32 B = lo0*hi1;
+ int32 B = java_multiply(lo0, hi1);
if( (double)B != a*d ) return TypeInt::INT; // Overflow?
- int32 C = hi0*lo1;
+ int32 C = java_multiply(hi0, lo1);
if( (double)C != b*c ) return TypeInt::INT; // Overflow?
- int32 D = hi0*hi1;
+ int32 D = java_multiply(hi0, hi1);
if( (double)D != b*d ) return TypeInt::INT; // Overflow?
if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints
@@ -340,13 +340,13 @@
double d = (double)hi1;
// Compute all endpoints & check for overflow
- jlong A = lo0*lo1;
+ jlong A = java_multiply(lo0, lo1);
if( (double)A != a*c ) return TypeLong::LONG; // Overflow?
- jlong B = lo0*hi1;
+ jlong B = java_multiply(lo0, hi1);
if( (double)B != a*d ) return TypeLong::LONG; // Overflow?
- jlong C = hi0*lo1;
+ jlong C = java_multiply(hi0, lo1);
if( (double)C != b*c ) return TypeLong::LONG; // Overflow?
- jlong D = hi0*hi1;
+ jlong D = java_multiply(hi0, hi1);
if( (double)D != b*d ) return TypeLong::LONG; // Overflow?
if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints
@@ -573,7 +573,8 @@
// Masking off high bits which are always zero is useless.
const TypeLong* t1 = phase->type( in(1) )->isa_long();
if (t1 != NULL && t1->_lo >= 0) {
- jlong t1_support = ((jlong)1 << (1 + log2_long(t1->_hi))) - 1;
+ int bit_count = log2_long(t1->_hi) + 1;
+ jlong t1_support = jlong(max_julong >> (BitsPerJavaLong - bit_count));
if ((t1_support & con) == t1_support)
return usr;
}
@@ -801,7 +802,7 @@
// Check for ((x & ((CONST64(1)<<(64-c0))-1)) << c0) which ANDs off high bits
// before shifting them away.
- const jlong bits_mask = ((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) - CONST64(1);
+ const jlong bits_mask = jlong(max_julong >> con);
if( add1_op == Op_AndL &&
phase->type(add1->in(2)) == TypeLong::make( bits_mask ) )
return new (phase->C) LShiftLNode( add1->in(1), in(2) );
@@ -1253,7 +1254,7 @@
if ( con == 0 ) return NULL; // let Identity() handle a 0 shift count
// note: mask computation below does not work for 0 shift count
// We'll be wanting the right-shift amount as a mask of that many bits
- const jlong mask = (((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) -1);
+ const jlong mask = jlong(max_julong >> con);
// Check for ((x << z) + Y) >>> z. Replace with x + con>>>z
// The idiom for rounding to a power of 2 is "(Q+(2^z-1)) >>> z".
diff --git openjdk.orig/hotspot/src/share/vm/opto/subnode.cpp openjdk/hotspot/src/share/vm/opto/subnode.cpp
--- openjdk.orig/hotspot/src/share/vm/opto/subnode.cpp
+++ openjdk/hotspot/src/share/vm/opto/subnode.cpp
@@ -252,8 +252,8 @@
const Type *SubINode::sub( const Type *t1, const Type *t2 ) const {
const TypeInt *r0 = t1->is_int(); // Handy access
const TypeInt *r1 = t2->is_int();
- int32 lo = r0->_lo - r1->_hi;
- int32 hi = r0->_hi - r1->_lo;
+ int32 lo = java_subtract(r0->_lo, r1->_hi);
+ int32 hi = java_subtract(r0->_hi, r1->_lo);
// We next check for 32-bit overflow.
// If that happens, we just assume all integers are possible.
@@ -361,8 +361,8 @@
const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const {
const TypeLong *r0 = t1->is_long(); // Handy access
const TypeLong *r1 = t2->is_long();
- jlong lo = r0->_lo - r1->_hi;
- jlong hi = r0->_hi - r1->_lo;
+ jlong lo = java_subtract(r0->_lo, r1->_hi);
+ jlong hi = java_subtract(r0->_hi, r1->_lo);
// We next check for 32-bit overflow.
// If that happens, we just assume all integers are possible.
diff --git openjdk.orig/hotspot/src/share/vm/opto/type.cpp openjdk/hotspot/src/share/vm/opto/type.cpp
--- openjdk.orig/hotspot/src/share/vm/opto/type.cpp
+++ openjdk/hotspot/src/share/vm/opto/type.cpp
@@ -1329,8 +1329,8 @@
// The new type narrows the old type, so look for a "death march".
// See comments on PhaseTransform::saturate.
- juint nrange = _hi - _lo;
- juint orange = ohi - olo;
+ juint nrange = (juint)_hi - _lo;
+ juint orange = (juint)ohi - olo;
if (nrange < max_juint - 1 && nrange > (orange >> 1) + (SMALLINT*2)) {
// Use the new type only if the range shrinks a lot.
// We do not want the optimizer computing 2^31 point by point.
@@ -1363,7 +1363,7 @@
//------------------------------hash-------------------------------------------
// Type-specific hashing function.
int TypeInt::hash(void) const {
- return _lo+_hi+_widen+(int)Type::Int;
+ return java_add(java_add(_lo, _hi), java_add(_widen, (int)Type::Int));
}
//------------------------------is_finite--------------------------------------
@@ -1544,7 +1544,7 @@
// If neither endpoint is extremal yet, push out the endpoint
// which is closer to its respective limit.
if (_lo >= 0 || // easy common case
- (julong)(_lo - min) >= (julong)(max - _hi)) {
+ ((julong)_lo - min) >= ((julong)max - _hi)) {
// Try to widen to an unsigned range type of 32/63 bits:
if (max >= max_juint && _hi < max_juint)
return make(_lo, max_juint, WidenMax);
@@ -2314,7 +2314,7 @@
//------------------------------hash-------------------------------------------
// Type-specific hashing function.
int TypePtr::hash(void) const {
- return _ptr + _offset;
+ return java_add(_ptr, _offset);
}
//------------------------------dump2------------------------------------------
@@ -2904,12 +2904,8 @@
// Type-specific hashing function.
int TypeOopPtr::hash(void) const {
return
- (const_oop() ? const_oop()->hash() : 0) +
- _klass_is_exact +
- _instance_id +
- hash_speculative() +
- _inline_depth +
- TypePtr::hash();
+ java_add(java_add(java_add(const_oop() ? const_oop()->hash() : 0, _klass_is_exact),
+ java_add(_instance_id , hash_speculative())), java_add(_inline_depth , TypePtr::hash()));
}
//------------------------------dump2------------------------------------------
@@ -3635,7 +3631,7 @@
//------------------------------hash-------------------------------------------
// Type-specific hashing function.
int TypeInstPtr::hash(void) const {
- int hash = klass()->hash() + TypeOopPtr::hash();
+ int hash = java_add(klass()->hash(), TypeOopPtr::hash());
return hash;
}
@@ -4530,7 +4526,7 @@
//------------------------------hash-------------------------------------------
// Type-specific hashing function.
int TypeKlassPtr::hash(void) const {
- return klass()->hash() + TypePtr::hash();
+ return java_add(klass()->hash(), TypePtr::hash());
}
//------------------------------singleton--------------------------------------
diff --git openjdk.orig/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp openjdk/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
--- openjdk.orig/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
+++ openjdk/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
@@ -131,7 +131,8 @@
}
double AdvancedThresholdPolicy::weight(Method* method) {
- return (method->rate() + 1) * ((method->invocation_count() + 1) * (method->backedge_count() + 1));
+ return (double)(method->rate() + 1) *
+ (method->invocation_count() + 1) * (method->backedge_count() + 1);
}
// Apply heuristics and return true if x should be compiled before y
diff --git openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp
--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp
+++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp
@@ -1403,6 +1403,32 @@
#define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0]))
+//----------------------------------------------------------------------------------------------------
+// Sum and product which can never overflow: they wrap, just like the
+// Java operations. Note that we don't intend these to be used for
+// general-purpose arithmetic: their purpose is to emulate Java
+// operations.
+
+// The goal of this code to avoid undefined or implementation-defined
+// behaviour. The use of an lvalue to reference cast is explicitly
+// permitted by Lvalues and rvalues [basic.lval]. [Section 3.10 Para
+// 15 in C++03]
+#define JAVA_INTEGER_OP(OP, NAME, TYPE, UNSIGNED_TYPE) \
+inline TYPE NAME (TYPE in1, TYPE in2) { \
+ UNSIGNED_TYPE ures = static_cast<UNSIGNED_TYPE>(in1); \
+ ures OP ## = static_cast<UNSIGNED_TYPE>(in2); \
+ return reinterpret_cast<TYPE&>(ures); \
+}
+
+JAVA_INTEGER_OP(+, java_add, jint, juint)
+JAVA_INTEGER_OP(-, java_subtract, jint, juint)
+JAVA_INTEGER_OP(*, java_multiply, jint, juint)
+JAVA_INTEGER_OP(+, java_add, jlong, julong)
+JAVA_INTEGER_OP(-, java_subtract, jlong, julong)
+JAVA_INTEGER_OP(*, java_multiply, jlong, julong)
+
+#undef JAVA_INTEGER_OP
+
// Dereference vptr
// All C++ compilers that we know of have the vtbl pointer in the first
// word. If there are exceptions, this function needs to be made compiler

View File

@ -1,21 +0,0 @@
# HG changeset patch
# User ysuenaga
# Date 1527498573 -3600
# Mon May 28 10:09:33 2018 +0100
# Node ID ef176cb429c49d1c330d9575938f66b04e3fb730
# Parent 6915dc9ae18cce5625d3a3fc74b37da70a5b4215
8184309, PR3596: Build warnings from GCC 7.1 on Fedora 26
Reviewed-by: kbarrett, vlivanov
diff --git openjdk.orig/hotspot/src/share/vm/code/dependencies.cpp openjdk/hotspot/src/share/vm/code/dependencies.cpp
--- openjdk.orig/hotspot/src/share/vm/code/dependencies.cpp
+++ openjdk/hotspot/src/share/vm/code/dependencies.cpp
@@ -525,7 +525,7 @@
xtty->object("x", arg.metadata_value());
}
} else {
- char xn[10]; sprintf(xn, "x%d", j);
+ char xn[12]; sprintf(xn, "x%d", j);
if (arg.is_oop()) {
xtty->object(xn, arg.oop_value());
} else {

View File

@ -1,286 +0,0 @@
# HG changeset patch
# User aph
# Date 1530894306 -3600
# Fri Jul 06 17:25:06 2018 +0100
# Node ID 1485461a0fd1ff977a6acb8f2ed1069aaaf3b07e
# Parent d7bcbcfde5057ad066ad2fb55a87d19a5827ddee
8197429: Increased stack guard causes segfaults on x86-32
Reviewed-by: dholmes
diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
@@ -724,6 +724,10 @@
}
}
+void os::Linux::expand_stack_to(address bottom) {
+ _expand_stack_to(bottom);
+}
+
bool os::Linux::manually_expand_stack(JavaThread * t, address addr) {
assert(t!=NULL, "just checking");
assert(t->osthread()->expanding_stack(), "expand should be set");
diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp openjdk/hotspot/src/os/linux/vm/os_linux.hpp
--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp
@@ -249,6 +249,8 @@
static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime);
private:
+ static void expand_stack_to(address bottom);
+
typedef int (*sched_getcpu_func_t)(void);
typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen);
typedef int (*numa_max_node_func_t)(void);
diff --git openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -892,6 +892,27 @@
void os::workaround_expand_exec_shield_cs_limit() {
#if defined(IA32)
size_t page_size = os::vm_page_size();
+
+ /*
+ * JDK-8197429
+ *
+ * Expand the stack mapping to the end of the initial stack before
+ * attempting to install the codebuf. This is needed because newer
+ * Linux kernels impose a distance of a megabyte between stack
+ * memory and other memory regions. If we try to install the
+ * codebuf before expanding the stack the installation will appear
+ * to succeed but we'll get a segfault later if we expand the stack
+ * in Java code.
+ *
+ */
+ if (os::is_primordial_thread()) {
+ address limit = Linux::initial_thread_stack_bottom();
+ if (! DisablePrimordialThreadGuardPages) {
+ limit += (StackYellowPages + StackRedPages) * page_size;
+ }
+ os::Linux::expand_stack_to(limit);
+ }
+
/*
* Take the highest VA the OS will give us and exec
*
@@ -910,6 +931,16 @@
char* hint = (char*) (Linux::initial_thread_stack_bottom() -
((StackYellowPages + StackRedPages + 1) * page_size));
char* codebuf = os::attempt_reserve_memory_at(page_size, hint);
+
+ if (codebuf == NULL) {
+ // JDK-8197429: There may be a stack gap of one megabyte between
+ // the limit of the stack and the nearest memory region: this is a
+ // Linux kernel workaround for CVE-2017-1000364. If we failed to
+ // map our codebuf, try again at an address one megabyte lower.
+ hint -= 1 * M;
+ codebuf = os::attempt_reserve_memory_at(page_size, hint);
+ }
+
if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) {
return; // No matter, we tried, best effort.
}
diff --git openjdk.orig/hotspot/test/runtime/StackGap/T.java openjdk/hotspot/test/runtime/StackGap/T.java
new file mode 100644
--- /dev/null
+++ openjdk/hotspot/test/runtime/StackGap/T.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class T {
+
+ public static void test(int n) {
+ if (n == 0) return;
+ System.out.println (n);
+ test (n - 1);
+
+ }
+
+}
diff --git openjdk.orig/hotspot/test/runtime/StackGap/exestack-gap.c openjdk/hotspot/test/runtime/StackGap/exestack-gap.c
new file mode 100644
--- /dev/null
+++ openjdk/hotspot/test/runtime/StackGap/exestack-gap.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <jni.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+JNIEnv* create_vm(JavaVM **jvm, char *extra_option)
+{
+ JNIEnv* env;
+ JavaVMInitArgs args;
+ JavaVMOption options[4];
+ args.version = JNI_VERSION_1_8;
+ args.nOptions = 3 + (extra_option != NULL);
+ options[0].optionString = "-Xss2048k";
+ char classpath[4096];
+ snprintf(classpath, sizeof classpath,
+ "-Djava.class.path=%s", getenv("CLASSPATH"));
+ options[1].optionString = classpath;
+ options[2].optionString = "-XX:+UnlockExperimentalVMOptions";
+ if (extra_option) {
+ options[3].optionString = extra_option;
+ }
+ args.options = &options[0];
+ args.ignoreUnrecognized = 0;
+ int rv;
+ rv = JNI_CreateJavaVM(jvm, (void**)&env, &args);
+ if (rv < 0) return NULL;
+ return env;
+}
+
+void run(char *extra_arg) {
+ JavaVM *jvm;
+ jclass T_class;
+ jmethodID test_method;
+ JNIEnv *env = create_vm(&jvm, extra_arg);
+ if (env == NULL)
+ exit(1);
+ T_class = (*env)->FindClass(env, "T");
+ if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
+ (*env)->ExceptionDescribe(env);
+ exit(1);
+ }
+ test_method = (*env)->GetStaticMethodID(env, T_class, "test", "(I)V");
+ if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
+ (*env)->ExceptionDescribe(env);
+ exit(1);
+ }
+ (*env)->CallStaticVoidMethod(env, T_class, test_method, 1000);
+}
+
+
+int main(int argc, char **argv)
+{
+ if (argc > 1) {
+ run(argv[1]);
+ } else {
+ run(NULL);
+ }
+
+ return 0;
+}
diff --git openjdk.orig/hotspot/test/runtime/StackGap/testme.sh openjdk/hotspot/test/runtime/StackGap/testme.sh
new file mode 100644
--- /dev/null
+++ openjdk/hotspot/test/runtime/StackGap/testme.sh
@@ -0,0 +1,73 @@
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#!/bin/sh
+
+#
+# @test testme.sh
+# @bug 8197429
+# @summary Linux kernel stack guard should not cause segfaults on x86-32
+# @compile T.java
+# @run shell testme.sh
+#
+
+if [ "${TESTSRC}" = "" ]
+then
+ TESTSRC=${PWD}
+ echo "TESTSRC not set. Using "${TESTSRC}" as default"
+fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
+
+if [ "${VM_OS}" != "linux" ]
+then
+ echo "Test only valid for Linux"
+ exit 0
+fi
+
+gcc_cmd=`which gcc`
+if [ "x$gcc_cmd" = "x" ]; then
+ echo "WARNING: gcc not found. Cannot execute test." 2>&1
+ exit 0;
+fi
+
+CFLAGS="-m${VM_BITS}"
+
+LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+
+cp ${TESTSRC}${FS}exestack-gap.c .
+
+# Copy the result of our @compile action:
+cp ${TESTCLASSES}${FS}T.class .
+
+echo "Compilation flag: ${COMP_FLAG}"
+# Note pthread may not be found thus invoke creation will fail to be created.
+# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
+# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
+
+$gcc_cmd -DLINUX ${CFLAGS} -o stack-gap \
+ -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
+ -L${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
+ -ljvm -lpthread exestack-gap.c
+
+./stack-gap || exit $?
+./stack-gap -XX:+DisablePrimordialThreadGuardPages || exit $?

View File

@ -1,5 +1,5 @@
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -2659,7 +2659,7 @@ @@ -2659,7 +2659,7 @@
if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
@ -10,8 +10,8 @@ diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeL
} }
assert(n_blks > 0, "Error"); assert(n_blks > 0, "Error");
_cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl); _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl);
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -957,7 +957,7 @@ @@ -957,7 +957,7 @@
if (free_percentage < desired_free_percentage) { if (free_percentage < desired_free_percentage) {
@ -40,10 +40,10 @@ diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSw
// Do not give up existing stack until we have managed to // Do not give up existing stack until we have managed to
// get the double capacity that we desired. // get the double capacity that we desired.
ReservedSpace rs(ReservedSpace::allocation_align_size_up( ReservedSpace rs(ReservedSpace::allocation_align_size_up(
diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -3903,7 +3903,7 @@ @@ -3902,7 +3902,7 @@
// of things to do) or totally (at the very end). // of things to do) or totally (at the very end).
size_t target_size; size_t target_size;
if (partially) { if (partially) {
@ -52,7 +52,7 @@ diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm
} else { } else {
target_size = 0; target_size = 0;
} }
@@ -4707,7 +4707,7 @@ @@ -4706,7 +4706,7 @@
// The > 0 check is to deal with the prev and next live bytes which // The > 0 check is to deal with the prev and next live bytes which
// could be 0. // could be 0.
if (*hum_bytes > 0) { if (*hum_bytes > 0) {
@ -61,10 +61,10 @@ diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm
*hum_bytes -= bytes; *hum_bytes -= bytes;
} }
return bytes; return bytes;
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -1726,7 +1726,7 @@ @@ -1729,7 +1729,7 @@
verify_region_sets_optional(); verify_region_sets_optional();
@ -73,8 +73,8 @@ diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/v
ergo_verbose1(ErgoHeapSizing, ergo_verbose1(ErgoHeapSizing,
"attempt heap expansion", "attempt heap expansion",
ergo_format_reason("allocation request failed") ergo_format_reason("allocation request failed")
diff --git a/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp b/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
@@ -117,7 +117,7 @@ @@ -117,7 +117,7 @@
return reserved_size() - committed_size(); return reserved_size() - committed_size();
@ -85,8 +85,8 @@ diff --git a/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp b/src
return (addr - _low_boundary) / _page_size; return (addr - _low_boundary) / _page_size;
} }
diff --git a/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp b/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
_cancel(false), _cancel(false),
@ -97,8 +97,8 @@ diff --git a/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp b/src/shar
_queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC); _queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC);
for (size_t i = 0; i < _nqueues; i++) { for (size_t i = 0; i < _nqueues; i++) {
new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size); new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size);
diff --git a/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp b/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp
@@ -120,7 +120,7 @@ @@ -120,7 +120,7 @@
}; };
@ -109,8 +109,8 @@ diff --git a/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp b/src/shar
_max_list_length(0), _max_list_length(0),
_cached(PaddedArray<G1StringDedupEntryList, mtGC>::create_unfreeable((uint)_nlists)), _cached(PaddedArray<G1StringDedupEntryList, mtGC>::create_unfreeable((uint)_nlists)),
_overflowed(PaddedArray<G1StringDedupEntryList, mtGC>::create_unfreeable((uint)_nlists)) { _overflowed(PaddedArray<G1StringDedupEntryList, mtGC>::create_unfreeable((uint)_nlists)) {
diff --git a/src/share/vm/gc_implementation/g1/heapRegion.cpp b/src/share/vm/gc_implementation/g1/heapRegion.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -109,7 +109,7 @@ @@ -109,7 +109,7 @@
if (FLAG_IS_DEFAULT(G1HeapRegionSize)) { if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
@ -121,8 +121,8 @@ diff --git a/src/share/vm/gc_implementation/g1/heapRegion.cpp b/src/share/vm/gc_
} }
int region_size_log = log2_long((jlong) region_size); int region_size_log = log2_long((jlong) region_size);
diff --git a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
const size_t num_overflow_elems = of_stack->size(); const size_t num_overflow_elems = of_stack->size();
@ -133,8 +133,8 @@ diff --git a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/src/sh
num_overflow_elems); num_overflow_elems);
// Transfer the most recent num_take_elems from the overflow // Transfer the most recent num_take_elems from the overflow
// stack to our work queue. // stack to our work queue.
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
--- openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp --- openjdk.orig/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
@@ -910,8 +910,8 @@ @@ -910,8 +910,8 @@
void PSParallelCompact::initialize_dead_wood_limiter() void PSParallelCompact::initialize_dead_wood_limiter()
@ -147,8 +147,8 @@ diff --git a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.c
_dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev); _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
DEBUG_ONLY(_dwl_initialized = true;) DEBUG_ONLY(_dwl_initialized = true;)
_dwl_adjustment = normal_distribution(1.0); _dwl_adjustment = normal_distribution(1.0);
diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp diff --git openjdk.orig/hotspot/src/share/vm/memory/collectorPolicy.cpp openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
--- openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp --- openjdk.orig/hotspot/src/share/vm/memory/collectorPolicy.cpp
+++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
@@ -385,7 +385,7 @@ @@ -385,7 +385,7 @@
uintx calculated_size = NewSize + OldSize; uintx calculated_size = NewSize + OldSize;
@ -207,10 +207,10 @@ diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/colle
_initial_gen1_size = OldSize; _initial_gen1_size = OldSize;
// If the user has explicitly set an OldSize that is inconsistent // If the user has explicitly set an OldSize that is inconsistent
diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.cpp diff --git openjdk.orig/hotspot/src/share/vm/memory/metaspace.cpp openjdk/hotspot/src/share/vm/memory/metaspace.cpp
--- openjdk/hotspot/src/share/vm/memory/metaspace.cpp --- openjdk.orig/hotspot/src/share/vm/memory/metaspace.cpp
+++ openjdk/hotspot/src/share/vm/memory/metaspace.cpp +++ openjdk/hotspot/src/share/vm/memory/metaspace.cpp
@@ -1455,7 +1455,7 @@ @@ -1482,7 +1482,7 @@
void MetaspaceGC::post_initialize() { void MetaspaceGC::post_initialize() {
// Reset the high-water mark once the VM initialization is done. // Reset the high-water mark once the VM initialization is done.
@ -219,8 +219,8 @@ diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.c
} }
bool MetaspaceGC::can_expand(size_t word_size, bool is_class) { bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
@@ -1515,7 +1515,7 @@ @@ -1542,7 +1542,7 @@
(size_t)MIN2(min_tmp, double(max_uintx)); (size_t)MIN2(min_tmp, double(MaxMetaspaceSize));
// Don't shrink less than the initial generation size // Don't shrink less than the initial generation size
minimum_desired_capacity = MAX2(minimum_desired_capacity, minimum_desired_capacity = MAX2(minimum_desired_capacity,
- MetaspaceSize); - MetaspaceSize);
@ -228,16 +228,16 @@ diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.c
if (PrintGCDetails && Verbose) { if (PrintGCDetails && Verbose) {
gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: "); gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: ");
@@ -1573,7 +1573,7 @@ @@ -1600,7 +1600,7 @@
const double max_tmp = used_after_gc / minimum_used_percentage; const double max_tmp = used_after_gc / minimum_used_percentage;
size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(MaxMetaspaceSize));
maximum_desired_capacity = MAX2(maximum_desired_capacity, maximum_desired_capacity = MAX2(maximum_desired_capacity,
- MetaspaceSize); - MetaspaceSize);
+ (size_t)MetaspaceSize); + (size_t)MetaspaceSize);
if (PrintGCDetails && Verbose) { if (PrintGCDetails && Verbose) {
gclog_or_tty->print_cr(" " gclog_or_tty->print_cr(" "
" maximum_free_percentage: %6.2f" " maximum_free_percentage: %6.2f"
@@ -3285,7 +3285,7 @@ @@ -3361,7 +3361,7 @@
// on the medium chunk list. The next chunk will be small and progress // on the medium chunk list. The next chunk will be small and progress
// from there. This size calculated by -version. // from there. This size calculated by -version.
_first_class_chunk_word_size = MIN2((size_t)MediumChunk*6, _first_class_chunk_word_size = MIN2((size_t)MediumChunk*6,
@ -246,10 +246,10 @@ diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.c
_first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size); _first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size);
// Arbitrarily set the initial virtual space to a multiple // Arbitrarily set the initial virtual space to a multiple
// of the boot class loader size. // of the boot class loader size.
diff --git a/src/share/vm/memory/threadLocalAllocBuffer.cpp b/src/share/vm/memory/threadLocalAllocBuffer.cpp diff --git openjdk.orig/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
--- openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp --- openjdk.orig/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
+++ openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp +++ openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
@@ -238,13 +238,13 @@ @@ -250,13 +250,13 @@
size_t init_sz = 0; size_t init_sz = 0;
if (TLABSize > 0) { if (TLABSize > 0) {
@ -266,8 +266,8 @@ diff --git a/src/share/vm/memory/threadLocalAllocBuffer.cpp b/src/share/vm/memor
init_sz = align_object_size(init_sz); init_sz = align_object_size(init_sz);
} }
init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
diff --git a/src/share/vm/oops/objArrayKlass.inline.hpp b/src/share/vm/oops/objArrayKlass.inline.hpp diff --git openjdk.orig/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
--- openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp --- openjdk.orig/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
+++ openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp +++ openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
const size_t beg_index = size_t(index); const size_t beg_index = size_t(index);
@ -287,10 +287,10 @@ diff --git a/src/share/vm/oops/objArrayKlass.inline.hpp b/src/share/vm/oops/objA
const size_t end_index = beg_index + stride; const size_t end_index = beg_index + stride;
T* const base = (T*)a->base(); T* const base = (T*)a->base();
T* const beg = base + beg_index; T* const beg = base + beg_index;
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp
--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp --- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp
+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp +++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
@@ -1283,7 +1283,7 @@ @@ -1289,7 +1289,7 @@
// NewSize was set on the command line and it is larger than // NewSize was set on the command line and it is larger than
// preferred_max_new_size. // preferred_max_new_size.
if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line
@ -299,7 +299,7 @@ diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments
} else { } else {
FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size); FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
} }
@@ -1308,8 +1308,8 @@ @@ -1314,8 +1314,8 @@
// Unless explicitly requested otherwise, make young gen // Unless explicitly requested otherwise, make young gen
// at least min_new, and at most preferred_max_new_size. // at least min_new, and at most preferred_max_new_size.
if (FLAG_IS_DEFAULT(NewSize)) { if (FLAG_IS_DEFAULT(NewSize)) {
@ -310,7 +310,7 @@ diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments
if (PrintGCDetails && Verbose) { if (PrintGCDetails && Verbose) {
// Too early to use gclog_or_tty // Too early to use gclog_or_tty
tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
@@ -1319,7 +1319,7 @@ @@ -1325,7 +1325,7 @@
// so it's NewRatio x of NewSize. // so it's NewRatio x of NewSize.
if (FLAG_IS_DEFAULT(OldSize)) { if (FLAG_IS_DEFAULT(OldSize)) {
if (max_heap > NewSize) { if (max_heap > NewSize) {

View File

@ -1,23 +0,0 @@
diff --git openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot/make/linux/makefiles/saproc.make
--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make
+++ openjdk/hotspot/make/linux/makefiles/saproc.make
@@ -59,6 +59,11 @@
SA_DEBUG_CFLAGS = -g
endif
+# Optimize saproc lib at level -O3 unless it's a slowdebug build
+ifneq ($(DEBUG_LEVEL), slowdebug)
+ SA_OPT_FLAGS = $(OPT_CFLAGS)
+endif
+
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
@@ -95,6 +100,7 @@
$(SASRCFILES) \
$(SA_LFLAGS) \
$(SA_DEBUG_CFLAGS) \
+ $(SA_OPT_FLAGS) \
$(EXTRA_CFLAGS) \
-o $@ \
-lthread_db -ldl

37
s390-8214206_fix.patch Normal file
View File

@ -0,0 +1,37 @@
diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
--- openjdk.orig/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
@@ -78,7 +78,8 @@
size_t num_target_elems = pointer_delta(end, bottom, mapping_granularity_in_bytes);
idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
- initialize_base(base, num_target_elems, bias, target_elem_size_in_bytes, log2_intptr(mapping_granularity_in_bytes));
+ initialize_base(base, num_target_elems, bias, target_elem_size_in_bytes,
+ log2_intptr((uintptr_t) mapping_granularity_in_bytes));
}
size_t bias() const { return _bias; }
diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.cpp openjdk/hotspot/src/share/vm/runtime/os.cpp
--- openjdk.orig/hotspot/src/share/vm/runtime/os.cpp
+++ openjdk/hotspot/src/share/vm/runtime/os.cpp
@@ -1284,7 +1284,7 @@
}
void os::set_memory_serialize_page(address page) {
- int count = log2_intptr(sizeof(class JavaThread)) - log2_int(64);
+ int count = log2_intptr((uintptr_t) sizeof(class JavaThread)) - log2_int(64);
_mem_serialize_page = (volatile int32_t *)page;
// We initialize the serialization page shift count here
// We assume a cache line size of 64 bytes
diff --git openjdk.orig/hotspot/src/share/vm/utilities/numberSeq.cpp openjdk/hotspot/src/share/vm/utilities/numberSeq.cpp
--- openjdk.orig/hotspot/src/share/vm/utilities/numberSeq.cpp
+++ openjdk/hotspot/src/share/vm/utilities/numberSeq.cpp
@@ -369,7 +369,7 @@
void BinaryMagnitudeSeq::add(size_t val) {
Atomic::add(val, &_sum);
- int mag = log2_intptr(val) + 1;
+ int mag = log2_intptr((uintptr_t) val) + 1;
// Defensively saturate for product bits:
if (mag < 0) {

View File

@ -1,2 +1,2 @@
SHA512 (tapsets-icedtea-3.11.0.tar.xz) = f98420b2f9d7a0fc0af3a7e6a817c4330169db9378d9c38db56b0dd8281a3f1ff7747b4da0c66194695ca85a470b7963902d863d301e5e290dbfe11f6b6f2b5e SHA512 (tapsets-icedtea-3.11.0.tar.xz) = f98420b2f9d7a0fc0af3a7e6a817c4330169db9378d9c38db56b0dd8281a3f1ff7747b4da0c66194695ca85a470b7963902d863d301e5e290dbfe11f6b6f2b5e
SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u202-b08.tar.xz) = 5c2fde5b6595a8daeb2216c0eed0a9a5b311d651745fa5d299d8d6da674c27133ce23726e3f8ec32314c929d5a814d8167d9a33877fbf5237a2595b3f488585e SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u212-b02.tar.xz) = 0068461fe6d2a376c44009a6f111b7aac8a0bdd99976f454d3015d443de8f87e1928ddad8d6dcc7572bc53ad6e3d6b71bcee045858d8e2e51cb6d2ac8864cc47