Bug#871009: [Openjdk] Bug#871009: openjdk-9: Please update the patch jdk-8067331.diff

2017-08-06 Thread Matthias Klose
On 06.08.2017 11:04, John Paul Adrian Glaubitz wrote:
> On 08/06/2017 05:00 PM, John Paul Adrian Glaubitz wrote:
>> I am currently testing the updated patch on armel, armhf and
>> m68k. If it succeeds, it should be included for the next upload
>> and the workaround for m68k from #868255 [1].
> 
> ... the workaround for #868255 should be removed and Zero should
> be enabled on armhf as well. I was just interrupted writing the
> bug report during the first DebConf talk :).

armhf builds hotspot by default.



Bug#871009: [Openjdk] Bug#871009: openjdk-9: Please update the patch jdk-8067331.diff

2017-08-06 Thread John Paul Adrian Glaubitz
On 08/06/2017 05:29 PM, Matthias Klose wrote:
>> ... the workaround for #868255 should be removed and Zero should
>> be enabled on armhf as well. I was just interrupted writing the
>> bug report during the first DebConf talk :).
> 
> armhf builds hotspot by default.

Yes, but it has Zero disabled. Unlike amd64 and ppc64el, for example,
which build both Hotspot and Zero. With the updated patch, Zero should
also build on armhf.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#871009: openjdk-9: Please update the patch jdk-8067331.diff

2017-08-06 Thread John Paul Adrian Glaubitz
On 08/06/2017 05:00 PM, John Paul Adrian Glaubitz wrote:
> I am currently testing the updated patch on armel, armhf and
> m68k. If it succeeds, it should be included for the next upload
> and the workaround for m68k from #868255 [1].

... the workaround for #868255 should be removed and Zero should
be enabled on armhf as well. I was just interrupted writing the
bug report during the first DebConf talk :).

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#871009: openjdk-9: Please update the patch jdk-8067331.diff

2017-08-06 Thread John Paul Adrian Glaubitz
Source: openjdk-9
Version: 9~b181-1
Severity: normal
Tags: patch
User: debian-...@lists.debian.org
Usertags: armel armhf m68k

Hi!

The patch jdk-8067331.diff is obviously broken since it patches the
functions Atomic::xchg and Atomic::xchg_ptr to not return the values
of arm_lock_test_and_set and m68k_lock_test_and_set but to store
them into the result variable which is then never returned because
the "__sync_synchronize();" and "return result" statements are
guarded by the #ifdef macros.

This is fixed by the attached version of the patch. This should
fix the Zero builds on armhf, armel and m68k. Currently, openjdk-9
fails to build from source on armel, doesn't build on m68k without
passing "--with-debug-level=slowdebug" and on armhf, Zero isn't
enabled at all.

I am currently testing the updated patch on armel, armhf and
m68k. If it succeeds, it should be included for the next upload
and the workaround for m68k from #868255 [1].

Thanks,
Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868255

  .''`.  John Paul Adrian Glaubitz
 : :' :  Debian Developer - glaub...@debian.org
 `. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
   `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
--- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.hpp2017-08-01 
11:03:05.0 +0200
+++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.hpp2017-08-06 
13:53:29.764594490 +0200
@@ -221,39 +221,39 @@
 
 inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
 #ifdef ARM
-  return arm_lock_test_and_set(dest, exchange_value);
+  jint result = arm_lock_test_and_set(dest, exchange_value);
 #else
 #ifdef M68K
-  return m68k_lock_test_and_set(dest, exchange_value);
+  jint result = m68k_lock_test_and_set(dest, exchange_value);
 #else
   // __sync_lock_test_and_set is a bizarrely named atomic exchange
   // operation.  Note that some platforms only support this with the
   // limitation that the only valid value to store is the immediate
   // constant 1.  There is a test for this in JNI_CreateJavaVM().
   jint result = __sync_lock_test_and_set (dest, exchange_value);
+#endif // M68K
+#endif // ARM
   // All atomic operations are expected to be full memory barriers
   // (see atomic.hpp). However, __sync_lock_test_and_set is not
   // a full memory barrier, but an acquire barrier. Hence, this added
   // barrier.
   __sync_synchronize();
   return result;
-#endif // M68K
-#endif // ARM
 }
 
 inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
  volatile intptr_t* dest) {
 #ifdef ARM
-  return arm_lock_test_and_set(dest, exchange_value);
+  intptr_t result = arm_lock_test_and_set(dest, exchange_value);
 #else
 #ifdef M68K
-  return m68k_lock_test_and_set(dest, exchange_value);
+  intptr_t result = m68k_lock_test_and_set(dest, exchange_value);
 #else
   intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
-  __sync_synchronize();
-  return result;
 #endif // M68K
 #endif // ARM
+  __sync_synchronize();
+  return result;
 }
 
 inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) {