Blame SOURCES/8201509-pr3579.patch

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