changeset 2769:0c708efe5036 icedtea-3.5.0pre01

Bump to icedtea-3.5.0pre01. Upstream changes: - PR3384: aarch32: aarch32 should default to client variant as server fails to build - PR3392, RH1273760: Support using RSAandMGF1 with the SHA hash algorithms in the PKCS11 provider - S8139303, PR3384: aarch32: add support for ARM aarch32 - S8164293, PR3412, RH1459641: HotSpot leaking memory in long-running requests - S8164652, PR3386: aarch32: C1 port - S8167584, PR3384: aarch32: use "arm" for os.arch system property - S8175813, PR3394, RH1448880: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used - S8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect - S8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set - S8180048, PR3411, RH1449870: Interned string and symbol table leak memory during parallel unlinking - S8181055, PR3394, RH1448880: PPC64: "mbind: Invalid argument" still seen after 8175813 - S8181419, PR3413, RH1463144: Race in jdwp invoker handling may lead to crashes or invalid results ChangeLog: 2017-07-06 Andrew John Hughes <gnu.andrew@member.fsf.org> Bump to icedtea-3.5.0pre01. * patches/aarch32-c1.patch, * patches/aarch32-conf.patch, * patches/aarch32-jdk.patch: Removed as applied upstream. * Makefile.am: (CORBA_CHANGESET): Update to icedtea-3.5.0pre01 tag. (JAXP_CHANGESET): Likewise. (JAXWS_CHANGESET): Likewise. (JDK_CHANGESET): Likewise. (LANGTOOLS_CHANGESET): Likewise. (OPENJDK_CHANGESET): Likewise. (NASHORN_CHANGESET): Likewise. (CORBA_SHA256SUM): Likewise. (JAXP_SHA256SUM): Likewise. (JAXWS_SHA256SUM): Likewise. (JDK_SHA256SUM): Likewise. (LANGTOOLS_SHA256SUM): Likewise. (OPENJDK_SHA256SUM): Likewise. (NASHORN_SHA256SUM): Likewise. (ICEDTEA_PATCHES): Add HotSpot patches for Shenandoah and AArch32 ports. Remove AArch32 fixes now applied upstream. * NEWS: Updated. * configure.ac: Bump to 3.5.0pre01. * hotspot.map.in: Update to icedtea-3.5.0pre01 tag. * patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch, * patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch, * patches/hotspot/aarch32/8175887-pr3415.patch, * patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch, * patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch: Symlink to Shenandoah versions of same patches. * patches/hotspot/aarch32/8181055-pr3394-rh1448880.patch: AArch32 version of 8181055 as there are uclibc changes in os_linux.cpp * patches/hotspot/shenandoah/8164293-pr3412-rh1459641.patch, * patches/hotspot/shenandoah/8175813-pr3394-rh1448880.patch, * patches/hotspot/shenandoah/8175887-pr3415.patch, * patches/hotspot/shenandoah/8179084-pr3409-rh1455694.patch, * patches/hotspot/shenandoah/8180048-pr3411-rh1449870.patch, * patches/hotspot/shenandoah/8181055-pr3394-rh1448880.patch: Copies of upstream HotSpot patches for Shenandoah. Patches are identical to those upstream.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Fri, 07 Jul 2017 04:11:20 +0100
parents 15e389d375ed
children fbb965a9fa34
files ChangeLog Makefile.am NEWS configure.ac hotspot.map.in patches/aarch32-c1.patch patches/aarch32-conf.patch patches/aarch32-jdk.patch patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch patches/hotspot/aarch32/8175887-pr3415.patch patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch patches/hotspot/aarch32/8181055-pr3394-rh1448880.patch patches/hotspot/shenandoah/8164293-pr3412-rh1459641.patch patches/hotspot/shenandoah/8175813-pr3394-rh1448880.patch patches/hotspot/shenandoah/8175887-pr3415.patch patches/hotspot/shenandoah/8179084-pr3409-rh1455694.patch patches/hotspot/shenandoah/8180048-pr3411-rh1449870.patch patches/hotspot/shenandoah/8181055-pr3394-rh1448880.patch
diffstat 20 files changed, 1209 insertions(+), 261 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 17 04:12:59 2017 +0100
+++ b/ChangeLog	Fri Jul 07 04:11:20 2017 +0100
@@ -1,3 +1,49 @@
+2017-07-06  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	Bump to icedtea-3.5.0pre01.
+	* patches/aarch32-c1.patch,
+	* patches/aarch32-conf.patch,
+	* patches/aarch32-jdk.patch:
+	Removed as applied upstream.
+	* Makefile.am:
+	(CORBA_CHANGESET): Update to icedtea-3.5.0pre01 tag.
+	(JAXP_CHANGESET): Likewise.
+	(JAXWS_CHANGESET): Likewise.
+	(JDK_CHANGESET): Likewise.
+	(LANGTOOLS_CHANGESET): Likewise.
+	(OPENJDK_CHANGESET): Likewise.
+	(NASHORN_CHANGESET): Likewise.
+	(CORBA_SHA256SUM): Likewise.
+	(JAXP_SHA256SUM): Likewise.
+	(JAXWS_SHA256SUM): Likewise.
+	(JDK_SHA256SUM): Likewise.
+	(LANGTOOLS_SHA256SUM): Likewise.
+	(OPENJDK_SHA256SUM): Likewise.
+	(NASHORN_SHA256SUM): Likewise.
+	(ICEDTEA_PATCHES): Add HotSpot patches for Shenandoah
+	and AArch32 ports. Remove AArch32 fixes now applied
+	upstream.
+	* NEWS: Updated.
+	* configure.ac: Bump to 3.5.0pre01.
+	* hotspot.map.in: Update to icedtea-3.5.0pre01 tag.
+	* patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch,
+	* patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch,
+	* patches/hotspot/aarch32/8175887-pr3415.patch,
+	* patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch,
+	* patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch:
+	Symlink to Shenandoah versions of same patches.
+	* patches/hotspot/aarch32/8181055-pr3394-rh1448880.patch:
+	AArch32 version of 8181055 as there are uclibc changes
+	in os_linux.cpp
+	* patches/hotspot/shenandoah/8164293-pr3412-rh1459641.patch,
+	* patches/hotspot/shenandoah/8175813-pr3394-rh1448880.patch,
+	* patches/hotspot/shenandoah/8175887-pr3415.patch,
+	* patches/hotspot/shenandoah/8179084-pr3409-rh1455694.patch,
+	* patches/hotspot/shenandoah/8180048-pr3411-rh1449870.patch,
+	* patches/hotspot/shenandoah/8181055-pr3394-rh1448880.patch:
+	Copies of upstream HotSpot patches for Shenandoah. Patches
+	are identical to those upstream.
+
 2017-05-16  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	* NEWS: Set release date to today.
--- a/Makefile.am	Wed May 17 04:12:59 2017 +0100
+++ b/Makefile.am	Fri Jul 07 04:11:20 2017 +0100
@@ -4,21 +4,21 @@
 BUILD_VERSION = b11
 COMBINED_VERSION = $(JDK_UPDATE_VERSION)-$(BUILD_VERSION)
 
-CORBA_CHANGESET = 22ed32f45405
-JAXP_CHANGESET = fdc2a6442d2f
-JAXWS_CHANGESET = c1bfc2395c57
-JDK_CHANGESET = cfc292a2c1c6
-LANGTOOLS_CHANGESET = 4ef0ee927940
-OPENJDK_CHANGESET = ed5ee0ac7111
-NASHORN_CHANGESET = f2d9bca28d0e
-
-CORBA_SHA256SUM = 47210b6c69dcc6193b9bf0a3d61b75b48f4fa56e8ca348e40200cfa14eca3fd1
-JAXP_SHA256SUM = c74a8a27f1d2dfeaabfce3b5b46623e367fb0fbd5938a3aca8fcd23eb2ce1d53
-JAXWS_SHA256SUM = 90642e9131f4c8922576305224278fcae72d8363956b76d4cdbf813027836cac
-JDK_SHA256SUM = ec71e37b98b4baa6831c5cb30bcc1ab18cd95993744dbc4d37a28b2dc5049896
-LANGTOOLS_SHA256SUM = 489799c6a86fbfb7da2f2c0ec48e44970a152ea38b97bb40cc04bc09155ab39f
-OPENJDK_SHA256SUM = f1eb8c8e45965adcaa1e9cc70df043a825d52409e96712d266167994ff88456d
-NASHORN_SHA256SUM = 3f3861e7268a3986fa8d5c940b85a0de1003f7ebb212df157a9b421ac621d6ae
+CORBA_CHANGESET = 324f4699760f
+JAXP_CHANGESET = 6979c581131c
+JAXWS_CHANGESET = 18b3704bc51d
+JDK_CHANGESET = c8bcda75cb18
+LANGTOOLS_CHANGESET = 40fe2817d648
+OPENJDK_CHANGESET = 3e39851fea09
+NASHORN_CHANGESET = ad209492df16
+
+CORBA_SHA256SUM = 87065dd6926ed5b898fd858b75f3ee9a986c039cad579081c60bfa4b340ea521
+JAXP_SHA256SUM = 98213380e4c4aea103987272b97b987d79f98a4f99ca4894663df51a9df89fd0
+JAXWS_SHA256SUM = 7770dc6b44dc87793e29544ac284a887ca954ca1d395e6f128cb0900ad587978
+JDK_SHA256SUM = 54e15fc88806667b674cabc31cdabf8aa488fd2d3507f0564b83c074e06d125d
+LANGTOOLS_SHA256SUM = 194b342b0a05a849f50d04e4643ecd475e8296671aa659dab12b6db8ac79970b
+OPENJDK_SHA256SUM = f8d0239bb78623de817067eb018a3cf418cd7fff6ccc063c1d25202e1bc77a3a
+NASHORN_SHA256SUM = 4c8f0b6d3f3fe710b3c59bd0667ee236edf000a40e385681d3d4bfaa226c28c1
 
 HS_TYPE = "`$(AWK) 'version==$$1 {print $$2}' version=$(HSBUILD) $(abs_top_builddir)/hotspot.map`"
 HS_URL = "`$(AWK) 'version==$$1 {print $$3}' version=$(HSBUILD) $(abs_top_builddir)/hotspot.map`"
@@ -366,7 +366,13 @@
 	patches/hotspot/$(HSBUILD)/8043780-pr3368.patch \
 	patches/hotspot/$(HSBUILD)/8173941-pr3326.patch \
 	patches/hotspot/$(HSBUILD)/8174164-pr3334-rh1417266.patch \
-	patches/hotspot/$(HSBUILD)/8175097-pr3334-rh1417266.patch
+	patches/hotspot/$(HSBUILD)/8175097-pr3334-rh1417266.patch \
+	patches/hotspot/$(HSBUILD)/8164293-pr3412-rh1459641.patch \
+	patches/hotspot/$(HSBUILD)/8175813-pr3394-rh1448880.patch \
+	patches/hotspot/$(HSBUILD)/8175887-pr3415.patch \
+	patches/hotspot/$(HSBUILD)/8179084-pr3409-rh1455694.patch \
+	patches/hotspot/$(HSBUILD)/8180048-pr3411-rh1449870.patch \
+	patches/hotspot/$(HSBUILD)/8181055-pr3394-rh1448880.patch
 
 # AArch32 already has 6515172 from upstream 8u131
 if !WITH_AARCH32_HSBUILD
@@ -376,13 +382,6 @@
 
 endif
 
-if WITH_AARCH32_HSBUILD
-ICEDTEA_PATCHES += \
-	patches/aarch32-conf.patch \
-	patches/aarch32-jdk.patch \
-	patches/aarch32-c1.patch
-endif
-
 if BUILD_CACAO
 ICEDTEA_PATCHES += \
 	patches/cacao/launcher.patch
--- a/NEWS	Wed May 17 04:12:59 2017 +0100
+++ b/NEWS	Fri Jul 07 04:11:20 2017 +0100
@@ -10,6 +10,19 @@
 
 CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
 
+New in release 3.5.0 (2017-07-XX):
+
+* New features
+  - PR3392, RH1273760: Support using RSAandMGF1 with the SHA hash algorithms in the PKCS11 provider
+* Backports
+  - S8164293, PR3412, RH1459641: HotSpot leaking memory in long-running requests
+  - S8175813, PR3394, RH1448880: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used
+  - S8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect
+  - S8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set
+  - S8180048, PR3411, RH1449870: Interned string and symbol table leak memory during parallel unlinking
+  - S8181055, PR3394, RH1448880: PPC64: "mbind: Invalid argument" still seen after 8175813
+  - S8181419, PR3413, RH1463144: Race in jdwp invoker handling may lead to crashes or invalid results
+
 New in release 3.4.0 (2017-05-16):
 
 * Security fixes
--- a/configure.ac	Wed May 17 04:12:59 2017 +0100
+++ b/configure.ac	Fri Jul 07 04:11:20 2017 +0100
@@ -1,4 +1,4 @@
-AC_INIT([icedtea], [3.4.0], [distro-pkg-dev@openjdk.java.net])
+AC_INIT([icedtea], [3.5.0pre01], [distro-pkg-dev@openjdk.java.net])
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([1.9 tar-pax foreign])
--- a/hotspot.map.in	Wed May 17 04:12:59 2017 +0100
+++ b/hotspot.map.in	Fri Jul 07 04:11:20 2017 +0100
@@ -1,4 +1,4 @@
 # version type(drop/hg) url changeset sha256sum
-default drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 00b7bbd261c9 973d668f312b869184665def8abe4037dcd78562bf0dda40367102aca647fd76
+default drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 654b7fcb4932 e85d74ee0015747e6071a8305877ce65c68bf4d0c56e2194c9c6575a554b230a
 shenandoah drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ 6ffe8637a506 61f7cc5896791ae564aa365cb3de80b16426b42f07e5734ebd30c4483fa2fd3a
 aarch32 drop http://icedtea.classpath.org/download/drops/icedtea8/@ICEDTEA_RELEASE@ b93c39bf2bcf 38e24d556aa269a5168e251b1fa97e84467a722fff27fa2f81de315854f18a33
--- a/patches/aarch32-c1.patch	Wed May 17 04:12:59 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-# HG changeset patch
-# User enevill
-# Date 1473018966 -3600
-#      Sun Sep 04 20:56:06 2016 +0100
-# Node ID c5fd893fea79c7a797757e019f6c4eb15a6c731f
-# Parent  9987239a4a4bd801445d74879cc90454454cb713
-8164652: aarch32: C1 port
-Reviewed-by: enevill
-Contributed-by: Andrey Petushkov <andrey.petushkov@gmail.com>
-
-diff --git a/make/CopyFiles.gmk b/make/CopyFiles.gmk
---- openjdk/jdk/make/CopyFiles.gmk
-+++ openjdk/jdk/make/CopyFiles.gmk
-@@ -312,7 +312,9 @@
-       COPY_JVM_CFG_FILE := true
-     else
-       ifeq ($(OPENJDK_TARGET_CPU), aarch32)
--        COPY_JVM_CFG_FILE := true
-+        ifeq ($(JVM_VARIANT_CORE), true)
-+          COPY_JVM_CFG_FILE := true
-+        endif
-       endif
-     endif
-   endif
--- a/patches/aarch32-conf.patch	Wed May 17 04:12:59 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
---- openjdk///common/autoconf/generated-configure.sh
-+++ openjdk///common/autoconf/generated-configure.sh
-@@ -3999,7 +3999,7 @@
- #CUSTOM_AUTOCONF_INCLUDE
- 
- # Do not change or remove the following line, it is needed for consistency checks:
--DATE_WHEN_GENERATED=1485433878
-+DATE_WHEN_GENERATED=1494557051
- 
- ###############################################################################
- #
-@@ -6943,9 +6943,9 @@
-       VAR_CPU_BITS=32
-       VAR_CPU_ENDIAN=little
-       ;;
--    arm*)
--      VAR_CPU=arm
--      VAR_CPU_ARCH=arm
-+    arm*|aarch32)
-+      VAR_CPU=aarch32
-+      VAR_CPU_ARCH=aarch32
-       VAR_CPU_BITS=32
-       VAR_CPU_ENDIAN=little
-       ;;
-@@ -7088,9 +7088,9 @@
-       VAR_CPU_BITS=32
-       VAR_CPU_ENDIAN=little
-       ;;
--    arm*)
--      VAR_CPU=arm
--      VAR_CPU_ARCH=arm
-+    arm*|aarch32)
-+      VAR_CPU=aarch32
-+      VAR_CPU_ARCH=aarch32
-       VAR_CPU_BITS=32
-       VAR_CPU_ENDIAN=little
-       ;;
-@@ -7304,6 +7304,8 @@
-   elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
-     # On all platforms except macosx, we replace x86_64 with amd64.
-     OPENJDK_TARGET_CPU_OSARCH="amd64"
-+  elif test "x$OPENJDK_TARGET_CPU" = xaarch32; then
-+    OPENJDK_TARGET_CPU_OSARCH="arm"
-   fi
- 
- 
-@@ -8058,7 +8060,11 @@
- 
- 
-   if test "x$with_jvm_variants" = x; then
--    with_jvm_variants="server"
-+    if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
-+      with_jvm_variants="client";
-+    else
-+      with_jvm_variants="server";
-+    fi
-   fi
- 
-   JVM_VARIANTS=",$with_jvm_variants,"
-@@ -8122,6 +8128,9 @@
-   if test "x$VAR_CPU" = xppc64 -o "x$VAR_CPU" = xppc64le ; then
-     INCLUDE_SA=false
-   fi
-+  if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
-+    INCLUDE_SA=false
-+  fi
-   if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
-     INCLUDE_SA=false
-   fi
-diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
---- openjdk///common/autoconf/jdk-options.m4
-+++ openjdk///common/autoconf/jdk-options.m4
-@@ -98,7 +98,11 @@
- 	[JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
- 
-   if test "x$with_jvm_variants" = x; then
--    with_jvm_variants="server"
-+    if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
-+      with_jvm_variants="client";
-+    else
-+      with_jvm_variants="server";
-+    fi
-   fi
- 
-   JVM_VARIANTS=",$with_jvm_variants,"
-@@ -161,6 +165,9 @@
-   if test "x$VAR_CPU" = xppc64 -o "x$VAR_CPU" = xppc64le ; then
-     INCLUDE_SA=false
-   fi
-+  if test "x$OPENJDK_TARGET_CPU" = xaarch32; then
-+    INCLUDE_SA=false
-+  fi
-   if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
-     INCLUDE_SA=false
-   fi
-diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
---- openjdk///common/autoconf/platform.m4
-+++ openjdk///common/autoconf/platform.m4
-@@ -42,9 +42,9 @@
-       VAR_CPU_BITS=32
-       VAR_CPU_ENDIAN=little
-       ;;
--    arm*)
--      VAR_CPU=arm
--      VAR_CPU_ARCH=arm
-+    arm*|aarch32)
-+      VAR_CPU=aarch32
-+      VAR_CPU_ARCH=aarch32
-       VAR_CPU_BITS=32
-       VAR_CPU_ENDIAN=little
-       ;;
-@@ -322,6 +322,8 @@
-   elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
-     # On all platforms except macosx, we replace x86_64 with amd64.
-     OPENJDK_TARGET_CPU_OSARCH="amd64"
-+  elif test "x$OPENJDK_TARGET_CPU" = xaarch32; then
-+    OPENJDK_TARGET_CPU_OSARCH="arm"
-   fi
-   AC_SUBST(OPENJDK_TARGET_CPU_OSARCH)
- 
--- a/patches/aarch32-jdk.patch	Wed May 17 04:12:59 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-diff --git a/make/CopyFiles.gmk b/make/CopyFiles.gmk
---- openjdk/jdk/make/CopyFiles.gmk
-+++ openjdk/jdk/make/CopyFiles.gmk
-@@ -307,9 +307,13 @@
-   ifeq ($(CLIENT_AND_SERVER), true)
-     COPY_JVM_CFG_FILE := true
-   else
--    # For zero, the default jvm.cfg file is sufficient
-+    # For zero, the default jvm.cfg file is sufficient.
-     ifeq ($(JVM_VARIANT_ZERO), true)
-       COPY_JVM_CFG_FILE := true
-+    else
-+      ifeq ($(OPENJDK_TARGET_CPU), aarch32)
-+        COPY_JVM_CFG_FILE := true
-+      endif
-     endif
-   endif
- endif
-diff --git a/make/lib/SoundLibraries.gmk b/make/lib/SoundLibraries.gmk
---- openjdk/jdk/make/lib/SoundLibraries.gmk
-+++ openjdk/jdk/make/lib/SoundLibraries.gmk
-@@ -137,7 +137,7 @@
-   endif
- 
-   ifeq ($(OPENJDK_TARGET_CPU), ppc64)
--       LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64
-+    LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64
-   endif
- 
-   ifeq ($(OPENJDK_TARGET_CPU), alpha)
-@@ -179,6 +179,10 @@
-   ifeq ($(OPENJDK_TARGET_CPU), aarch64)
-        LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64
-   endif
-+
-+  ifeq ($(OPENJDK_TARGET_CPU), aarch32)
-+    LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH32
-+  endif
- endif
- 
- LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
-diff --git a/src/share/native/com/sun/media/sound/SoundDefs.h b/src/share/native/com/sun/media/sound/SoundDefs.h
---- openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h
-+++ openjdk/jdk/src/share/native/com/sun/media/sound/SoundDefs.h
-@@ -53,6 +53,7 @@
- #define X_SH            16
- #define X_AARCH64       17
- #define X_PPC64LE       18
-+#define X_AARCH32       19
- 
- // **********************************
- // Make sure you set X_PLATFORM and X_ARCH defines correctly.
-diff --git a/src/solaris/bin/aarch32/jvm.cfg b/src/solaris/bin/aarch32/jvm.cfg
-new file mode 100644
---- /dev/null
-+++ openjdk/jdk/src/solaris/bin/aarch32/jvm.cfg
-@@ -0,0 +1,34 @@
-+# Copyright (c) 2015, 2015, 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.  Oracle designates this
-+# particular file as subject to the "Classpath" exception as provided
-+# by Oracle in the LICENSE file that accompanied this code.
-+#
-+# 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.
-+#
-+# List of JVMs that can be used as an option to java, javac, etc.
-+# Order is important -- first in this list is the default JVM.
-+# NOTE that this both this file and its format are UNSUPPORTED and
-+# WILL GO AWAY in a future release.
-+#
-+# You may also select a JVM in an arbitrary location with the
-+# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
-+# and may not be available in a future release.
-+#
-+-server KNOWN
-+-client IGNORE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8164293-pr3412-rh1459641.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,1 @@
+../shenandoah/8164293-pr3412-rh1459641.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8175813-pr3394-rh1448880.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,1 @@
+../shenandoah/8175813-pr3394-rh1448880.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8175887-pr3415.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,1 @@
+../shenandoah/8175887-pr3415.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8179084-pr3409-rh1455694.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,1 @@
+../shenandoah/8179084-pr3409-rh1455694.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8180048-pr3411-rh1449870.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,1 @@
+../shenandoah/8180048-pr3411-rh1449870.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/aarch32/8181055-pr3394-rh1448880.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,96 @@
+diff -Nru 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	2017-07-07 02:39:53.074767403 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2017-07-07 02:41:44.196961739 +0100
+@@ -2827,11 +2827,8 @@
+ extern "C" JNIEXPORT void numa_error(char *where) { }
+ extern "C" JNIEXPORT int fork1() { return fork(); }
+ 
+-
+-// If we are running with libnuma version > 2, then we should
+-// be trying to use symbols with versions 1.1
+-// If we are running with earlier version, which did not have symbol versions,
+-// we should use the base version.
++// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
++// load symbol from base version instead.
+ void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
+ #ifndef __UCLIBC__
+   void *f = dlvsym(handle, name, "libnuma_1.1");
+@@ -2844,6 +2841,12 @@
+ #endif
+ }
+ 
++// Handle request to load libnuma symbol version 1.2 (API v2) only.
++// Return NULL if the symbol is not defined in this particular version.
++void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
++  return dlvsym(handle, name, "libnuma_1.2");
++}
++
+ bool os::Linux::libnuma_init() {
+   // sched_getcpu() should be in libc.
+   set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
+@@ -2868,6 +2871,8 @@
+                                             libnuma_dlsym(handle, "numa_tonode_memory")));
+       set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t,
+                                                 libnuma_dlsym(handle, "numa_interleave_memory")));
++      set_numa_interleave_memory_v2(CAST_TO_FN_PTR(numa_interleave_memory_v2_func_t,
++                                                libnuma_v2_dlsym(handle, "numa_interleave_memory")));
+       set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t,
+                                               libnuma_dlsym(handle, "numa_set_bind_policy")));
+       set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t,
+@@ -2987,6 +2992,7 @@
+ os::Linux::numa_available_func_t os::Linux::_numa_available;
+ os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory;
+ os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
++os::Linux::numa_interleave_memory_v2_func_t os::Linux::_numa_interleave_memory_v2;
+ os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy;
+ os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset;
+ os::Linux::numa_distance_func_t os::Linux::_numa_distance;
+diff -Nru 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	2017-07-07 02:39:53.074767403 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp	2017-07-07 02:41:03.353625308 +0100
+@@ -192,6 +192,8 @@
+   static void libpthread_init();
+   static bool libnuma_init();
+   static void* libnuma_dlsym(void* handle, const char* name);
++  // libnuma v2 (libnuma_1.2) symbols
++  static void* libnuma_v2_dlsym(void* handle, const char* name);
+   // Minimum stack size a thread can be created with (allowing
+   // the VM to completely create the thread and enter user code)
+   static size_t min_stack_allowed;
+@@ -252,6 +254,8 @@
+   typedef int (*numa_available_func_t)(void);
+   typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node);
+   typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask);
++  typedef void (*numa_interleave_memory_v2_func_t)(void *start, size_t size, struct bitmask* mask);
++
+   typedef void (*numa_set_bind_policy_func_t)(int policy);
+   typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n);
+   typedef int (*numa_distance_func_t)(int node1, int node2);
+@@ -263,6 +267,7 @@
+   static numa_available_func_t _numa_available;
+   static numa_tonode_memory_func_t _numa_tonode_memory;
+   static numa_interleave_memory_func_t _numa_interleave_memory;
++  static numa_interleave_memory_v2_func_t _numa_interleave_memory_v2;
+   static numa_set_bind_policy_func_t _numa_set_bind_policy;
+   static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset;
+   static numa_distance_func_t _numa_distance;
+@@ -277,6 +282,7 @@
+   static void set_numa_available(numa_available_func_t func) { _numa_available = func; }
+   static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; }
+   static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; }
++  static void set_numa_interleave_memory_v2(numa_interleave_memory_v2_func_t func) { _numa_interleave_memory_v2 = func; }
+   static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; }
+   static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; }
+   static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; }
+@@ -298,7 +304,10 @@
+     return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1;
+   }
+   static void numa_interleave_memory(void *start, size_t size) {
+-    if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) {
++    // Use v2 api if available
++    if (_numa_interleave_memory_v2 != NULL && _numa_all_nodes_ptr != NULL) {
++      _numa_interleave_memory_v2(start, size, _numa_all_nodes_ptr);
++    } else if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) {
+       _numa_interleave_memory(start, size, _numa_all_nodes);
+     }
+   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8164293-pr3412-rh1459641.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,48 @@
+# HG changeset patch
+# User jcm
+# Date 1484137609 28800
+#      Wed Jan 11 04:26:49 2017 -0800
+# Node ID 1faf7c17089922f6f72b580253725f2ecb6ba2f8
+# Parent  3d07e14d65bc223dbfe94be9224e4aa8c6e63762
+8164293, PR3412, RH1459641: HotSpot leaking memory in long-running requests
+Summary: Applied RMs in sweep_code_cache and related codes.
+Reviewed-by: kvn, thartmann
+
+diff -r 3d07e14d65bc -r 1faf7c170899 src/share/vm/code/nmethod.cpp
+--- openjdk/hotspot/src/share/vm/code/nmethod.cpp
++++ openjdk/hotspot/src/share/vm/code/nmethod.cpp
+@@ -1172,6 +1172,7 @@
+ // Clear ICStubs of all compiled ICs
+ void nmethod::clear_ic_stubs() {
+   assert_locked_or_safepoint(CompiledIC_lock);
++  ResourceMark rm;
+   RelocIterator iter(this);
+   while(iter.next()) {
+     if (iter.type() == relocInfo::virtual_call_type) {
+diff -r 3d07e14d65bc -r 1faf7c170899 src/share/vm/runtime/sweeper.cpp
+--- openjdk/hotspot/src/share/vm/runtime/sweeper.cpp
++++ openjdk/hotspot/src/share/vm/runtime/sweeper.cpp
+@@ -319,6 +319,7 @@
+ }
+ 
+ void NMethodSweeper::sweep_code_cache() {
++  ResourceMark rm;
+   Ticks sweep_start_counter = Ticks::now();
+ 
+   _flushed_count                = 0;
+@@ -626,6 +627,7 @@
+ // state of the code cache if it's requested.
+ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
+   if (PrintMethodFlushing) {
++    ResourceMark rm;
+     stringStream s;
+     // Dump code cache state into a buffer before locking the tty,
+     // because log_state() will use locks causing lock conflicts.
+@@ -643,6 +645,7 @@
+   }
+ 
+   if (LogCompilation && (xtty != NULL)) {
++    ResourceMark rm;
+     stringStream s;
+     // Dump code cache state into a buffer before locking the tty,
+     // because log_state() will use locks causing lock conflicts.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8175813-pr3394-rh1448880.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,283 @@
+# HG changeset patch
+# User gromero
+# Date 1496364169 14400
+#      Thu Jun 01 20:42:49 2017 -0400
+# Node ID 4dc64f3c3e2342970f091a1a73165a3e2a0c2f88
+# Parent  d77ea5a8ca52f04fc087ea2785ed4087ff630806
+8175813, PR3394, RH1448880: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used
+Reviewed-by: dholmes, zgu
+
+diff -r d77ea5a8ca52 -r 4dc64f3c3e23 src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+@@ -2747,8 +2747,9 @@
+ bool os::numa_topology_changed()   { return false; }
+ 
+ size_t os::numa_get_groups_num() {
+-  int max_node = Linux::numa_max_node();
+-  return max_node > 0 ? max_node + 1 : 1;
++  // Return just the number of nodes in which it's possible to allocate memory
++  // (in numa terminology, configured nodes).
++  return Linux::numa_num_configured_nodes();
+ }
+ 
+ int os::numa_get_group_id() {
+@@ -2762,11 +2763,33 @@
+   return 0;
+ }
+ 
++int os::Linux::get_existing_num_nodes() {
++  size_t node;
++  size_t highest_node_number = Linux::numa_max_node();
++  int num_nodes = 0;
++
++  // Get the total number of nodes in the system including nodes without memory.
++  for (node = 0; node <= highest_node_number; node++) {
++    if (isnode_in_existing_nodes(node)) {
++      num_nodes++;
++    }
++  }
++  return num_nodes;
++}
++
+ size_t os::numa_get_leaf_groups(int *ids, size_t size) {
+-  for (size_t i = 0; i < size; i++) {
+-    ids[i] = i;
+-  }
+-  return size;
++  size_t highest_node_number = Linux::numa_max_node();
++  size_t i = 0;
++
++  // Map all node ids in which is possible to allocate memory. Also nodes are
++  // not always consecutively available, i.e. available from 0 to the highest
++  // node number.
++  for (size_t node = 0; node <= highest_node_number; node++) {
++    if (Linux::isnode_in_configured_nodes(node)) {
++      ids[i++] = node;
++    }
++  }
++  return i;
+ }
+ 
+ bool os::get_page_info(char *start, page_info* info) {
+@@ -2836,18 +2859,28 @@
+                                            libnuma_dlsym(handle, "numa_node_to_cpus")));
+       set_numa_max_node(CAST_TO_FN_PTR(numa_max_node_func_t,
+                                        libnuma_dlsym(handle, "numa_max_node")));
++      set_numa_num_configured_nodes(CAST_TO_FN_PTR(numa_num_configured_nodes_func_t,
++                                                   libnuma_dlsym(handle, "numa_num_configured_nodes")));
+       set_numa_available(CAST_TO_FN_PTR(numa_available_func_t,
+                                         libnuma_dlsym(handle, "numa_available")));
+       set_numa_tonode_memory(CAST_TO_FN_PTR(numa_tonode_memory_func_t,
+                                             libnuma_dlsym(handle, "numa_tonode_memory")));
+       set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t,
+-                                            libnuma_dlsym(handle, "numa_interleave_memory")));
++                                                libnuma_dlsym(handle, "numa_interleave_memory")));
+       set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t,
+-                                            libnuma_dlsym(handle, "numa_set_bind_policy")));
+-
++                                              libnuma_dlsym(handle, "numa_set_bind_policy")));
++      set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t,
++                                               libnuma_dlsym(handle, "numa_bitmask_isbitset")));
++      set_numa_distance(CAST_TO_FN_PTR(numa_distance_func_t,
++                                       libnuma_dlsym(handle, "numa_distance")));
+ 
+       if (numa_available() != -1) {
+         set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes"));
++        set_numa_all_nodes_ptr((struct bitmask **)libnuma_dlsym(handle, "numa_all_nodes_ptr"));
++        set_numa_nodes_ptr((struct bitmask **)libnuma_dlsym(handle, "numa_nodes_ptr"));
++        // Create an index -> node mapping, since nodes are not always consecutive
++        _nindex_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<int>(0, true);
++        rebuild_nindex_to_node_map();
+         // Create a cpu -> node mapping
+         _cpu_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<int>(0, true);
+         rebuild_cpu_to_node_map();
+@@ -2858,6 +2891,17 @@
+   return false;
+ }
+ 
++void os::Linux::rebuild_nindex_to_node_map() {
++  int highest_node_number = Linux::numa_max_node();
++
++  nindex_to_node()->clear();
++  for (int node = 0; node <= highest_node_number; node++) {
++    if (Linux::isnode_in_existing_nodes(node)) {
++      nindex_to_node()->append(node);
++    }
++  }
++}
++
+ // rebuild_cpu_to_node_map() constructs a table mapping cpud id to node id.
+ // The table is later used in get_node_by_cpu().
+ void os::Linux::rebuild_cpu_to_node_map() {
+@@ -2877,16 +2921,46 @@
+ 
+   cpu_to_node()->clear();
+   cpu_to_node()->at_grow(cpu_num - 1);
+-  size_t node_num = numa_get_groups_num();
+-
++
++  size_t node_num = get_existing_num_nodes();
++
++  int distance = 0;
++  int closest_distance = INT_MAX;
++  int closest_node = 0;
+   unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal);
+   for (size_t i = 0; i < node_num; i++) {
+-    if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) {
++    // Check if node is configured (not a memory-less node). If it is not, find
++    // the closest configured node.
++    if (!isnode_in_configured_nodes(nindex_to_node()->at(i))) {
++      closest_distance = INT_MAX;
++      // Check distance from all remaining nodes in the system. Ignore distance
++      // from itself and from another non-configured node.
++      for (size_t m = 0; m < node_num; m++) {
++        if (m != i && isnode_in_configured_nodes(nindex_to_node()->at(m))) {
++          distance = numa_distance(nindex_to_node()->at(i), nindex_to_node()->at(m));
++          // If a closest node is found, update. There is always at least one
++          // configured node in the system so there is always at least one node
++          // close.
++          if (distance != 0 && distance < closest_distance) {
++            closest_distance = distance;
++            closest_node = nindex_to_node()->at(m);
++          }
++        }
++      }
++     } else {
++       // Current node is already a configured node.
++       closest_node = nindex_to_node()->at(i);
++     }
++
++    // Get cpus from the original node and map them to the closest node. If node
++    // is a configured node (not a memory-less node), then original node and
++    // closest node are the same.
++    if (numa_node_to_cpus(nindex_to_node()->at(i), cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) {
+       for (size_t j = 0; j < cpu_map_valid_size; j++) {
+         if (cpu_map[j] != 0) {
+           for (size_t k = 0; k < BitsPerCLong; k++) {
+             if (cpu_map[j] & (1UL << k)) {
+-              cpu_to_node()->at_put(j * BitsPerCLong + k, i);
++              cpu_to_node()->at_put(j * BitsPerCLong + k, closest_node);
+             }
+           }
+         }
+@@ -2904,14 +2978,20 @@
+ }
+ 
+ GrowableArray<int>* os::Linux::_cpu_to_node;
++GrowableArray<int>* os::Linux::_nindex_to_node;
+ os::Linux::sched_getcpu_func_t os::Linux::_sched_getcpu;
+ os::Linux::numa_node_to_cpus_func_t os::Linux::_numa_node_to_cpus;
+ os::Linux::numa_max_node_func_t os::Linux::_numa_max_node;
++os::Linux::numa_num_configured_nodes_func_t os::Linux::_numa_num_configured_nodes;
+ os::Linux::numa_available_func_t os::Linux::_numa_available;
+ os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory;
+ os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
+ os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy;
++os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset;
++os::Linux::numa_distance_func_t os::Linux::_numa_distance;
+ unsigned long* os::Linux::_numa_all_nodes;
++struct bitmask* os::Linux::_numa_all_nodes_ptr;
++struct bitmask* os::Linux::_numa_nodes_ptr;
+ 
+ bool os::pd_uncommit_memory(char* addr, size_t size) {
+   uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
+diff -r d77ea5a8ca52 -r 4dc64f3c3e23 src/os/linux/vm/os_linux.hpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp
+@@ -67,6 +67,7 @@
+   static bool _supports_fast_thread_cpu_time;
+ 
+   static GrowableArray<int>* _cpu_to_node;
++  static GrowableArray<int>* _nindex_to_node;
+ 
+  protected:
+ 
+@@ -94,7 +95,9 @@
+   static void set_is_floating_stack()         { _is_floating_stack = true; }
+ 
+   static void rebuild_cpu_to_node_map();
++  static void rebuild_nindex_to_node_map();
+   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
++  static GrowableArray<int>* nindex_to_node()  { return _nindex_to_node; }
+ 
+   static size_t find_large_page_size();
+   static size_t setup_large_page_size();
+@@ -243,28 +246,41 @@
+   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);
++  typedef int (*numa_num_configured_nodes_func_t)(void);
+   typedef int (*numa_available_func_t)(void);
+   typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node);
+   typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask);
+   typedef void (*numa_set_bind_policy_func_t)(int policy);
++  typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n);
++  typedef int (*numa_distance_func_t)(int node1, int node2);
+ 
+   static sched_getcpu_func_t _sched_getcpu;
+   static numa_node_to_cpus_func_t _numa_node_to_cpus;
+   static numa_max_node_func_t _numa_max_node;
++  static numa_num_configured_nodes_func_t _numa_num_configured_nodes;
+   static numa_available_func_t _numa_available;
+   static numa_tonode_memory_func_t _numa_tonode_memory;
+   static numa_interleave_memory_func_t _numa_interleave_memory;
+   static numa_set_bind_policy_func_t _numa_set_bind_policy;
++  static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset;
++  static numa_distance_func_t _numa_distance;
+   static unsigned long* _numa_all_nodes;
++  static struct bitmask* _numa_all_nodes_ptr;
++  static struct bitmask* _numa_nodes_ptr;
+ 
+   static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; }
+   static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; }
+   static void set_numa_max_node(numa_max_node_func_t func) { _numa_max_node = func; }
++  static void set_numa_num_configured_nodes(numa_num_configured_nodes_func_t func) { _numa_num_configured_nodes = func; }
+   static void set_numa_available(numa_available_func_t func) { _numa_available = func; }
+   static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; }
+   static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; }
+   static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; }
++  static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; }
++  static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; }
+   static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; }
++  static void set_numa_all_nodes_ptr(struct bitmask **ptr) { _numa_all_nodes_ptr = *ptr; }
++  static void set_numa_nodes_ptr(struct bitmask **ptr) { _numa_nodes_ptr = *ptr; }
+   static int sched_getcpu_syscall(void);
+ public:
+   static int sched_getcpu()  { return _sched_getcpu != NULL ? _sched_getcpu() : -1; }
+@@ -272,6 +288,9 @@
+     return _numa_node_to_cpus != NULL ? _numa_node_to_cpus(node, buffer, bufferlen) : -1;
+   }
+   static int numa_max_node() { return _numa_max_node != NULL ? _numa_max_node() : -1; }
++  static int numa_num_configured_nodes() {
++    return _numa_num_configured_nodes != NULL ? _numa_num_configured_nodes() : -1;
++  }
+   static int numa_available() { return _numa_available != NULL ? _numa_available() : -1; }
+   static int numa_tonode_memory(void *start, size_t size, int node) {
+     return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1;
+@@ -286,7 +305,25 @@
+       _numa_set_bind_policy(policy);
+     }
+   }
++  static int numa_distance(int node1, int node2) {
++    return _numa_distance != NULL ? _numa_distance(node1, node2) : -1;
++  }
+   static int get_node_by_cpu(int cpu_id);
++  static int get_existing_num_nodes();
++  // Check if numa node is configured (non-zero memory node).
++  static bool isnode_in_configured_nodes(unsigned int n) {
++    if (_numa_bitmask_isbitset != NULL && _numa_all_nodes_ptr != NULL) {
++      return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n);
++    } else
++      return 0;
++  }
++  // Check if numa node exists in the system (including zero memory nodes).
++  static bool isnode_in_existing_nodes(unsigned int n) {
++    if (_numa_bitmask_isbitset != NULL && _numa_nodes_ptr != NULL) {
++      return _numa_bitmask_isbitset(_numa_nodes_ptr, n);
++    } else
++      return 0;
++  }
+ };
+ 
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8175887-pr3415.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,166 @@
+# HG changeset patch
+# User shade
+# Date 1488979372 -3600
+#      Wed Mar 08 14:22:52 2017 +0100
+# Node ID 654b7fcb4932d48063f5f1fba0c8994db5e02976
+# Parent  1faf7c17089922f6f72b580253725f2ecb6ba2f8
+8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect
+Reviewed-by: vlivanov
+
+diff -r 1faf7c170899 -r 654b7fcb4932 src/share/vm/c1/c1_ValueMap.hpp
+--- openjdk/hotspot/src/share/vm/c1/c1_ValueMap.hpp
++++ openjdk/hotspot/src/share/vm/c1/c1_ValueMap.hpp
+@@ -158,6 +158,12 @@
+   void do_UnsafePutRaw   (UnsafePutRaw*    x) { kill_memory(); }
+   void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }
+   void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { kill_memory(); }
++  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
++  void do_UnsafeGetObject(UnsafeGetObject* x) {
++    if (x->is_volatile()) { // the JMM requires this
++      kill_memory();
++    }
++  }
+   void do_Intrinsic      (Intrinsic*       x) { if (!x->preserves_state()) kill_memory(); }
+ 
+   void do_Phi            (Phi*             x) { /* nothing to do */ }
+@@ -198,8 +204,6 @@
+   void do_OsrEntry       (OsrEntry*        x) { /* nothing to do */ }
+   void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
+   void do_RoundFP        (RoundFP*         x) { /* nothing to do */ }
+-  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
+-  void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
+   void do_UnsafePrefetchRead (UnsafePrefetchRead*  x) { /* nothing to do */ }
+   void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }
+   void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ }
+diff -r 1faf7c170899 -r 654b7fcb4932 test/compiler/c1/UnsafeVolatileGuardTest.java
+--- /dev/null
++++ openjdk/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java
+@@ -0,0 +1,72 @@
++/*
++ * Copyright (c) 2017, 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.
++ */
++
++import java.lang.reflect.Field;
++
++/**
++ * @test
++ * @bug 8175887
++ * @summary C1 value numbering handling of Unsafe.get*Volatile is incorrect
++ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 UnsafeVolatileGuardTest
++ */
++public class UnsafeVolatileGuardTest {
++    volatile static private int a;
++    static private int b;
++
++    static final sun.misc.Unsafe UNSAFE;
++
++    static final Object BASE;
++    static final long OFFSET;
++
++    static {
++        try {
++            Field uf = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
++            uf.setAccessible(true);
++            UNSAFE = (sun.misc.Unsafe)uf.get(null);
++
++            Field f = UnsafeVolatileGuardTest.class.getDeclaredField("a");
++            BASE = UNSAFE.staticFieldBase(f);
++            OFFSET = UNSAFE.staticFieldOffset(f);
++        } catch (Exception e) {
++            throw new RuntimeException(e);
++        }
++    }
++
++    static void test() {
++        int tt = b; // makes the JVM CSE the value of b
++
++        while (UNSAFE.getIntVolatile(BASE, OFFSET) == 0) {} // burn
++        if (b == 0) {
++            System.err.println("wrong value of b");
++            System.exit(1); // fail hard to report the error
++        }
++    }
++
++    public static void main(String [] args) throws Exception {
++        for (int i = 0; i < 10; i++) {
++            new Thread(UnsafeVolatileGuardTest::test).start();
++        }
++        b = 1;
++        a = 1;
++    }
++}
+diff -r 1faf7c170899 -r 654b7fcb4932 test/compiler/c1/VolatileGuardTest.java
+--- /dev/null
++++ openjdk/hotspot/test/compiler/c1/VolatileGuardTest.java
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2017, 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.
++ */
++
++/**
++ * @test
++ * @bug 8175887
++ * @summary C1 doesn't respect the JMM with volatile field loads
++ *
++ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 VolatileGuardTest
++ */
++public class VolatileGuardTest {
++    volatile static private int a;
++    static private int b;
++
++    static void test() {
++        int tt = b; // makes the JVM CSE the value of b
++
++        while (a == 0) {} // burn
++        if (b == 0) {
++            System.err.println("wrong value of b");
++            System.exit(1); // fail hard to report the error
++        }
++    }
++
++    public static void main(String [] args) throws Exception {
++        for (int i = 0; i < 10; i++) {
++            new Thread(VolatileGuardTest::test).start();
++        }
++        b = 1;
++        a = 1;
++    }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8179084-pr3409-rh1455694.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,134 @@
+# HG changeset patch
+# User dholmes
+# Date 1493428477 14400
+#      Fri Apr 28 21:14:37 2017 -0400
+# Node ID 2fee74c5547889d9698a2636e0a5170f9e66fb9c
+# Parent  13a04e8df5a3af73794146b930b32556c7cbc5b0
+8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set
+Reviewed-by: kbarrett, stefank
+
+diff -r 13a04e8df5a3 -r 2fee74c55478 src/share/vm/runtime/arguments.cpp
+--- openjdk/hotspot/src/share/vm/runtime/arguments.cpp
++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
+@@ -3193,8 +3193,6 @@
+ 
+       // Enable parallel GC and adaptive generation sizing
+       FLAG_SET_CMDLINE(bool, UseParallelGC, true);
+-      FLAG_SET_DEFAULT(ParallelGCThreads,
+-                       Abstract_VM_Version::parallel_worker_threads());
+ 
+       // Encourage steady state memory management
+       FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100);
+diff -r 13a04e8df5a3 -r 2fee74c55478 test/TEST.groups
+--- openjdk/hotspot/test/TEST.groups
++++ openjdk/hotspot/test/TEST.groups
+@@ -1,5 +1,5 @@
+ #
+-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2013, 2017, 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
+@@ -164,6 +164,7 @@
+   gc/TestGCLogRotationViaJcmd.java \
+   gc/g1/TestHumongousAllocInitialMark.java \
+   gc/g1/TestHumongousShrinkHeap.java \
++  gc/arguments/TestAggressiveHeap.java \
+   gc/arguments/TestG1HeapRegionSize.java \
+   gc/metaspace/TestMetaspaceMemoryPool.java \
+   gc/arguments/TestDynMinHeapFreeRatio.java \
+diff -r 13a04e8df5a3 -r 2fee74c55478 test/gc/arguments/TestAggressiveHeap.java
+--- /dev/null
++++ openjdk/hotspot/test/gc/arguments/TestAggressiveHeap.java
+@@ -0,0 +1,91 @@
++/*
++ * Copyright (c) 2017, 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.
++ */
++
++/*
++ * @test TestAggressiveHeap
++ * @key gc
++ * @bug 8179084
++ * @summary Test argument processing for -XX:+AggressiveHeap.
++ * @library /testlibrary
++ * @run driver TestAggressiveHeap
++ */
++
++import java.lang.management.ManagementFactory;
++import javax.management.MBeanServer;
++import javax.management.ObjectName;
++
++import com.oracle.java.testlibrary.OutputAnalyzer;
++import com.oracle.java.testlibrary.ProcessTools;
++
++public class TestAggressiveHeap {
++
++    public static void main(String args[]) throws Exception {
++        if (canUseAggressiveHeapOption()) {
++            testFlag();
++        }
++    }
++
++    // Note: Not a normal boolean flag; -XX:-AggressiveHeap is invalid.
++    private static final String option = "-XX:+AggressiveHeap";
++
++    // Option requires at least 256M, else error during option processing.
++    private static final long minMemory = 256 * 1024 * 1024;
++
++    // bool UseParallelGC := true {product}
++    private static final String parallelGCPattern =
++        " *bool +UseParallelGC *:= *true +\\{product\\}";
++
++    private static void testFlag() throws Exception {
++        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
++            option, "-XX:+PrintFlagsFinal", "-version");
++
++        OutputAnalyzer output = new OutputAnalyzer(pb.start());
++
++        output.shouldHaveExitValue(0);
++
++        String value = output.firstMatch(parallelGCPattern);
++        if (value == null) {
++            throw new RuntimeException(
++                option + " didn't set UseParallelGC");
++        }
++    }
++
++    private static boolean haveRequiredMemory() throws Exception {
++        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
++        ObjectName os = new ObjectName("java.lang", "type", "OperatingSystem");
++        Object attr = server.getAttribute(os, "TotalPhysicalMemorySize");
++        String value = attr.toString();
++        long memory = Long.parseLong(value);
++        return memory >= minMemory;
++    }
++
++    private static boolean canUseAggressiveHeapOption() throws Exception {
++        if (!haveRequiredMemory()) {
++            System.out.println(
++                "Skipping test of " + option + " : insufficient memory");
++            return false;
++        }
++        return true;
++    }
++}
++
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8180048-pr3411-rh1449870.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,288 @@
+# HG changeset patch
+# User tschatzl
+# Date 1494843615 -7200
+#      Mon May 15 12:20:15 2017 +0200
+# Node ID 3d07e14d65bc223dbfe94be9224e4aa8c6e63762
+# Parent  2fee74c5547889d9698a2636e0a5170f9e66fb9c
+8180048, PR3411, RH1449870: Interned string and symbol table leak memory during parallel unlinking
+Summary: Make appending found dead BasicHashtableEntrys to the free list atomic.
+Reviewed-by: ehelin, shade
+
+diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/classfile/symbolTable.cpp
+--- openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp
++++ openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2017, 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
+@@ -96,7 +96,7 @@
+ int SymbolTable::_symbols_counted = 0;
+ volatile int SymbolTable::_parallel_claimed_idx = 0;
+ 
+-void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total) {
++void SymbolTable::buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context, size_t* memory_total) {
+   for (int i = start_idx; i < end_idx; ++i) {
+     HashtableEntry<Symbol*, mtSymbol>** p = the_table()->bucket_addr(i);
+     HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i);
+@@ -110,15 +110,14 @@
+       }
+       Symbol* s = entry->literal();
+       (*memory_total) += s->size();
+-      (*processed)++;
++      context->_num_processed++;
+       assert(s != NULL, "just checking");
+       // If reference count is zero, remove.
+       if (s->refcount() == 0) {
+         assert(!entry->is_shared(), "shared entries should be kept live");
+         delete s;
+-        (*removed)++;
+         *p = entry->next();
+-        the_table()->free_entry(entry);
++        context->free_entry(entry);
+       } else {
+         p = entry->next_addr();
+       }
+@@ -132,9 +131,14 @@
+ // This is done late during GC.
+ void SymbolTable::unlink(int* processed, int* removed) {
+   size_t memory_total = 0;
+-  buckets_unlink(0, the_table()->table_size(), processed, removed, &memory_total);
+-  _symbols_removed += *removed;
+-  _symbols_counted += *processed;
++  BucketUnlinkContext context;
++  buckets_unlink(0, the_table()->table_size(), &context, &memory_total);
++  _the_table->bulk_free_entries(&context);
++  *processed = context._num_processed;
++  *removed = context._num_removed;
++
++  _symbols_removed = context._num_removed;
++  _symbols_counted = context._num_processed;
+   // Exclude printing for normal PrintGCDetails because people parse
+   // this output.
+   if (PrintGCDetails && Verbose && WizardMode) {
+@@ -148,6 +152,7 @@
+ 
+   size_t memory_total = 0;
+ 
++  BucketUnlinkContext context;
+   for (;;) {
+     // Grab next set of buckets to scan
+     int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
+@@ -157,10 +162,15 @@
+     }
+ 
+     int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
+-    buckets_unlink(start_idx, end_idx, processed, removed, &memory_total);
++    buckets_unlink(start_idx, end_idx, &context, &memory_total);
+   }
+-  Atomic::add(*processed, &_symbols_counted);
+-  Atomic::add(*removed, &_symbols_removed);
++
++  _the_table->bulk_free_entries(&context);
++  *processed = context._num_processed;
++  *removed = context._num_removed;
++
++  Atomic::add(context._num_processed, &_symbols_counted);
++  Atomic::add(context._num_removed, &_symbols_removed);
+   // Exclude printing for normal PrintGCDetails because people parse
+   // this output.
+   if (PrintGCDetails && Verbose && WizardMode) {
+@@ -811,7 +821,11 @@
+ }
+ 
+ void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
+-  buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, removed);
++  BucketUnlinkContext context;
++  buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), &context);
++  _the_table->bulk_free_entries(&context);
++  *processed = context._num_processed;
++  *removed = context._num_removed;
+ }
+ 
+ void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
+@@ -820,6 +834,7 @@
+   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+   const int limit = the_table()->table_size();
+ 
++  BucketUnlinkContext context;
+   for (;;) {
+     // Grab next set of buckets to scan
+     int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
+@@ -829,8 +844,11 @@
+     }
+ 
+     int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
+-    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed);
++    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, &context);
+   }
++  _the_table->bulk_free_entries(&context);
++  *processed = context._num_processed;
++  *removed = context._num_removed;
+ }
+ 
+ void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
+@@ -856,7 +874,7 @@
+   }
+ }
+ 
+-void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) {
++void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context) {
+   const int limit = the_table()->table_size();
+ 
+   assert(0 <= start_idx && start_idx <= limit,
+@@ -880,10 +898,9 @@
+         p = entry->next_addr();
+       } else {
+         *p = entry->next();
+-        the_table()->free_entry(entry);
+-        (*removed)++;
++        context->free_entry(entry);
+       }
+-      (*processed)++;
++      context->_num_processed++;
+       entry = *p;
+     }
+   }
+diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/classfile/symbolTable.hpp
+--- openjdk/hotspot/src/share/vm/classfile/symbolTable.hpp
++++ openjdk/hotspot/src/share/vm/classfile/symbolTable.hpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 1997, 2017, 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
+@@ -124,8 +124,11 @@
+ 
+   static volatile int _parallel_claimed_idx;
+ 
+-  // Release any dead symbols
+-  static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total);
++  typedef SymbolTable::BucketUnlinkContext BucketUnlinkContext;
++  // Release any dead symbols. Unlinked bucket entries are collected in the given
++  // context to be freed later.
++  // This allows multiple threads to work on the table at once.
++  static void buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context, size_t* memory_total);
+ public:
+   enum {
+     symbol_alloc_batch_size = 8,
+@@ -274,9 +277,13 @@
+   // Apply the give oop closure to the entries to the buckets
+   // in the range [start_idx, end_idx).
+   static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
++
++  typedef StringTable::BucketUnlinkContext BucketUnlinkContext;
+   // Unlink or apply the give oop closure to the entries to the buckets
+-  // in the range [start_idx, end_idx).
+-  static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
++  // in the range [start_idx, end_idx). Unlinked bucket entries are collected in the given
++  // context to be freed later.
++  // This allows multiple threads to work on the table at once.
++  static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, BucketUnlinkContext* context);
+ 
+   StringTable() : RehashableHashtable<oop, mtSymbol>((int)StringTableSize,
+                               sizeof (HashtableEntry<oop, mtSymbol>)) {}
+diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/runtime/vmStructs.cpp
+--- openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
++++ openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
+@@ -712,7 +712,7 @@
+                                                                                                                                      \
+   nonstatic_field(BasicHashtable<mtInternal>, _table_size,                                   int)                                   \
+   nonstatic_field(BasicHashtable<mtInternal>, _buckets,                                      HashtableBucket<mtInternal>*)          \
+-  nonstatic_field(BasicHashtable<mtInternal>, _free_list,                                    BasicHashtableEntry<mtInternal>*)      \
++  volatile_nonstatic_field(BasicHashtable<mtInternal>,  _free_list,                          BasicHashtableEntry<mtInternal>*)      \
+   nonstatic_field(BasicHashtable<mtInternal>, _first_free_entry,                             char*)                                 \
+   nonstatic_field(BasicHashtable<mtInternal>, _end_block,                                    char*)                                 \
+   nonstatic_field(BasicHashtable<mtInternal>, _entry_size,                                   int)                                   \
+diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/utilities/hashtable.cpp
+--- openjdk/hotspot/src/share/vm/utilities/hashtable.cpp
++++ openjdk/hotspot/src/share/vm/utilities/hashtable.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2003, 2017, 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
+@@ -172,6 +172,35 @@
+   }
+ }
+ 
++template <MEMFLAGS F> void BasicHashtable<F>::BucketUnlinkContext::free_entry(BasicHashtableEntry<F>* entry) {
++  entry->set_next(_removed_head);
++  _removed_head = entry;
++  if (_removed_tail == NULL) {
++    _removed_tail = entry;
++  }
++  _num_removed++;
++}
++
++template <MEMFLAGS F> void BasicHashtable<F>::bulk_free_entries(BucketUnlinkContext* context) {
++  if (context->_num_removed == 0) {
++    assert(context->_removed_head == NULL && context->_removed_tail == NULL,
++           err_msg("Zero entries in the unlink context, but elements linked from " PTR_FORMAT " to " PTR_FORMAT,
++                   p2i(context->_removed_head), p2i(context->_removed_tail)));
++    return;
++  }
++
++  // MT-safe add of the list of BasicHashTableEntrys from the context to the free list.
++  BasicHashtableEntry<F>* current = _free_list;
++  while (true) {
++    context->_removed_tail->set_next(current);
++    BasicHashtableEntry<F>* old = (BasicHashtableEntry<F>*)Atomic::cmpxchg_ptr(context->_removed_head, &_free_list, current);
++    if (old == current) {
++      break;
++    }
++    current = old;
++  }
++  Atomic::add(-context->_num_removed, &_number_of_entries);
++}
+ 
+ // Copy the table to the shared space.
+ 
+diff -r 2fee74c55478 -r 3d07e14d65bc src/share/vm/utilities/hashtable.hpp
+--- openjdk/hotspot/src/share/vm/utilities/hashtable.hpp
++++ openjdk/hotspot/src/share/vm/utilities/hashtable.hpp
+@@ -164,11 +164,11 @@
+   // Instance variables
+   int               _table_size;
+   HashtableBucket<F>*     _buckets;
+-  BasicHashtableEntry<F>* _free_list;
++  BasicHashtableEntry<F>* volatile _free_list;
+   char*             _first_free_entry;
+   char*             _end_block;
+   int               _entry_size;
+-  int               _number_of_entries;
++  volatile int      _number_of_entries;
+ 
+ protected:
+ 
+@@ -215,6 +215,24 @@
+   // Free the buckets in this hashtable
+   void free_buckets();
+ 
++  // Helper data structure containing context for the bucket entry unlink process,
++  // storing the unlinked buckets in a linked list.
++  // Also avoids the need to pass around these four members as parameters everywhere.
++  struct BucketUnlinkContext {
++    int _num_processed;
++    int _num_removed;
++    // Head and tail pointers for the linked list of removed entries.
++    BasicHashtableEntry<F>* _removed_head;
++    BasicHashtableEntry<F>* _removed_tail;
++
++    BucketUnlinkContext() : _num_processed(0), _num_removed(0), _removed_head(NULL), _removed_tail(NULL) {
++    }
++
++    void free_entry(BasicHashtableEntry<F>* entry);
++  };
++  // Add of bucket entries linked together in the given context to the global free list. This method
++  // is mt-safe wrt. to other calls of this method.
++  void bulk_free_entries(BucketUnlinkContext* context);
+ public:
+   int table_size() { return _table_size; }
+   void set_entry(int index, BasicHashtableEntry<F>* entry);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/shenandoah/8181055-pr3394-rh1448880.patch	Fri Jul 07 04:11:20 2017 +0100
@@ -0,0 +1,106 @@
+# HG changeset patch
+# User zgu
+# Date 1499204074 -3600
+#      Tue Jul 04 22:34:34 2017 +0100
+# Node ID 13a04e8df5a3af73794146b930b32556c7cbc5b0
+# Parent  4dc64f3c3e2342970f091a1a73165a3e2a0c2f88
+8181055, PR3394, RH1448880: PPC64: "mbind: Invalid argument" still seen after 8175813
+Summary: Use numa_interleave_memory v2 api when available
+Reviewed-by: dholmes, shade, gromero
+
+diff -r 4dc64f3c3e23 -r 13a04e8df5a3 src/os/linux/vm/os_linux.cpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+@@ -2830,11 +2830,8 @@
+ extern "C" JNIEXPORT void numa_error(char *where) { }
+ extern "C" JNIEXPORT int fork1() { return fork(); }
+ 
+-
+-// If we are running with libnuma version > 2, then we should
+-// be trying to use symbols with versions 1.1
+-// If we are running with earlier version, which did not have symbol versions,
+-// we should use the base version.
++// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
++// load symbol from base version instead.
+ void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
+   void *f = dlvsym(handle, name, "libnuma_1.1");
+   if (f == NULL) {
+@@ -2843,6 +2840,12 @@
+   return f;
+ }
+ 
++// Handle request to load libnuma symbol version 1.2 (API v2) only.
++// Return NULL if the symbol is not defined in this particular version.
++void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) {
++  return dlvsym(handle, name, "libnuma_1.2");
++}
++
+ bool os::Linux::libnuma_init() {
+   // sched_getcpu() should be in libc.
+   set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
+@@ -2867,6 +2870,8 @@
+                                             libnuma_dlsym(handle, "numa_tonode_memory")));
+       set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t,
+                                                 libnuma_dlsym(handle, "numa_interleave_memory")));
++      set_numa_interleave_memory_v2(CAST_TO_FN_PTR(numa_interleave_memory_v2_func_t,
++                                                libnuma_v2_dlsym(handle, "numa_interleave_memory")));
+       set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t,
+                                               libnuma_dlsym(handle, "numa_set_bind_policy")));
+       set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t,
+@@ -2986,6 +2991,7 @@
+ os::Linux::numa_available_func_t os::Linux::_numa_available;
+ os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory;
+ os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
++os::Linux::numa_interleave_memory_v2_func_t os::Linux::_numa_interleave_memory_v2;
+ os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy;
+ os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset;
+ os::Linux::numa_distance_func_t os::Linux::_numa_distance;
+diff -r 4dc64f3c3e23 -r 13a04e8df5a3 src/os/linux/vm/os_linux.hpp
+--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp
++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp
+@@ -190,6 +190,8 @@
+   static void libpthread_init();
+   static bool libnuma_init();
+   static void* libnuma_dlsym(void* handle, const char* name);
++  // libnuma v2 (libnuma_1.2) symbols
++  static void* libnuma_v2_dlsym(void* handle, const char* name);
+   // Minimum stack size a thread can be created with (allowing
+   // the VM to completely create the thread and enter user code)
+   static size_t min_stack_allowed;
+@@ -250,6 +252,8 @@
+   typedef int (*numa_available_func_t)(void);
+   typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node);
+   typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask);
++  typedef void (*numa_interleave_memory_v2_func_t)(void *start, size_t size, struct bitmask* mask);
++
+   typedef void (*numa_set_bind_policy_func_t)(int policy);
+   typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n);
+   typedef int (*numa_distance_func_t)(int node1, int node2);
+@@ -261,6 +265,7 @@
+   static numa_available_func_t _numa_available;
+   static numa_tonode_memory_func_t _numa_tonode_memory;
+   static numa_interleave_memory_func_t _numa_interleave_memory;
++  static numa_interleave_memory_v2_func_t _numa_interleave_memory_v2;
+   static numa_set_bind_policy_func_t _numa_set_bind_policy;
+   static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset;
+   static numa_distance_func_t _numa_distance;
+@@ -275,6 +280,7 @@
+   static void set_numa_available(numa_available_func_t func) { _numa_available = func; }
+   static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; }
+   static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; }
++  static void set_numa_interleave_memory_v2(numa_interleave_memory_v2_func_t func) { _numa_interleave_memory_v2 = func; }
+   static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; }
+   static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; }
+   static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; }
+@@ -296,7 +302,10 @@
+     return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1;
+   }
+   static void numa_interleave_memory(void *start, size_t size) {
+-    if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) {
++    // Use v2 api if available
++    if (_numa_interleave_memory_v2 != NULL && _numa_all_nodes_ptr != NULL) {
++      _numa_interleave_memory_v2(start, size, _numa_all_nodes_ptr);
++    } else if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) {
+       _numa_interleave_memory(start, size, _numa_all_nodes);
+     }
+   }