5ea879a
# HG changeset patch
5ea879a
# User mbalao
5ea879a
# Date 1525317412 -3600
5ea879a
#      Thu May 03 04:16:52 2018 +0100
5ea879a
# Node ID de79964656fc652f2085dac4fe99bcc128b5a3b1
5ea879a
# Parent  ffd5260fe5adcb26f87a14f1aaaf3e1a075d712a
5ea879a
8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong
5ea879a
Summary: The inline assembler for the S390 (S390 and not _LP64) has src and dst reversed thereby corrupting data
5ea879a
Reviewed-by: shade
5ea879a
5ea879a
diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
5ea879a
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
5ea879a
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
5ea879a
@@ -1,6 +1,6 @@
5ea879a
 /*
5ea879a
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
5ea879a
- * Copyright 2007, 2008, 2010 Red Hat, Inc.
5ea879a
+ * Copyright 2007, 2008, 2010, 2018, Red Hat, Inc.
5ea879a
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5ea879a
  *
5ea879a
  * This code is free software; you can redistribute it and/or modify it
5ea879a
@@ -50,10 +50,10 @@
5ea879a
                   : "Q"(*(volatile long*)src));
5ea879a
 #elif defined(S390) && !defined(_LP64)
5ea879a
     double tmp;
5ea879a
-    asm volatile ("ld  %0, 0(%1)\n"
5ea879a
-                  "std %0, 0(%2)\n"
5ea879a
-                  : "=r"(tmp)
5ea879a
-                  : "a"(src), "a"(dst));
5ea879a
+    asm volatile ("ld  %0, %2\n"
5ea879a
+                  "std %0, %1\n"
5ea879a
+                  : "=&f"(tmp), "=Q"(*(volatile double*)dst)
5ea879a
+                  : "Q"(*(volatile double*)src));
5ea879a
 #elif defined(__ARM_ARCH_7A__)
5ea879a
     jlong tmp;
5ea879a
     asm volatile ("ldrexd  %0, [%1]\n"