Commit 5d8475 updated to aarch64-jdk8u151-b12 (from aarch64-port/jdk8u)

23 files Authored and Committed by jvanek 2 months ago
updated to aarch64-jdk8u151-b12 (from aarch64-port/jdk8u)
- updated to aarch64-shenandoah-jdk8u151-b12 (from aarch64-port/jdk8u-shenandoah) of hotspot
- used aarch64-port-jdk8u-aarch64-jdk8u151-b12.tar.xz as new sources
- used aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u151-b12.tar.xz as new sources for hotspot
- tapset updated to 3.6pre02
- policies adapted to new limited/unlimited schmea
- above acomapnied by c-j-c 3.3
- alligned patches and added PPC ones (thanx to gnu_andrew)
- added patch209: 8035496-hotspot.patch
- added patch210: suse_linuxfilestore.patc

    
1 @@ -93,3 +93,6 @@
2   /aarch64-port-jdk8u-aarch64-jdk8u144-b01.tar.xz
3   /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u144-b01.tar.xz
4   /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u144-b02-shenandoah-merge-2017-10-02.tar.xz
5 + /aarch64-port-jdk8u-aarch64-jdk8u151-b12.tar.xz
6 + /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u151-b12.tar.xz
7 + /systemtap-tapset-3.6.0pre02.tar.xz
 1 @@ -0,0 +1,30 @@
 2 + # HG changeset patch
 3 + # User bdelsart
 4 + # Date 1508481469 -28800
 5 + #      Fri Oct 20 14:37:49 2017 +0800
 6 + # Node ID 111ed1a4719008b83bf427ae16bbeac2a7a516bc
 7 + # Parent  471de666658d7ec14c5d3f97076fb95f70dd6ffa
 8 + 8035496: G1 ARM: missing remset entry noticed by VerifyAfterGC for vm/gc/concurrent/lp50yp10rp70mr30st0
 9 + Summary: release_store used when registering a PerRegionTable. Also reviewed-by: vitalyd@gmail.com
10 + Reviewed-by: jmasa, tschatzl, brutisso
11 + 
12 + diff --git a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
13 + --- openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
14 + +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
15 + @@ -514,7 +514,15 @@
16 +  
17 +        PerRegionTable* first_prt = _fine_grain_regions[ind];
18 +        prt->set_collision_list_next(first_prt);
19 + -      _fine_grain_regions[ind] = prt;
20 + +      // The assignment into _fine_grain_regions allows the prt to
21 + +      // start being used concurrently. In addition to
22 + +      // collision_list_next which must be visible (else concurrent
23 + +      // parsing of the list, if any, may fail to see other entries),
24 + +      // the content of the prt must be visible (else for instance
25 + +      // some mark bits may not yet seem cleared or a 'later' update
26 + +      // performed by a concurrent thread could be undone when the
27 + +      // zeroing becomes visible). This requires store ordering.
28 + +      OrderAccess::release_store_ptr((volatile PerRegionTable*)&_fine_grain_regions[ind], prt);
29 +        _n_fine_entries++;
30 +  
31 +        if (G1HRRSUseSparseTable) {
  1 @@ -0,0 +1,278 @@
  2 + # HG changeset patch
  3 + # User vtewari
  4 + # Date 1508189111 -3600
  5 + #      Mon Oct 16 22:25:11 2017 +0100
  6 + # Node ID bcaa659478ccac2b2ad1a817e03cab777949775a
  7 + # Parent  161fbe4c53ff12328565487e69a608e15f39bd49
  8 + 8075484, PR3473, RH1490713: SocketInputStream.socketRead0 can hang even with soTimeout set
  9 + Reviewed-by: chegar, dsamersoff, msheppar, clanger
 10 + 
 11 + diff --git a/src/aix/native/java/net/aix_close.c b/src/aix/native/java/net/aix_close.c
 12 + --- openjdk/jdk/src/aix/native/java/net/aix_close.c
 13 + +++ openjdk/jdk/src/aix/native/java/net/aix_close.c
 14 + @@ -1,5 +1,6 @@
 15 +  /*
 16 + - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
 17 + + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
 18 + + * Copyright (c) 2016, SAP SE and/or its affiliates. All rights reserved.
 19 +   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 20 +   *
 21 +   * This code is free software; you can redistribute it and/or modify it
 22 + @@ -328,6 +329,10 @@
 23 +      BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) );
 24 +  }
 25 +  
 26 + +int NET_NonBlockingRead(int s, void* buf, size_t len) {
 27 + +    BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK));
 28 + +}
 29 + +
 30 +  int NET_ReadV(int s, const struct iovec * vector, int count) {
 31 +      BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) );
 32 +  }
 33 + @@ -429,8 +434,8 @@
 34 +   * Auto restarts with adjusted timeout if interrupted by
 35 +   * signal other than our wakeup signal.
 36 +   */
 37 + -int NET_Timeout(int s, long timeout) {
 38 + -    long prevtime = 0, newtime;
 39 + +int NET_Timeout0(int s, long timeout, long currentTime) {
 40 + +    long prevtime = currentTime, newtime;
 41 +      struct timeval t;
 42 +      fdEntry_t *fdEntry = getFdEntry(s);
 43 +  
 44 + @@ -442,14 +447,6 @@
 45 +          return -1;
 46 +      }
 47 +  
 48 + -    /*
 49 + -     * Pick up current time as may need to adjust timeout
 50 + -     */
 51 + -    if (timeout > 0) {
 52 + -        gettimeofday(&t, NULL);
 53 + -        prevtime = t.tv_sec * 1000  +  t.tv_usec / 1000;
 54 + -    }
 55 + -
 56 +      for(;;) {
 57 +          struct pollfd pfd;
 58 +          int rv;
 59 + diff --git a/src/solaris/native/java/net/SocketInputStream.c b/src/solaris/native/java/net/SocketInputStream.c
 60 + --- openjdk/jdk/src/solaris/native/java/net/SocketInputStream.c
 61 + +++ openjdk/jdk/src/solaris/native/java/net/SocketInputStream.c
 62 + @@ -1,5 +1,5 @@
 63 +  /*
 64 + - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
 65 + + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
 66 +   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 67 +   *
 68 +   * This code is free software; you can redistribute it and/or modify it
 69 + @@ -52,6 +52,42 @@
 70 +      IO_fd_fdID = NET_GetFileDescriptorID(env);
 71 +  }
 72 +  
 73 + +#if !defined(__solaris__)
 74 + +static int NET_ReadWithTimeout(JNIEnv *env, int fd, char *bufP, int len, long timeout) {
 75 + +    int result = 0;
 76 + +    long prevtime = NET_GetCurrentTime(), newtime;
 77 + +    while (timeout > 0) {
 78 + +        result = NET_TimeoutWithCurrentTime(fd, timeout, prevtime);
 79 + +        if (result <= 0) {
 80 + +            if (result == 0) {
 81 + +                JNU_ThrowByName(env, "java/net/SocketTimeoutException", "Read timed out");
 82 + +            } else if (result == -1) {
 83 + +                if (errno == EBADF) {
 84 + +                    JNU_ThrowByName(env, "java/net/SocketException", "Socket closed");
 85 + +                } else if (errno == ENOMEM) {
 86 + +                    JNU_ThrowOutOfMemoryError(env, "NET_Timeout native heap allocation failed");
 87 + +                } else {
 88 + +                    JNU_ThrowByNameWithMessageAndLastError
 89 + +                            (env, "java/net/SocketException", "select/poll failed");
 90 + +                }
 91 + +            }
 92 + +            return -1;
 93 + +        }
 94 + +        result = NET_NonBlockingRead(fd, bufP, len);
 95 + +        if (result == -1 && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {
 96 + +            newtime = NET_GetCurrentTime();
 97 + +            timeout -= newtime - prevtime;
 98 + +            if (timeout > 0) {
 99 + +                prevtime = newtime;
100 + +            }
101 + +        } else {
102 + +            break;
103 + +        }
104 + +    }
105 + +    return result;
106 + +}
107 + +#endif
108 + +
109 +  /*
110 +   * Class:     java_net_SocketInputStream
111 +   * Method:    socketRead0
112 + @@ -99,6 +135,7 @@
113 +          bufP = BUF;
114 +      }
115 +  
116 + +#if defined(__solaris__)
117 +      if (timeout) {
118 +          nread = NET_Timeout(fd, timeout);
119 +          if (nread <= 0) {
120 + @@ -126,7 +163,19 @@
121 +      }
122 +  
123 +      nread = NET_Read(fd, bufP, len);
124 + -
125 + +#else
126 + +    if (timeout) {
127 + +        nread = NET_ReadWithTimeout(env, fd, bufP, len, timeout);
128 + +        if ((*env)->ExceptionCheck(env)) {
129 + +            if (bufP != BUF) {
130 + +                free(bufP);
131 + +            }
132 + +            return nread;
133 + +        }
134 + +    } else {
135 + +        nread = NET_Read(fd, bufP, len);
136 + +    }
137 + +#endif
138 +      if (nread <= 0) {
139 +          if (nread < 0) {
140 +  
141 + diff --git a/src/solaris/native/java/net/bsd_close.c b/src/solaris/native/java/net/bsd_close.c
142 + --- openjdk/jdk/src/solaris/native/java/net/bsd_close.c
143 + +++ openjdk/jdk/src/solaris/native/java/net/bsd_close.c
144 + @@ -1,5 +1,5 @@
145 +  /*
146 + - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
147 + + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
148 +   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
149 +   *
150 +   * This code is free software; you can redistribute it and/or modify it
151 + @@ -292,6 +292,10 @@
152 +      BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) );
153 +  }
154 +  
155 + +int NET_NonBlockingRead(int s, void* buf, size_t len) {
156 + +    BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT));
157 + +}
158 + +
159 +  int NET_ReadV(int s, const struct iovec * vector, int count) {
160 +      BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) );
161 +  }
162 + @@ -344,8 +348,8 @@
163 +   * Auto restarts with adjusted timeout if interrupted by
164 +   * signal other than our wakeup signal.
165 +   */
166 + -int NET_Timeout(int s, long timeout) {
167 + -    long prevtime = 0, newtime;
168 + +int NET_Timeout0(int s, long timeout, long currentTime) {
169 + +    long prevtime = currentTime, newtime;
170 +      struct timeval t, *tp = &t;
171 +      fd_set fds;
172 +      fd_set* fdsp = NULL;
173 + @@ -366,9 +370,6 @@
174 +       */
175 +      if (timeout > 0) {
176 +          /* Timed */
177 + -        struct timeval now;
178 + -        gettimeofday(&now, NULL);
179 + -        prevtime = now.tv_sec * 1000  +  now.tv_usec / 1000;
180 +          t.tv_sec = timeout / 1000;
181 +          t.tv_usec = (timeout % 1000) * 1000;
182 +      } else if (timeout < 0) {
183 + diff --git a/src/solaris/native/java/net/linux_close.c b/src/solaris/native/java/net/linux_close.c
184 + --- openjdk/jdk/src/solaris/native/java/net/linux_close.c
185 + +++ openjdk/jdk/src/solaris/native/java/net/linux_close.c
186 + @@ -1,5 +1,5 @@
187 +  /*
188 + - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
189 + + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
190 +   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
191 +   *
192 +   * This code is free software; you can redistribute it and/or modify it
193 + @@ -273,6 +273,10 @@
194 +      BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) );
195 +  }
196 +  
197 + +int NET_NonBlockingRead(int s, void* buf, size_t len) {
198 + +    BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT) );
199 + +}
200 + +
201 +  int NET_ReadV(int s, const struct iovec * vector, int count) {
202 +      BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) );
203 +  }
204 + @@ -324,8 +328,8 @@
205 +   * Auto restarts with adjusted timeout if interrupted by
206 +   * signal other than our wakeup signal.
207 +   */
208 + -int NET_Timeout(int s, long timeout) {
209 + -    long prevtime = 0, newtime;
210 + +int NET_Timeout0(int s, long timeout, long currentTime) {
211 + +    long prevtime = currentTime, newtime;
212 +      struct timeval t;
213 +      fdEntry_t *fdEntry = getFdEntry(s);
214 +  
215 + @@ -337,14 +341,6 @@
216 +          return -1;
217 +      }
218 +  
219 + -    /*
220 + -     * Pick up current time as may need to adjust timeout
221 + -     */
222 + -    if (timeout > 0) {
223 + -        gettimeofday(&t, NULL);
224 + -        prevtime = t.tv_sec * 1000  +  t.tv_usec / 1000;
225 + -    }
226 + -
227 +      for(;;) {
228 +          struct pollfd pfd;
229 +          int rv;
230 + diff --git a/src/solaris/native/java/net/net_util_md.c b/src/solaris/native/java/net/net_util_md.c
231 + --- openjdk/jdk/src/solaris/native/java/net/net_util_md.c
232 + +++ openjdk/jdk/src/solaris/native/java/net/net_util_md.c
233 + @@ -33,6 +33,7 @@
234 +  #include <netdb.h>
235 +  #include <stdlib.h>
236 +  #include <dlfcn.h>
237 + +#include <sys/time.h>
238 +  
239 +  #ifndef _ALLBSD_SOURCE
240 +  #include <values.h>
241 + @@ -1661,3 +1662,20 @@
242 +  
243 +      return timeout;
244 +  }
245 + +
246 + +#if !defined(__solaris__)
247 + +long NET_GetCurrentTime() {
248 + +    struct timeval time;
249 + +    gettimeofday(&time, NULL);
250 + +    return (time.tv_sec * 1000 + time.tv_usec / 1000);
251 + +}
252 + +
253 + +int NET_TimeoutWithCurrentTime(int s, long timeout, long currentTime) {
254 + +    return NET_Timeout0(s, timeout, currentTime);
255 + +}
256 + +
257 + +int NET_Timeout(int s, long timeout) {
258 + +    long currentTime = (timeout > 0) ? NET_GetCurrentTime() : 0;
259 + +    return NET_Timeout0(s, timeout, currentTime);
260 + +}
261 + +#endif
262 + diff --git a/src/solaris/native/java/net/net_util_md.h b/src/solaris/native/java/net/net_util_md.h
263 + --- openjdk/jdk/src/solaris/native/java/net/net_util_md.h
264 + +++ openjdk/jdk/src/solaris/native/java/net/net_util_md.h
265 + @@ -47,9 +47,13 @@
266 +     close subroutine does not return until the select call returns.
267 +     ...
268 +  */
269 + -#if defined(__linux__) || defined(MACOSX) || defined (_AIX)
270 + +#if !defined(__solaris__)
271 +  extern int NET_Timeout(int s, long timeout);
272 + +extern int NET_Timeout0(int s, long timeout, long currentTime);
273 +  extern int NET_Read(int s, void* buf, size_t len);
274 + +extern int NET_NonBlockingRead(int s, void* buf, size_t len);
275 + +extern int NET_TimeoutWithCurrentTime(int s, long timeout, long currentTime);
276 + +extern long NET_GetCurrentTime();
277 +  extern int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
278 +         struct sockaddr *from, int *fromlen);
279 +  extern int NET_ReadV(int s, const struct iovec * vector, int count);
  1 @@ -0,0 +1,471 @@
  2 + # HG changeset patch
  3 + # User mdoerr
  4 + # Date 1507750779 -3600
  5 + #      Wed Oct 11 20:39:39 2017 +0100
  6 + # Node ID 92f0dbe76a13992cc27188e0f68e4b1771c7004a
  7 + # Parent  542c122b1d7d30c29189565248074aa28f21ae58
  8 + 8145913, PR3466, RH1498309: PPC64: add Montgomery multiply intrinsic
  9 + Reviewed-by: aph, goetz
 10 + 
 11 + diff --git a/src/cpu/ppc/vm/assembler_ppc.hpp b/src/cpu/ppc/vm/assembler_ppc.hpp
 12 + --- openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
 13 + +++ openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
 14 + @@ -1179,6 +1179,8 @@
 15 +    inline void mullw_( Register d, Register a, Register b);
 16 +    inline void mulhw(  Register d, Register a, Register b);
 17 +    inline void mulhw_( Register d, Register a, Register b);
 18 + +  inline void mulhwu( Register d, Register a, Register b);
 19 + +  inline void mulhwu_(Register d, Register a, Register b);
 20 +    inline void mulhd(  Register d, Register a, Register b);
 21 +    inline void mulhd_( Register d, Register a, Register b);
 22 +    inline void mulhdu( Register d, Register a, Register b);
 23 + diff --git a/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/src/cpu/ppc/vm/assembler_ppc.inline.hpp
 24 + --- openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
 25 + +++ openjdk/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
 26 + @@ -109,6 +109,8 @@
 27 +  inline void Assembler::mullw_( Register d, Register a, Register b) { emit_int32(MULLW_OPCODE  | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); }
 28 +  inline void Assembler::mulhw(  Register d, Register a, Register b) { emit_int32(MULHW_OPCODE  | rt(d) | ra(a) | rb(b) | rc(0)); }
 29 +  inline void Assembler::mulhw_( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE  | rt(d) | ra(a) | rb(b) | rc(1)); }
 30 + +inline void Assembler::mulhwu( Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); }
 31 + +inline void Assembler::mulhwu_(Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); }
 32 +  inline void Assembler::mulhd(  Register d, Register a, Register b) { emit_int32(MULHD_OPCODE  | rt(d) | ra(a) | rb(b) | rc(0)); }
 33 +  inline void Assembler::mulhd_( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE  | rt(d) | ra(a) | rb(b) | rc(1)); }
 34 +  inline void Assembler::mulhdu( Register d, Register a, Register b) { emit_int32(MULHDU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); }
 35 + diff --git a/src/cpu/ppc/vm/c2_init_ppc.cpp b/src/cpu/ppc/vm/c2_init_ppc.cpp
 36 + --- openjdk/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp
 37 + +++ openjdk/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp
 38 + @@ -45,4 +45,10 @@
 39 +        FLAG_SET_ERGO(bool, InsertEndGroupPPC64, true);
 40 +      }
 41 +    }
 42 + +
 43 + +  if (OptimizeFill) {
 44 + +    warning("OptimizeFill is not supported on this CPU.");
 45 + +    FLAG_SET_DEFAULT(OptimizeFill, false);
 46 + +  }
 47 + +
 48 +  }
 49 + diff --git a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
 50 + --- openjdk/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
 51 + +++ openjdk/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
 52 + @@ -42,6 +42,8 @@
 53 +  #include "opto/runtime.hpp"
 54 +  #endif
 55 +  
 56 + +#include <alloca.h>
 57 + +
 58 +  #define __ masm->
 59 +  
 60 +  #ifdef PRODUCT
 61 + @@ -3269,3 +3271,245 @@
 62 +    return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_in_bytes/wordSize,
 63 +                                         oop_maps, true);
 64 +  }
 65 + +
 66 + +
 67 + +//------------------------------Montgomery multiplication------------------------
 68 + +//
 69 + +
 70 + +// Subtract 0:b from carry:a. Return carry.
 71 + +static unsigned long
 72 + +sub(unsigned long a[], unsigned long b[], unsigned long carry, long len) {
 73 + +  long i = 0;
 74 + +  unsigned long tmp, tmp2;
 75 + +  __asm__ __volatile__ (
 76 + +    "subfc  %[tmp], %[tmp], %[tmp]   \n" // pre-set CA
 77 + +    "mtctr  %[len]                   \n"
 78 + +    "0:                              \n"
 79 + +    "ldx    %[tmp], %[i], %[a]       \n"
 80 + +    "ldx    %[tmp2], %[i], %[b]      \n"
 81 + +    "subfe  %[tmp], %[tmp2], %[tmp]  \n" // subtract extended
 82 + +    "stdx   %[tmp], %[i], %[a]       \n"
 83 + +    "addi   %[i], %[i], 8            \n"
 84 + +    "bdnz   0b                       \n"
 85 + +    "addme  %[tmp], %[carry]         \n" // carry + CA - 1
 86 + +    : [i]"+b"(i), [tmp]"=&r"(tmp), [tmp2]"=&r"(tmp2)
 87 + +    : [a]"r"(a), [b]"r"(b), [carry]"r"(carry), [len]"r"(len)
 88 + +    : "ctr", "xer", "memory"
 89 + +  );
 90 + +  return tmp;
 91 + +}
 92 + +
 93 + +// Multiply (unsigned) Long A by Long B, accumulating the double-
 94 + +// length result into the accumulator formed of T0, T1, and T2.
 95 + +inline void MACC(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) {
 96 + +  unsigned long hi, lo;
 97 + +  __asm__ __volatile__ (
 98 + +    "mulld  %[lo], %[A], %[B]    \n"
 99 + +    "mulhdu %[hi], %[A], %[B]    \n"
100 + +    "addc   %[T0], %[T0], %[lo]  \n"
101 + +    "adde   %[T1], %[T1], %[hi]  \n"
102 + +    "addze  %[T2], %[T2]         \n"
103 + +    : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2)
104 + +    : [A]"r"(A), [B]"r"(B)
105 + +    : "xer"
106 + +  );
107 + +}
108 + +
109 + +// As above, but add twice the double-length result into the
110 + +// accumulator.
111 + +inline void MACC2(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) {
112 + +  unsigned long hi, lo;
113 + +  __asm__ __volatile__ (
114 + +    "mulld  %[lo], %[A], %[B]    \n"
115 + +    "mulhdu %[hi], %[A], %[B]    \n"
116 + +    "addc   %[T0], %[T0], %[lo]  \n"
117 + +    "adde   %[T1], %[T1], %[hi]  \n"
118 + +    "addze  %[T2], %[T2]         \n"
119 + +    "addc   %[T0], %[T0], %[lo]  \n"
120 + +    "adde   %[T1], %[T1], %[hi]  \n"
121 + +    "addze  %[T2], %[T2]         \n"
122 + +    : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2)
123 + +    : [A]"r"(A), [B]"r"(B)
124 + +    : "xer"
125 + +  );
126 + +}
127 + +
128 + +// Fast Montgomery multiplication. The derivation of the algorithm is
129 + +// in "A Cryptographic Library for the Motorola DSP56000,
130 + +// Dusse and Kaliski, Proc. EUROCRYPT 90, pp. 230-237".
131 + +static void
132 + +montgomery_multiply(unsigned long a[], unsigned long b[], unsigned long n[],
133 + +                    unsigned long m[], unsigned long inv, int len) {
134 + +  unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator
135 + +  int i;
136 + +
137 + +  assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply");
138 + +
139 + +  for (i = 0; i < len; i++) {
140 + +    int j;
141 + +    for (j = 0; j < i; j++) {
142 + +      MACC(a[j], b[i-j], t0, t1, t2);
143 + +      MACC(m[j], n[i-j], t0, t1, t2);
144 + +    }
145 + +    MACC(a[i], b[0], t0, t1, t2);
146 + +    m[i] = t0 * inv;
147 + +    MACC(m[i], n[0], t0, t1, t2);
148 + +
149 + +    assert(t0 == 0, "broken Montgomery multiply");
150 + +
151 + +    t0 = t1; t1 = t2; t2 = 0;
152 + +  }
153 + +
154 + +  for (i = len; i < 2*len; i++) {
155 + +    int j;
156 + +    for (j = i-len+1; j < len; j++) {
157 + +      MACC(a[j], b[i-j], t0, t1, t2);
158 + +      MACC(m[j], n[i-j], t0, t1, t2);
159 + +    }
160 + +    m[i-len] = t0;
161 + +    t0 = t1; t1 = t2; t2 = 0;
162 + +  }
163 + +
164 + +  while (t0) {
165 + +    t0 = sub(m, n, t0, len);
166 + +  }
167 + +}
168 + +
169 + +// Fast Montgomery squaring. This uses asymptotically 25% fewer
170 + +// multiplies so it should be up to 25% faster than Montgomery
171 + +// multiplication. However, its loop control is more complex and it
172 + +// may actually run slower on some machines.
173 + +static void
174 + +montgomery_square(unsigned long a[], unsigned long n[],
175 + +                  unsigned long m[], unsigned long inv, int len) {
176 + +  unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator
177 + +  int i;
178 + +
179 + +  assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply");
180 + +
181 + +  for (i = 0; i < len; i++) {
182 + +    int j;
183 + +    int end = (i+1)/2;
184 + +    for (j = 0; j < end; j++) {
185 + +      MACC2(a[j], a[i-j], t0, t1, t2);
186 + +      MACC(m[j], n[i-j], t0, t1, t2);
187 + +    }
188 + +    if ((i & 1) == 0) {
189 + +      MACC(a[j], a[j], t0, t1, t2);
190 + +    }
191 + +    for (; j < i; j++) {
192 + +      MACC(m[j], n[i-j], t0, t1, t2);
193 + +    }
194 + +    m[i] = t0 * inv;
195 + +    MACC(m[i], n[0], t0, t1, t2);
196 + +
197 + +    assert(t0 == 0, "broken Montgomery square");
198 + +
199 + +    t0 = t1; t1 = t2; t2 = 0;
200 + +  }
201 + +
202 + +  for (i = len; i < 2*len; i++) {
203 + +    int start = i-len+1;
204 + +    int end = start + (len - start)/2;
205 + +    int j;
206 + +    for (j = start; j < end; j++) {
207 + +      MACC2(a[j], a[i-j], t0, t1, t2);
208 + +      MACC(m[j], n[i-j], t0, t1, t2);
209 + +    }
210 + +    if ((i & 1) == 0) {
211 + +      MACC(a[j], a[j], t0, t1, t2);
212 + +    }
213 + +    for (; j < len; j++) {
214 + +      MACC(m[j], n[i-j], t0, t1, t2);
215 + +    }
216 + +    m[i-len] = t0;
217 + +    t0 = t1; t1 = t2; t2 = 0;
218 + +  }
219 + +
220 + +  while (t0) {
221 + +    t0 = sub(m, n, t0, len);
222 + +  }
223 + +}
224 + +
225 + +// The threshold at which squaring is advantageous was determined
226 + +// experimentally on an i7-3930K (Ivy Bridge) CPU @ 3.5GHz.
227 + +// Doesn't seem to be relevant for Power8 so we use the same value.
228 + +#define MONTGOMERY_SQUARING_THRESHOLD 64
229 + +
230 + +// Copy len longwords from s to d, word-swapping as we go. The
231 + +// destination array is reversed.
232 + +static void reverse_words(unsigned long *s, unsigned long *d, int len) {
233 + +  d += len;
234 + +  while(len-- > 0) {
235 + +    d--;
236 + +    unsigned long s_val = *s;
237 + +    // Swap words in a longword on little endian machines.
238 + +#ifdef VM_LITTLE_ENDIAN
239 + +     s_val = (s_val << 32) | (s_val >> 32);
240 + +#endif
241 + +    *d = s_val;
242 + +    s++;
243 + +  }
244 + +}
245 + +
246 + +void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints,
247 + +                                        jint len, jlong inv,
248 + +                                        jint *m_ints) {
249 + +  assert(len % 2 == 0, "array length in montgomery_multiply must be even");
250 + +  int longwords = len/2;
251 + +  assert(longwords > 0, "unsupported");
252 + +
253 + +  // Make very sure we don't use so much space that the stack might
254 + +  // overflow. 512 jints corresponds to an 16384-bit integer and
255 + +  // will use here a total of 8k bytes of stack space.
256 + +  int total_allocation = longwords * sizeof (unsigned long) * 4;
257 + +  guarantee(total_allocation <= 8192, "must be");
258 + +  unsigned long *scratch = (unsigned long *)alloca(total_allocation);
259 + +
260 + +  // Local scratch arrays
261 + +  unsigned long
262 + +    *a = scratch + 0 * longwords,
263 + +    *b = scratch + 1 * longwords,
264 + +    *n = scratch + 2 * longwords,
265 + +    *m = scratch + 3 * longwords;
266 + +
267 + +  reverse_words((unsigned long *)a_ints, a, longwords);
268 + +  reverse_words((unsigned long *)b_ints, b, longwords);
269 + +  reverse_words((unsigned long *)n_ints, n, longwords);
270 + +
271 + +  ::montgomery_multiply(a, b, n, m, (unsigned long)inv, longwords);
272 + +
273 + +  reverse_words(m, (unsigned long *)m_ints, longwords);
274 + +}
275 + +
276 + +void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints,
277 + +                                      jint len, jlong inv,
278 + +                                      jint *m_ints) {
279 + +  assert(len % 2 == 0, "array length in montgomery_square must be even");
280 + +  int longwords = len/2;
281 + +  assert(longwords > 0, "unsupported");
282 + +
283 + +  // Make very sure we don't use so much space that the stack might
284 + +  // overflow. 512 jints corresponds to an 16384-bit integer and
285 + +  // will use here a total of 6k bytes of stack space.
286 + +  int total_allocation = longwords * sizeof (unsigned long) * 3;
287 + +  guarantee(total_allocation <= 8192, "must be");
288 + +  unsigned long *scratch = (unsigned long *)alloca(total_allocation);
289 + +
290 + +  // Local scratch arrays
291 + +  unsigned long
292 + +    *a = scratch + 0 * longwords,
293 + +    *n = scratch + 1 * longwords,
294 + +    *m = scratch + 2 * longwords;
295 + +
296 + +  reverse_words((unsigned long *)a_ints, a, longwords);
297 + +  reverse_words((unsigned long *)n_ints, n, longwords);
298 + +
299 + +  if (len >= MONTGOMERY_SQUARING_THRESHOLD) {
300 + +    ::montgomery_square(a, n, m, (unsigned long)inv, longwords);
301 + +  } else {
302 + +    ::montgomery_multiply(a, a, n, m, (unsigned long)inv, longwords);
303 + +  }
304 + +
305 + +  reverse_words(m, (unsigned long *)m_ints, longwords);
306 + +}
307 + diff --git a/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/src/cpu/ppc/vm/stubGenerator_ppc.cpp
308 + --- openjdk/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
309 + +++ openjdk/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
310 + @@ -2094,6 +2094,14 @@
311 +      generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry,
312 +                                                         &StubRoutines::_safefetchN_fault_pc,
313 +                                                         &StubRoutines::_safefetchN_continuation_pc);
314 + +    if (UseMontgomeryMultiplyIntrinsic) {
315 + +      StubRoutines::_montgomeryMultiply
316 + +        = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply);
317 + +    }
318 + +    if (UseMontgomerySquareIntrinsic) {
319 + +      StubRoutines::_montgomerySquare
320 + +        = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
321 + +    }
322 +    }
323 +  
324 +   public:
325 + diff --git a/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
326 + --- openjdk/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
327 + +++ openjdk/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
328 + @@ -265,7 +265,7 @@
329 +        __ cmpdi(CCR0, Rmdo, 0);
330 +        __ beq(CCR0, no_mdo);
331 +  
332 + -      // Increment backedge counter in the MDO.
333 + +      // Increment invocation counter in the MDO.
334 +        const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
335 +        __ lwz(Rscratch2, mdo_bc_offs, Rmdo);
336 +        __ addi(Rscratch2, Rscratch2, increment);
337 + @@ -277,12 +277,12 @@
338 +      }
339 +  
340 +      // Increment counter in MethodCounters*.
341 + -    const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
342 + +    const int mo_ic_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
343 +      __ bind(no_mdo);
344 +      __ get_method_counters(R19_method, R3_counters, done);
345 + -    __ lwz(Rscratch2, mo_bc_offs, R3_counters);
346 + +    __ lwz(Rscratch2, mo_ic_offs, R3_counters);
347 +      __ addi(Rscratch2, Rscratch2, increment);
348 + -    __ stw(Rscratch2, mo_bc_offs, R3_counters);
349 + +    __ stw(Rscratch2, mo_ic_offs, R3_counters);
350 +      __ load_const_optimized(Rscratch1, mask, R0);
351 +      __ and_(Rscratch1, Rscratch2, Rscratch1);
352 +      __ beq(CCR0, *overflow);
353 + diff --git a/src/cpu/ppc/vm/vm_version_ppc.cpp b/src/cpu/ppc/vm/vm_version_ppc.cpp
354 + --- openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
355 + +++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
356 + @@ -177,6 +177,12 @@
357 +      FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
358 +    }
359 +  
360 + +  if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) {
361 + +    UseMontgomeryMultiplyIntrinsic = true;
362 + +  }
363 + +  if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
364 + +    UseMontgomerySquareIntrinsic = true;
365 + +  }
366 +  }
367 +  
368 +  void VM_Version::print_features() {
369 + diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp
370 + --- openjdk/hotspot/src/share/vm/opto/library_call.cpp
371 + +++ openjdk/hotspot/src/share/vm/opto/library_call.cpp
372 + @@ -6031,11 +6031,21 @@
373 +      Node* n_start = array_element_address(n, intcon(0), n_elem);
374 +      Node* m_start = array_element_address(m, intcon(0), m_elem);
375 +  
376 + -    Node* call = make_runtime_call(RC_LEAF,
377 + -                                   OptoRuntime::montgomeryMultiply_Type(),
378 + -                                   stubAddr, stubName, TypePtr::BOTTOM,
379 + -                                   a_start, b_start, n_start, len, inv, top(),
380 + -                                   m_start);
381 + +    Node* call = NULL;
382 + +    if (CCallingConventionRequiresIntsAsLongs) {
383 + +      Node* len_I2L = ConvI2L(len);
384 + +      call = make_runtime_call(RC_LEAF,
385 + +                               OptoRuntime::montgomeryMultiply_Type(),
386 + +                               stubAddr, stubName, TypePtr::BOTTOM,
387 + +                               a_start, b_start, n_start, len_I2L XTOP, inv,
388 + +                               top(), m_start);
389 + +    } else {
390 + +      call = make_runtime_call(RC_LEAF,
391 + +                               OptoRuntime::montgomeryMultiply_Type(),
392 + +                               stubAddr, stubName, TypePtr::BOTTOM,
393 + +                               a_start, b_start, n_start, len, inv, top(),
394 + +                               m_start);
395 + +    }
396 +      set_result(m);
397 +    }
398 +  
399 + @@ -6085,11 +6095,22 @@
400 +      Node* n_start = array_element_address(n, intcon(0), n_elem);
401 +      Node* m_start = array_element_address(m, intcon(0), m_elem);
402 +  
403 + -    Node* call = make_runtime_call(RC_LEAF,
404 + -                                   OptoRuntime::montgomerySquare_Type(),
405 + -                                   stubAddr, stubName, TypePtr::BOTTOM,
406 + -                                   a_start, n_start, len, inv, top(),
407 + -                                   m_start);
408 + +    Node* call = NULL;
409 + +    if (CCallingConventionRequiresIntsAsLongs) {
410 + +      Node* len_I2L = ConvI2L(len);
411 + +      call = make_runtime_call(RC_LEAF,
412 + +                               OptoRuntime::montgomerySquare_Type(),
413 + +                               stubAddr, stubName, TypePtr::BOTTOM,
414 + +                               a_start, n_start, len_I2L XTOP, inv, top(),
415 + +                               m_start);
416 + +    } else {
417 + +      call = make_runtime_call(RC_LEAF,
418 + +                               OptoRuntime::montgomerySquare_Type(),
419 + +                               stubAddr, stubName, TypePtr::BOTTOM,
420 + +                               a_start, n_start, len, inv, top(),
421 + +                               m_start);
422 + +    }
423 + +
424 +      set_result(m);
425 +    }
426 +  
427 + diff --git a/src/share/vm/opto/runtime.cpp b/src/share/vm/opto/runtime.cpp
428 + --- openjdk/hotspot/src/share/vm/opto/runtime.cpp
429 + +++ openjdk/hotspot/src/share/vm/opto/runtime.cpp
430 + @@ -1005,12 +1005,20 @@
431 +    // create input type (domain)
432 +    int num_args      = 7;
433 +    int argcnt = num_args;
434 + +  if (CCallingConventionRequiresIntsAsLongs) {
435 + +    argcnt++;                           // additional placeholder
436 + +  }
437 +    const Type** fields = TypeTuple::fields(argcnt);
438 +    int argp = TypeFunc::Parms;
439 +    fields[argp++] = TypePtr::NOTNULL;    // a
440 +    fields[argp++] = TypePtr::NOTNULL;    // b
441 +    fields[argp++] = TypePtr::NOTNULL;    // n
442 + -  fields[argp++] = TypeInt::INT;        // len
443 + +  if (CCallingConventionRequiresIntsAsLongs) {
444 + +    fields[argp++] = TypeLong::LONG;    // len
445 + +    fields[argp++] = TypeLong::HALF;    // placeholder
446 + +  } else {
447 + +    fields[argp++] = TypeInt::INT;      // len
448 + +  }
449 +    fields[argp++] = TypeLong::LONG;      // inv
450 +    fields[argp++] = Type::HALF;
451 +    fields[argp++] = TypePtr::NOTNULL;    // result
452 + @@ -1029,11 +1037,19 @@
453 +    // create input type (domain)
454 +    int num_args      = 6;
455 +    int argcnt = num_args;
456 + +  if (CCallingConventionRequiresIntsAsLongs) {
457 + +    argcnt++;                           // additional placeholder
458 + +  }
459 +    const Type** fields = TypeTuple::fields(argcnt);
460 +    int argp = TypeFunc::Parms;
461 +    fields[argp++] = TypePtr::NOTNULL;    // a
462 +    fields[argp++] = TypePtr::NOTNULL;    // n
463 + -  fields[argp++] = TypeInt::INT;        // len
464 + +  if (CCallingConventionRequiresIntsAsLongs) {
465 + +    fields[argp++] = TypeLong::LONG;    // len
466 + +    fields[argp++] = TypeLong::HALF;    // placeholder
467 + +  } else {
468 + +    fields[argp++] = TypeInt::INT;      // len
469 + +  }
470 +    fields[argp++] = TypeLong::LONG;      // inv
471 +    fields[argp++] = Type::HALF;
472 +    fields[argp++] = TypePtr::NOTNULL;    // result
 1 @@ -0,0 +1,31 @@
 2 + # HG changeset patch
 3 + # User goetz
 4 + # Date 1477563748 -7200
 5 + #      Thu Oct 27 12:22:28 2016 +0200
 6 + # Node ID 9b9d9e11c04d5e5f64829d34752e5c94b1c7d911
 7 + # Parent  92f0dbe76a13992cc27188e0f68e4b1771c7004a
 8 + 8168318, PR3466, RH1498320: PPC64: Use cmpldi instead of li/cmpld
 9 + Reviewed-by: goetz
10 + Contributed-by: igor.nunes@eldorado.org.br
11 + 
12 + diff --git a/src/cpu/ppc/vm/ppc.ad b/src/cpu/ppc/vm/ppc.ad
13 + --- openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
14 + +++ openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
15 + @@ -10571,6 +10571,17 @@
16 +    ins_pipe(pipe_class_compare);
17 +  %}
18 +  
19 + +instruct cmpP_reg_null(flagsReg crx, iRegP_N2P src1, immP_0or1 src2) %{
20 + +  match(Set crx (CmpP src1 src2));
21 + +  format %{ "CMPLDI   $crx, $src1, $src2 \t// ptr" %}
22 + +  size(4);
23 + +  ins_encode %{
24 + +    // TODO: PPC port $archOpcode(ppc64Opcode_cmpl);
25 + +    __ cmpldi($crx$$CondRegister, $src1$$Register, (int)((short)($src2$$constant & 0xFFFF)));
26 + +  %}
27 + +  ins_pipe(pipe_class_compare);
28 + +%}
29 + +
30 +  // Used in postalloc expand.
31 +  instruct cmpP_reg_imm16(flagsReg crx, iRegPsrc src1, immL16 src2) %{
32 +    // This match rule prevents reordering of node before a safepoint.
 1 @@ -0,0 +1,33 @@
 2 + # HG changeset patch
 3 + # User mdoerr
 4 + # Date 1480079712 7200
 5 + #      Fri Nov 25 11:15:12 2016 -0200
 6 + # Node ID 3c499a0ba92b1affb3f473c6502e374f4785aba9
 7 + # Parent  9b9d9e11c04d5e5f64829d34752e5c94b1c7d911
 8 + 8170328, PR3466, RH1498321: PPC64: Use andis instead of lis/and
 9 + Reviewed-by: goetz, mdoerr
10 + Contributed-by: Igor Nunes <igor.nunes@eldorado.org.br>
11 + 
12 + diff --git a/src/cpu/ppc/vm/ppc.ad b/src/cpu/ppc/vm/ppc.ad
13 + --- openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
14 + +++ openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
15 + @@ -8889,6 +8889,19 @@
16 +    ins_pipe(pipe_class_default);
17 +  %}
18 +  
19 + +// Left shifted Immediate And
20 + +instruct andI_reg_immIhi16(iRegIdst dst, iRegIsrc src1, immIhi16  src2, flagsRegCR0 cr0) %{
21 + +  match(Set dst (AndI src1 src2));
22 + +  effect(KILL cr0);
23 + +  format %{ "ANDIS   $dst, $src1, $src2.hi" %}
24 + +  size(4);
25 + +  ins_encode %{
26 + +    // TODO: PPC port $archOpcode(ppc64Opcode_andis_);
27 + +    __ andis_($dst$$Register, $src1$$Register, (int)((unsigned short)(($src2$$constant & 0xFFFF0000) >> 16)));
28 + +  %}
29 + +  ins_pipe(pipe_class_default);
30 + +%}
31 + +
32 +  // Immediate And
33 +  instruct andI_reg_uimm16(iRegIdst dst, iRegIsrc src1, uimmI16 src2, flagsRegCR0 cr0) %{
34 +    match(Set dst (AndI src1 src2));
  1 @@ -1,135 +0,0 @@
  2 - # HG changeset patch
  3 - # User dholmes
  4 - # Date 1493428477 14400
  5 - #      Fri Apr 28 21:14:37 2017 -0400
  6 - # Node ID 2fee74c5547889d9698a2636e0a5170f9e66fb9c
  7 - # Parent  13a04e8df5a3af73794146b930b32556c7cbc5b0
  8 - 8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set
  9 - Reviewed-by: kbarrett, stefank
 10 - 
 11 - diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
 12 - --- openjdk/hotspot/src/share/vm/runtime/arguments.cpp
 13 - +++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
 14 - @@ -3193,8 +3193,6 @@
 15 -  
 16 -        // Enable parallel GC and adaptive generation sizing
 17 -        FLAG_SET_CMDLINE(bool, UseParallelGC, true);
 18 - -      FLAG_SET_DEFAULT(ParallelGCThreads,
 19 - -                       Abstract_VM_Version::parallel_worker_threads());
 20 -  
 21 -        // Encourage steady state memory management
 22 -        FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100);
 23 - diff --git a/test/TEST.groups b/test/TEST.groups
 24 - --- openjdk/hotspot/test/TEST.groups
 25 - +++ openjdk/hotspot/test/TEST.groups
 26 - @@ -1,5 +1,5 @@
 27 -  #
 28 - -# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
 29 - +# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 30 -  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 31 -  #
 32 -  # This code is free software; you can redistribute it and/or modify it
 33 - @@ -164,6 +164,7 @@
 34 -    gc/TestGCLogRotationViaJcmd.java \
 35 -    gc/g1/TestHumongousAllocInitialMark.java \
 36 -    gc/g1/TestHumongousShrinkHeap.java \
 37 - +  gc/arguments/TestAggressiveHeap.java \
 38 -    gc/arguments/TestG1HeapRegionSize.java \
 39 -    gc/metaspace/TestMetaspaceMemoryPool.java \
 40 -    gc/arguments/TestDynMinHeapFreeRatio.java \
 41 - diff --git a/test/gc/arguments/TestAggressiveHeap.java b/test/gc/arguments/TestAggressiveHeap.java
 42 - new file mode 100644
 43 - --- /dev/null
 44 - +++ openjdk/hotspot/test/gc/arguments/TestAggressiveHeap.java
 45 - @@ -0,0 +1,91 @@
 46 - +/*
 47 - + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
 48 - + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 49 - + *
 50 - + * This code is free software; you can redistribute it and/or modify it
 51 - + * under the terms of the GNU General Public License version 2 only, as
 52 - + * published by the Free Software Foundation.
 53 - + *
 54 - + * This code is distributed in the hope that it will be useful, but WITHOUT
 55 - + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 56 - + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 57 - + * version 2 for more details (a copy is included in the LICENSE file that
 58 - + * accompanied this code).
 59 - + *
 60 - + * You should have received a copy of the GNU General Public License version
 61 - + * 2 along with this work; if not, write to the Free Software Foundation,
 62 - + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 63 - + *
 64 - + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 65 - + * or visit www.oracle.com if you need additional information or have any
 66 - + * questions.
 67 - + */
 68 - +
 69 - +/*
 70 - + * @test TestAggressiveHeap
 71 - + * @key gc
 72 - + * @bug 8179084
 73 - + * @summary Test argument processing for -XX:+AggressiveHeap.
 74 - + * @library /testlibrary
 75 - + * @run driver TestAggressiveHeap
 76 - + */
 77 - +
 78 - +import java.lang.management.ManagementFactory;
 79 - +import javax.management.MBeanServer;
 80 - +import javax.management.ObjectName;
 81 - +
 82 - +import com.oracle.java.testlibrary.OutputAnalyzer;
 83 - +import com.oracle.java.testlibrary.ProcessTools;
 84 - +
 85 - +public class TestAggressiveHeap {
 86 - +
 87 - +    public static void main(String args[]) throws Exception {
 88 - +        if (canUseAggressiveHeapOption()) {
 89 - +            testFlag();
 90 - +        }
 91 - +    }
 92 - +
 93 - +    // Note: Not a normal boolean flag; -XX:-AggressiveHeap is invalid.
 94 - +    private static final String option = "-XX:+AggressiveHeap";
 95 - +
 96 - +    // Option requires at least 256M, else error during option processing.
 97 - +    private static final long minMemory = 256 * 1024 * 1024;
 98 - +
 99 - +    // bool UseParallelGC := true {product}
100 - +    private static final String parallelGCPattern =
101 - +        " *bool +UseParallelGC *:= *true +\\{product\\}";
102 - +
103 - +    private static void testFlag() throws Exception {
104 - +        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
105 - +            option, "-XX:+PrintFlagsFinal", "-version");
106 - +
107 - +        OutputAnalyzer output = new OutputAnalyzer(pb.start());
108 - +
109 - +        output.shouldHaveExitValue(0);
110 - +
111 - +        String value = output.firstMatch(parallelGCPattern);
112 - +        if (value == null) {
113 - +            throw new RuntimeException(
114 - +                option + " didn't set UseParallelGC");
115 - +        }
116 - +    }
117 - +
118 - +    private static boolean haveRequiredMemory() throws Exception {
119 - +        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
120 - +        ObjectName os = new ObjectName("java.lang", "type", "OperatingSystem");
121 - +        Object attr = server.getAttribute(os, "TotalPhysicalMemorySize");
122 - +        String value = attr.toString();
123 - +        long memory = Long.parseLong(value);
124 - +        return memory >= minMemory;
125 - +    }
126 - +
127 - +    private static boolean canUseAggressiveHeapOption() throws Exception {
128 - +        if (!haveRequiredMemory()) {
129 - +            System.out.println(
130 - +                "Skipping test of " + option + " : insufficient memory");
131 - +            return false;
132 - +        }
133 - +        return true;
134 - +    }
135 - +}
136 - +
 1 @@ -0,0 +1,66 @@
 2 + # HG changeset patch
 3 + # User mdoerr
 4 + # Date 1507752266 -3600
 5 + #      Wed Oct 11 21:04:26 2017 +0100
 6 + # Node ID 5c00d5cd7677aec3549afe02e4f9de8dc7b20bef
 7 + # Parent  3c499a0ba92b1affb3f473c6502e374f4785aba9
 8 + 8181810, PR3466, RH1498319: PPC64: Leverage extrdi for bitfield extract
 9 + Reviewed-by: mdoerr, simonis
10 + Contributed-by: Matthew Brandyberry <mbrandy@linux.vnet.ibm.com>
11 + 
12 + diff --git a/src/cpu/ppc/vm/ppc.ad b/src/cpu/ppc/vm/ppc.ad
13 + --- openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
14 + +++ openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
15 + @@ -1,6 +1,6 @@
16 +  //
17 +  // Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
18 + -// Copyright 2012, 2014 SAP AG. All rights reserved.
19 + +// Copyright (c) 2012, 2017 SAP SE. All rights reserved.
20 +  // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
21 +  //
22 +  // This code is free software; you can redistribute it and/or modify it
23 + @@ -8610,6 +8610,44 @@
24 +    ins_pipe(pipe_class_default);
25 +  %}
26 +  
27 + +// Bitfield Extract: URShiftI + AndI
28 + +instruct andI_urShiftI_regI_immI_immIpow2minus1(iRegIdst dst, iRegIsrc src1, immI src2, immIpow2minus1 src3) %{
29 + +  match(Set dst (AndI (URShiftI src1 src2) src3));
30 + +
31 + +  format %{ "EXTRDI  $dst, $src1, shift=$src2, mask=$src3 \t// int bitfield extract" %}
32 + +  size(4);
33 + +  ins_encode %{
34 + +    // TODO: PPC port $archOpcode(ppc64Opcode_rldicl);
35 + +    int rshift = ($src2$$constant) & 0x1f;
36 + +    int length = log2_long(((jlong) $src3$$constant) + 1);
37 + +    if (rshift + length > 32) {
38 + +      // if necessary, adjust mask to omit rotated bits.
39 + +      length = 32 - rshift;
40 + +    }
41 + +    __ extrdi($dst$$Register, $src1$$Register, length, 64 - (rshift + length));
42 + +  %}
43 + +  ins_pipe(pipe_class_default);
44 + +%}
45 + +
46 + +// Bitfield Extract: URShiftL + AndL
47 + +instruct andL_urShiftL_regL_immI_immLpow2minus1(iRegLdst dst, iRegLsrc src1, immI src2, immLpow2minus1 src3) %{
48 + +  match(Set dst (AndL (URShiftL src1 src2) src3));
49 + +
50 + +  format %{ "EXTRDI  $dst, $src1, shift=$src2, mask=$src3 \t// long bitfield extract" %}
51 + +  size(4);
52 + +  ins_encode %{
53 + +    // TODO: PPC port $archOpcode(ppc64Opcode_rldicl);
54 + +    int rshift  = ($src2$$constant) & 0x3f;
55 + +    int length = log2_long(((jlong) $src3$$constant) + 1);
56 + +    if (rshift + length > 64) {
57 + +      // if necessary, adjust mask to omit rotated bits.
58 + +      length = 64 - rshift;
59 + +    }
60 + +    __ extrdi($dst$$Register, $src1$$Register, length, 64 - (rshift + length));
61 + +  %}
62 + +  ins_pipe(pipe_class_default);
63 + +%}
64 + +
65 +  instruct sxtI_reg(iRegIdst dst, iRegIsrc src) %{
66 +    match(Set dst (ConvL2I (ConvI2L src)));
67 +  
 1 @@ -0,0 +1,21 @@
 2 + # HG changeset patch
 3 + # User neugens
 4 + # Date 1507735508 -3600
 5 + #      Wed Oct 11 16:25:08 2017 +0100
 6 + # Node ID 5b91bf11d0f41a6124ffb0fcd8870507b50bd734
 7 + # Parent  7b1a2f967cd8e950fe7dc47d716af13d36239a38
 8 + 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present
 9 + Summary: Handle CFF fonts
10 + Reviewed-by: andrew, prr
11 + 
12 + diff --git a/src/solaris/native/sun/awt/fontpath.c b/src/solaris/native/sun/awt/fontpath.c
13 + --- openjdk/jdk/src/solaris/native/sun/awt/fontpath.c
14 + +++ openjdk/jdk/src/solaris/native/sun/awt/fontpath.c
15 + @@ -1233,6 +1233,7 @@
16 +                  && (strcmp((char*)fontformat, "TrueType") != 0)
17 +  #if defined(__linux__) || defined(_AIX)
18 +                  && (strcmp((char*)fontformat, "Type 1") != 0)
19 + +                && (strcmp((char*)fontformat, "CFF") != 0)
20 +  #endif
21 +               ) {
22 +                  continue;
 1 @@ -1,11 +0,0 @@
 2 - diff -r e96c4a40fdf9 src/solaris/native/sun/awt/fontpath.c
 3 - --- openjdk/jdk/src/solaris/native/sun/awt/fontpath.c»       Wed Aug 23 14:14:49 2017 -0400
 4 - +++ openjdk/jdk/src/solaris/native/sun/awt/fontpath.c»       Thu Aug 24 12:14:41 2017 -0400
 5 - @@ -1239,6 +1239,7 @@
 6 -                  && (strcmp((char*)fontformat, "TrueType") != 0)
 7 -  #if defined(__linux__) || defined(_AIX)
 8 -                  && (strcmp((char*)fontformat, "Type 1") != 0)
 9 - +                && (strcmp((char*)fontformat, "CFF") != 0)
10 -  #endif
11 -               ) {
12 -                  continue;
1 @@ -1,6 +1,6 @@
2   #!/bin/sh
3   
4 - ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib-*
5 + ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib
6   JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg
7   GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib
8   PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng
 1 @@ -1,6 +1,6 @@
 2 - diff -r 59d5dc6a0d95 common/autoconf/hotspot-spec.gmk.in
 3 - --- openjdk///common/autoconf/hotspot-spec.gmk.in»       Wed May 25 13:42:38 2016 +0100
 4 - +++ openjdk///common/autoconf/hotspot-spec.gmk.in»       Thu May 26 04:43:57 2016 +0100
 5 + diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
 6 + --- openjdk///common/autoconf/hotspot-spec.gmk.in
 7 + +++ openjdk///common/autoconf/hotspot-spec.gmk.in
 8   @@ -71,6 +71,10 @@
 9    LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
10    # Set the cpu architecture
11 @@ -12,9 +12,9 @@
12    # Legacy setting for building for a 64 bit machine.
13    # If yes then this expands to _LP64:=1
14    @LP64@
15 - diff -r 59d5dc6a0d95 common/autoconf/jdk-options.m4
16 - --- openjdk///common/autoconf/jdk-options.m4»       Wed May 25 13:42:38 2016 +0100
17 - +++ openjdk///common/autoconf/jdk-options.m4»       Thu May 26 04:43:57 2016 +0100
18 + diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
19 + --- openjdk///common/autoconf/jdk-options.m4
20 + +++ openjdk///common/autoconf/jdk-options.m4
21   @@ -158,7 +158,7 @@
22      if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
23        INCLUDE_SA=false
24 @@ -24,9 +24,9 @@
25        INCLUDE_SA=false
26      fi
27      if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
28 - diff -r 59d5dc6a0d95 common/autoconf/platform.m4
29 - --- openjdk///common/autoconf/platform.m4»       Wed May 25 13:42:38 2016 +0100
30 - +++ openjdk///common/autoconf/platform.m4»       Thu May 26 04:43:57 2016 +0100
31 + diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
32 + --- openjdk///common/autoconf/platform.m4
33 + +++ openjdk///common/autoconf/platform.m4
34   @@ -67,7 +67,7 @@
35          VAR_CPU_ENDIAN=big
36          ;;
37 @@ -36,16 +36,16 @@
38          VAR_CPU_ARCH=ppc
39          VAR_CPU_BITS=64
40          VAR_CPU_ENDIAN=little
41 - diff -r 59d5dc6a0d95 common/autoconf/toolchain.m4
42 - --- openjdk///common/autoconf/toolchain.m4»       Wed May 25 13:42:38 2016 +0100
43 - +++ openjdk///common/autoconf/toolchain.m4»       Thu May 26 04:43:57 2016 +0100
44 - @@ -1056,6 +1056,9 @@
45 + diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
46 + --- openjdk///common/autoconf/toolchain.m4
47 + +++ openjdk///common/autoconf/toolchain.m4
48 + @@ -1123,6 +1123,9 @@
49      else
50 -      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
51 +      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN"
52      fi
53   +  if test "x$OPENJDK_TARGET_CPU" = xppc64le; then
54 - +    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DABI_ELFv2"
55 + +    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DABI_ELFv2"
56   +  fi
57      if test "x$OPENJDK_TARGET_OS" = xlinux; then
58 -      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX"
59 +      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DLINUX"
60      fi
  1 @@ -204,7 +204,7 @@
  2   # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there.
  3   %global project         aarch64-port
  4   %global repo            jdk8u
  5 - %global revision        aarch64-jdk8u144-b01
  6 + %global revision        aarch64-jdk8u151-b12
  7   # eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60  (dont forget spec escape % by %%)
  8   %global whole_update    %(VERSION=%{revision}; echo ${VERSION%%-*})
  9   # eg  jdk8u60 -> 60 or aarch64-jdk8u60 -> 60
 10 @@ -554,8 +554,10 @@
 11   %{_jvmdir}/%{jredir -- %{?1}}/bin/servertool
 12   %{_jvmdir}/%{jredir -- %{?1}}/bin/tnameserv
 13   %{_jvmdir}/%{jredir -- %{?1}}/bin/unpack200
 14 - %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/US_export_policy.jar
 15 - %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/local_policy.jar
 16 + %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/unlimited/US_export_policy.jar
 17 + %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/unlimited/local_policy.jar
 18 + %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/limited/US_export_policy.jar
 19 + %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/limited/local_policy.jar
 20   %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/java.policy
 21   %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/java.security
 22   %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/blacklisted.certs
 23 @@ -815,7 +817,7 @@
 24   Requires: nss%{?_isa} %{NSS_BUILDTIME_VERSION}
 25   Requires: nss-softokn%{?_isa} %{NSSSOFTOKN_BUILDTIME_VERSION}
 26   # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum eforce it, not rpm transaction and so no configs are persisted when pure rpm -u is run. I t may be consiedered as regression
 27 - Requires:»       copy-jdk-configs >= 2.2
 28 + Requires:»       copy-jdk-configs >= 3.3
 29   OrderWithRequires: copy-jdk-configs
 30   # Post requires alternatives to install tool alternatives.
 31   Requires(post):   %{_sbindir}/alternatives
 32 @@ -933,7 +935,7 @@
 33   
 34   Name:    java-%{javaver}-%{origin}
 35   Version: %{javaver}.%{updatever}
 36 - Release: 7.%{buildver}%{?dist}
 37 + Release: 1.%{buildver}%{?dist}
 38   # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
 39   # and this change was brought into RHEL-4.  java-1.5.0-ibm packages
 40   # also included the epoch in their virtual provides.  This created a
 41 @@ -959,7 +961,7 @@
 42   Source0: %{project}-%{repo}-%{revision}.tar.xz
 43   
 44   # Shenandoah HotSpot
 45 - Source1: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u144-b02-shenandoah-merge-2017-10-02.tar.xz
 46 + Source1: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u151-b12.tar.xz
 47   
 48   # Custom README for -src subpackage
 49   Source2:  README.src
 50 @@ -968,7 +970,7 @@
 51   # They are based on code contained in the IcedTea7 project.
 52   
 53   # Systemtap tapsets. Zipped up to keep it small.
 54 - Source8: systemtap-tapset-3.4.0pre01.tar.xz
 55 + Source8: systemtap-tapset-3.6.0pre02.tar.xz
 56   
 57   # Desktop files. Adapated from IcedTea.
 58   Source9: jconsole.desktop.in
 59 @@ -1015,12 +1017,14 @@
 60   # PR2815: Race condition in SunEC provider with system NSS
 61   # PR2899: Don't use WithSeed versions of NSS functions as they don't fully process the seed
 62   # PR2934: SunEC provider throwing KeyException with current NSS
 63 + # PR3479, RH1486025: ECC and NSS JVM crash
 64   Patch513: pr1983-jdk.patch
 65   Patch514: pr1983-root.patch
 66   Patch515: pr2127.patch
 67   Patch516: pr2815.patch
 68   Patch517: pr2899.patch
 69   Patch518: pr2934.patch
 70 + Patch519: pr3479-rh1486025.patch
 71   # S8150954, RH1176206, PR2866: Taking screenshots on x11 composite desktop produces wrong result
 72   # In progress: http://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010742.html
 73   Patch508: rh1176206-jdk.patch
 74 @@ -1034,6 +1038,8 @@
 75   Patch205: dont-add-unnecessary-debug-links.patch
 76   # Enable debug information for assembly code files
 77   Patch206: hotspot-assembler-debuginfo.patch
 78 + # 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present
 79 + Patch560: 8188030-pr3459-rh1484079.patch
 80   
 81   # Arch-specific upstreamable patches
 82   # PR2415: JVM -Xmx requirement is too high on s390
 83 @@ -1066,10 +1072,10 @@
 84   Patch526: 6260348-pr3066.patch
 85   # 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property"
 86   Patch538: 8061305-pr3335-rh1423421.patch
 87 - # 8181055, PR3394, RH1448880: PPC64: "mbind: Invalid argument" still seen after 8175813
 88 - Patch551: 8181055-pr3394-rh1448880.patch
 89 - # 8181419, PR3413, RH1463144: Race in jdwp invoker handling may lead to crashes or invalid results
 90 - Patch553: 8181419-pr3413-rh1463144.patch
 91 + 
 92 + # Patches upstream and appearing in 8u151
 93 + # 8075484, PR3473, RH1490713: SocketInputStream.socketRead0 can hang even with soTimeout set
 94 + Patch561: 8075484-pr3473-rh1490713.patch
 95   
 96   # Patches upstream and appearing in 8u152
 97   # 8153711, PR3313, RH1284948: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command
 98 @@ -1080,33 +1086,44 @@
 99   Patch547: 8173941-pr3326.patch
100   # 8175813, PR3394, RH1448880: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used
101   Patch550: 8175813-pr3394-rh1448880.patch
102 - # 8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set
103 - Patch552: 8179084-pr3409-rh1455694.patch
104   # 8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect
105   Patch554: 8175887-pr3415.patch
106   
107   # Patches upstream and appearing in 8u161
108   # 8164293, PR3412, RH1459641: HotSpot leaking memory in long-running requests
109   Patch555: 8164293-pr3412-rh1459641.patch
110 +  
111 + # Patches upstream and appearing in 8u162
112 + # 8181055, PR3394, RH1448880: PPC64: "mbind: Invalid argument" still seen after 8175813
113 + Patch551: 8181055-pr3394-rh1448880.patch
114 + # 8181419, PR3413, RH1463144: Race in jdwp invoker handling may lead to crashes or invalid results
115 + Patch553: 8181419-pr3413-rh1463144.patch
116 + # 8145913, PR3466, RH1498309: PPC64: add Montgomery multiply intrinsic
117 + Patch556: 8145913-pr3466-rh1498309.patch
118 + # 8168318, PR3466, RH1498320: PPC64: Use cmpldi instead of li/cmpld
119 + Patch557: 8168318-pr3466-rh1498320.patch
120 + # 8170328, PR3466, RH1498321: PPC64: Use andis instead of lis/and
121 + Patch558: 8170328-pr3466-rh1498321.patch
122 + # 8181810, PR3466, RH1498319: PPC64: Leverage extrdi for bitfield extract
123 + Patch559: 8181810-pr3466-rh1498319.patch
124   
125   # Patches ineligible for 8u
126   # 8043805: Allow using a system-installed libjpeg
127   Patch201: system-libjpeg.patch
128   # custom securities
129   Patch207: PR3183.patch
130 + # ustreamed aarch64 fixes
131   Patch208: aarch64BuildFailure.patch
132 + Patch209: 8035496-hotspot.patch
133 + Patch210: suse_linuxfilestore.patch
134   
135   # Local fixes
136   # PR1834, RH1022017: Reduce curves reported by SSL to those in NSS
137   Patch525: pr1834-rh1022017.patch
138 - # RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read()
139 - Patch533: rh1367357.patch
140   # Turn on AssumeMP by default on RHEL systems
141   Patch534: always_assumemp.patch
142   # PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts)
143   Patch539: pr2888.patch
144 - # test patch for rhbz#1484079
145 - Patch540: bug1484079.patch
146   
147   # Non-OpenJDK fixes
148   Patch1000: enableCommentedOutSystemNss.patch
149 @@ -1447,6 +1464,8 @@
150   %patch206
151   %patch207
152   %patch208
153 + %patch209
154 + %patch210
155   
156   %patch1
157   %patch3
158 @@ -1481,6 +1500,7 @@
159   %patch516
160   %patch517
161   %patch518
162 + %patch519
163   %patch400
164   %patch523
165   %patch526
166 @@ -1491,15 +1511,20 @@
167   %patch547
168   %patch550
169   %patch551
170 - %patch552
171   %patch553
172   %patch555
173 + %patch560
174 + %patch561
175 + 
176 + # PPC64 updates
177 + %patch556
178 + %patch557
179 + %patch558
180 + %patch559
181   
182   # RPM-only fixes
183   %patch525
184 - %patch533
185   %patch539
186 - %patch540
187   
188   # RHEL-only patches
189   %if ! 0%{?fedora} && 0%{?rhel} <= 7
190 @@ -2129,6 +2154,18 @@
191   %endif
192   
193   %changelog
194 + * Wed Oct 25 2017 jvanek <jvanek@redhat.com> - 1:1.8.0.151-1.b12
195 + - updated to aarch64-jdk8u151-b12 (from aarch64-port/jdk8u)
196 + - updated to aarch64-shenandoah-jdk8u151-b12 (from aarch64-port/jdk8u-shenandoah) of hotspot
197 + - used aarch64-port-jdk8u-aarch64-jdk8u151-b12.tar.xz as new sources
198 + - used aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u151-b12.tar.xz as new sources for hotspot
199 + - tapset updated to 3.6pre02
200 + - policies adapted to new limited/unlimited schmea
201 + - above acomapnied by c-j-c 3.3
202 + - alligned patches and added PPC ones (thanx to gnu_andrew)
203 + - added patch209: 8035496-hotspot.patch
204 + - added patch210: suse_linuxfilestore.patch
205 + 
206   * Wed Oct 04 2017 jvanek <jvanek@redhat.com> - 1:1.8.0.144-7.b01
207   - updated to aarch64-shenandoah-jdk8u144-b02-shenandoah-merge-2017-10-02 (from aarch64-port/jdk8u-shenandoah) of hotspot
208   - used aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u144-b02-shenandoah-merge-2017-10-02.tar.xz as new sources for hotspot
 1 @@ -7,16 +7,16 @@
 2   8031668, PR2842: TOOLCHAIN_FIND_COMPILER unexpectedly resolves symbolic links
 3   Reviewed-by: erikj, ihse
 4   
 5 - diff -r f0635543beb3 -r 842cc183c9f6 common/autoconf/toolchain.m4
 6 - --- openjdk/./common/autoconf/toolchain.m4»       Wed Jan 27 02:50:07 2016 +0000
 7 - +++ openjdk/./common/autoconf/toolchain.m4»       Tue Jan 14 10:25:22 2014 -0800
 8 - @@ -188,8 +188,8 @@
 9 + diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
10 + --- openjdk///common/autoconf/toolchain.m4
11 + +++ openjdk///common/autoconf/toolchain.m4
12 + @@ -230,8 +230,8 @@
13        $1="$PROPER_COMPILER_$1"
14      else
15        AC_MSG_RESULT([no, keeping $1])
16   -    $1="$TEST_COMPILER"
17      fi
18   +
19 -    TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
20 +    TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME])
21    ])
22    
 1 @@ -7,10 +7,10 @@
 2   8148351, PR2842: Only display resolved symlink for compiler, do not change path
 3   Reviewed-by: erikj
 4   
 5 - diff -r 5096b6468914 common/autoconf/toolchain.m4
 6 - --- openjdk/./common/autoconf/toolchain.m4»       Tue Jan 14 10:25:22 2014 -0800
 7 - +++ openjdk/./common/autoconf/toolchain.m4»       Fri Feb 05 20:02:15 2016 +0000
 8 - @@ -147,38 +147,22 @@
 9 + diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
10 + --- openjdk///common/autoconf/toolchain.m4
11 + +++ openjdk///common/autoconf/toolchain.m4
12 + @@ -198,38 +198,22 @@
13      fi
14      BASIC_FIXUP_EXECUTABLE($1)
15      TEST_COMPILER="[$]$1"
16 @@ -62,4 +62,4 @@
17   +    fi
18      fi
19    
20 -    TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
21 +    TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME])
 1 @@ -7,9 +7,9 @@
 2   PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings
 3   Summary: Add -systemlineendings option to keytool to allow system line endings to be used again.
 4   
 5 - diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/pkcs10/PKCS10.java
 6 - --- openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java»       Tue Dec 29 10:40:43 2015 -0500
 7 - +++ openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java»       Fri May 27 03:28:35 2016 +0100
 8 + diff --git a/src/share/classes/sun/security/pkcs10/PKCS10.java b/src/share/classes/sun/security/pkcs10/PKCS10.java
 9 + --- openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java
10 + +++ openjdk/jdk/src/share/classes/sun/security/pkcs10/PKCS10.java
11   @@ -30,6 +30,7 @@
12    import java.io.IOException;
13    import java.math.BigInteger;
14 @@ -41,7 +41,7 @@
15        /**
16         * Constructs an unsigned PKCS #10 certificate request.  Before this
17         * request may be used, it must be encoded and signed.  Then it
18 - @@ -286,13 +296,39 @@
19 + @@ -293,13 +303,39 @@
20         */
21        public void print(PrintStream out)
22        throws IOException, SignatureException {
23 @@ -83,10 +83,10 @@
24            out.println("-----END NEW CERTIFICATE REQUEST-----");
25        }
26    
27 - diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytool/Main.java
28 - --- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java»       Tue Dec 29 10:40:43 2015 -0500
29 - +++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java»       Fri May 27 03:28:35 2016 +0100
30 - @@ -117,6 +117,7 @@
31 + diff --git a/src/share/classes/sun/security/tools/keytool/Main.java b/src/share/classes/sun/security/tools/keytool/Main.java
32 + --- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java
33 + +++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Main.java
34 + @@ -124,6 +124,7 @@
35        private String infilename = null;
36        private String outfilename = null;
37        private String srcksfname = null;
38 @@ -94,7 +94,7 @@
39    
40        // User-specified providers are added before any command is called.
41        // However, they are not removed before the end of the main() method.
42 - @@ -163,7 +164,7 @@
43 + @@ -186,7 +187,7 @@
44            CERTREQ("Generates.a.certificate.request",
45                ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME,
46                STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
47 @@ -103,7 +103,7 @@
48            CHANGEALIAS("Changes.an.entry.s.alias",
49                ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS,
50                STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
51 - @@ -296,6 +297,7 @@
52 + @@ -319,6 +320,7 @@
53            STARTDATE("startdate", "<startdate>", "certificate.validity.start.date.time"),
54            STOREPASS("storepass", "<arg>", "keystore.password"),
55            STORETYPE("storetype", "<storetype>", "keystore.type"),
56 @@ -111,7 +111,7 @@
57            TRUSTCACERTS("trustcacerts", null, "trust.certificates.from.cacerts"),
58            V("v", null, "verbose.output"),
59            VALIDITY("validity", "<valDays>", "validity.number.of.days");
60 - @@ -537,6 +539,8 @@
61 + @@ -559,6 +561,8 @@
62                    protectedPath = true;
63                } else if (collator.compare(flags, "-srcprotected") == 0) {
64                    srcprotectedPath = true;
65 @@ -120,23 +120,23 @@
66                } else  {
67                    System.err.println(rb.getString("Illegal.option.") + flags);
68                    tinyHelp();
69 - @@ -1335,7 +1339,7 @@
70 + @@ -1463,7 +1467,7 @@
71    
72            // Sign the request and base-64 encode it
73            request.encodeAndSign(subject, signature);
74   -        request.print(out);
75   +        request.print(out, systemLineEndings);
76 -      }
77    
78 -      /**
79 - @@ -4191,4 +4195,3 @@
80 +          checkWeak(rb.getString("the.generated.certificate.request"), request);
81 +      }
82 + @@ -4540,4 +4544,3 @@
83            return new Pair<>(a,b);
84        }
85    }
86   -
87 - diff -r 0be28a33e12d -r 794541fbbdc3 src/share/classes/sun/security/tools/keytool/Resources.java
88 - --- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java»       Tue Dec 29 10:40:43 2015 -0500
89 - +++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java»       Fri May 27 03:28:35 2016 +0100
90 + diff --git a/src/share/classes/sun/security/tools/keytool/Resources.java b/src/share/classes/sun/security/tools/keytool/Resources.java
91 + --- openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java
92 + +++ openjdk/jdk/src/share/classes/sun/security/tools/keytool/Resources.java
93   @@ -168,6 +168,8 @@
94                    "keystore password"}, //-storepass
95            {"keystore.type",
 1 @@ -0,0 +1,67 @@
 2 + # HG changeset patch
 3 + # User andrew
 4 + # Date 1508194072 -3600
 5 + #      Mon Oct 16 23:47:52 2017 +0100
 6 + # Node ID 5dcb55da00c1531264934559c9f10c2e0ae46420
 7 + # Parent  bf62c56e3604fee0018b19f65fd56c76dc156630
 8 + PR3479, RH1486025: ECC and NSS JVM crash
 9 + Summary: SunEC provider can have multiple instances, leading to premature NSS shutdown
10 + Contributed-by: Martin Balao <mbalao@redhat.com>
11 + 
12 + diff --git a/make/mapfiles/libsunec/mapfile-vers b/make/mapfiles/libsunec/mapfile-vers
13 + --- openjdk/jdk/make/mapfiles/libsunec/mapfile-vers
14 + +++ openjdk/jdk/make/mapfiles/libsunec/mapfile-vers
15 + @@ -32,7 +32,6 @@
16 +                  Java_sun_security_ec_ECDSASignature_verifySignedDigest;
17 +                  Java_sun_security_ec_ECDHKeyAgreement_deriveKey;
18 +  »       »       Java_sun_security_ec_SunEC_initialize;
19 + -»       »       Java_sun_security_ec_SunEC_cleanup;
20 +          local:
21 +                  *;
22 +  };
23 + diff --git a/src/share/classes/sun/security/ec/SunEC.java b/src/share/classes/sun/security/ec/SunEC.java
24 + --- openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java
25 + +++ openjdk/jdk/src/share/classes/sun/security/ec/SunEC.java
26 + @@ -83,21 +83,8 @@
27 +      }
28 +  
29 +      /**
30 + -     * Cleanup native resources during finalisation.
31 + -     */
32 + -    @Override
33 + -    protected void finalize() {
34 + -        cleanup();
35 + -    }
36 + -
37 + -    /**
38 +       * Initialize the native code.
39 +       */
40 +      private static native void initialize();
41 +  
42 + -    /**
43 + -     * Cleanup in the native layer.
44 + -     */
45 + -    private static native void cleanup();
46 + -
47 +  }
48 + diff --git a/src/share/native/sun/security/ec/ECC_JNI.cpp b/src/share/native/sun/security/ec/ECC_JNI.cpp
49 + --- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp
50 + +++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp
51 + @@ -525,14 +525,12 @@
52 +  }
53 +  
54 +  JNIEXPORT void
55 + -JNICALL Java_sun_security_ec_SunEC_cleanup
56 + -  (JNIEnv *env, jclass UNUSED(clazz))
57 + +JNICALL JNI_OnUnload
58 + +  (JavaVM *vm, void *reserved)
59 +  {
60 +  #ifdef SYSTEM_NSS
61 +      RNG_RNGShutdown();
62 + -    if (SECOID_Shutdown() != SECSuccess) {
63 + -»       ThrowException(env, INTERNAL_ERROR);
64 + -    }
65 + +    SECOID_Shutdown();
66 +  #endif
67 +  }
68 +  
 1 @@ -1,13 +1,17 @@
 2   #!/bin/sh
 3 + set -e
 4   # https://bugzilla.redhat.com/show_bug.cgi?id=1142153
 5   M=META-INF/MANIFEST.MF
 6 - #P=/usr/lib/jvm/java/jre/lib/security
 7 - P=$1/lib/security
 8 + #P=/usr/lib/jvm/java/jre/lib/security/policy
 9 + P=$1/lib/security/policy
10 + ERRORS=0
11 +   for type in unlimited limited ; do
12   for f in local_policy.jar US_export_policy.jar ; do
13 - ORIG=$P/$f
14 + ORIG=$P/$type/$f
15   echo "processing $f ($ORIG)"
16   if [ ! -f  $ORIG ]; then
17     echo "File not found! $ORIG"
18 +   let ERRORS=$ERRORS+1
19     continue
20   fi
21   d=`mktemp -d`
22 @@ -35,3 +39,6 @@
23     touch -t 201401010000 $ORIG
24     rm -rfv $d
25   done
26 +   done
27 + 
28 + exit $ERRORS
 1 @@ -3,7 +3,7 @@
 2   +++ openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java
 3   @@ -1,5 +1,6 @@
 4    /*
 5 -   * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
 6 +   * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 7   + * Copyright (c) 2014 Red Hat Inc.
 8     * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 9     *
10 @@ -26,12 +26,12 @@
11   +++ openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java
12   @@ -1,5 +1,6 @@
13    /*
14 -   * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
15 +   * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
16   + * Copyright (c) 2014 Red Hat Inc.
17     * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
18     *
19     * This code is free software; you can redistribute it and/or modify it
20 - @@ -60,11 +61,11 @@
21 + @@ -61,11 +62,11 @@
22    
23        private static void checkKeySize(int keysize)
24                throws InvalidParameterException {
25 @@ -48,7 +48,7 @@
26   diff --git a/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java b/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java
27   --- openjdk/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java
28   +++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java
29 - @@ -285,11 +285,11 @@
30 + @@ -292,11 +292,11 @@
31                        // this restriction is in the spec for DSA
32                        // since we currently use DSA parameters for DH as well,
33                        // it also applies to DH if no parameters are specified
 1 @@ -1,11 +0,0 @@
 2 - diff --git a/src/share/native/sun/java2d/cmm/lcms/cmstypes.c b/src/share/native/sun/java2d/cmm/lcms/cmstypes.c
 3 - --- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c
 4 - +++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c
 5 - @@ -1484,6 +1484,7 @@
 6 -  
 7 -          // Check for overflow
 8 -          if (Offset < (SizeOfHeader + 8)) goto Error;
 9 - +        if ((Offset + Len) > SizeOfTag + 8) goto Error;
10 -  
11 -          // True begin of the string
12 -          BeginOfThisString = Offset - SizeOfHeader - 8;
sources +3 -3
1 @@ -1,3 +1,3 @@
2 - SHA512 (systemtap-tapset-3.4.0pre01.tar.xz) = 4446fa20f88bbce53b583484bf06cb2b476c9372beb898dc2b7739eaa5c98b9979fbd72e12474fb344833d831a19366b82216ee03b452411745e6cd3527faa4e
3 - SHA512 (aarch64-port-jdk8u-aarch64-jdk8u144-b01.tar.xz) = dbad1a2a4b58606d2aaaf2124b917362b883b1a5f43eb06c33f8c9b5e5de7cfb00926d39efb6b10fd59792d140302640f8ec2d6b45839e80e3f42a3d027932ad
4 - SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u144-b02-shenandoah-merge-2017-10-02.tar.xz) = f5ab210f1e83b5588aed0c671b2d17ae85c3f52b0b9fdd1394c63393b3206dae0c3d0dc5f4e62f7de68dbcffc72776969e5c2e04d51dba604925fa4bfef105e2
5 + SHA512 (systemtap-tapset-3.6.0pre02.tar.xz) = d59858bbe9e927bdf47711e3c71c88f93567596aea3e1736b33b436a7a2cb38af25a9b4b4224ca513454b3f2d0371d14e753176c1810d9745a7e4af8edae7fb8
6 + SHA512 (aarch64-port-jdk8u-aarch64-jdk8u151-b12.tar.xz) = ef8bf4485755ec1c6d229a75dff65cfa17d74b0405f047f7f456bf2004feb985e5558eb66f9ff761aad45b945b0cd47647b41e0be13eb8096ab6e10fae2f47cc
7 + SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u151-b12.tar.xz) = d43fc639ab2a784c4914e32459715bc1eaa891c7a2ee05b911f4955e281cb4b4533e170bbfc593942ee793768526329a3955e592bf4a0be691e56dd9f2f89eca
 1 @@ -0,0 +1,21 @@
 2 + --- openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java»       2017-08-23 11:40:26.690809603 +0200
 3 + +++ openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java»       2017-08-23 11:44:28.314815334 +0200
 4 + @@ -74,8 +74,16 @@
 5 +              } catch (UnixException x) {
 6 +                  x.rethrowAsIOException(parent);
 7 +              }
 8 + -            if (attrs.dev() != dev())
 9 + -                break;
10 + +            if (attrs.dev() != dev()) {
11 + +
12 + +                // step 3: lookup mounted file systems (use /proc/mounts to ensure we
13 + +                // find the file system even when not in /etc/mtab)
14 + +                byte[] dir = path.asByteArray();
15 + +                for (UnixMountEntry entry: fs.getMountEntries("/proc/mounts")) {
16 + +                    if (Arrays.equals(dir, entry.dir()))
17 + +                        return entry;
18 + +                }
19 + +            }
20 +              path = parent;
21 +              parent = parent.getParent();
22 +          }
 1 @@ -31,7 +31,7 @@
 2       REPO_NAME="jdk8u"
 3   fi
 4   if [ "x$VERSION" = "x" ] ; then
 5 -     VERSION="aarch64-jdk8u144-b01"
 6 +     VERSION="aarch64-jdk8u151-b12"
 7   fi
 8   
 9   if [ "x$COMPRESSION" = "x" ] ; then
10 @@ -109,7 +109,7 @@
11       VERSION="tip"
12   else
13   »       #hardcoding version for anything else except tip
14 -     VERSION="aarch64-shenandoah-jdk8u144-b02-shenandoah-merge-2017-10-02"
15 +     VERSION="aarch64-shenandoah-jdk8u151-b12"
16   fi
17   MAIN_REPO_NAME=$REPO_NAME
18   REPO_NAME=jdk8u-shenandoah