]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: Fix tabort usage in syscalls
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Fri, 21 Aug 2015 19:39:01 +0000 (14:39 -0500)
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Tue, 25 Aug 2015 16:45:56 +0000 (13:45 -0300)
Fix usage of tabort in generated syscalls.  r0 has special meaning
when used with this instruction, thus it will not generate
persistent errors, nor return an error code.  This mitigates poor
CPU usage when performing elided critical sections.

Additionally, transactions should be aborted when entering a user
invoked syscall.  Otherwise the results of the transaction may be
undefined.

2015-08-25  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>

* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION): Use
register other than r0 for tabort, it has special meaning.
* sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION): Likewise
* sysdeps/unix.sysv/linux/powerpc/syscall.S (syscall): Abort
transaction before starting syscall.

ChangeLog
sysdeps/powerpc/powerpc32/sysdep.h
sysdeps/powerpc/powerpc64/sysdep.h
sysdeps/unix/sysv/linux/powerpc/syscall.S

index 13fc3fb98a01b8d1a46e01f5c5f69ff0b73204a5..6e55d886a6b3c7975e54357f25cbc1d189d60f49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-25  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION): Use
+       register other than r0 for tabort, it has special meaning.
+       * sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION): Likewise
+       * sysdeps/unix.sysv/linux/powerpc/syscall.S (syscall): Abort
+       transaction before starting syscall.
+
 2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
 
        * sysdeps/powerpc/powerpc64/power7/strstr.S: Handle worst case.
index e16fe3e2241ecccf4c698a164323075624b56cb9..ecb492a5abad741132bebbadc7f91f4d92443550 100644 (file)
@@ -95,8 +95,8 @@ GOT_LABEL:                    ;                                             \
     lwz      0,TM_CAPABLE(2);  \
     cmpwi    0,0;              \
     beq             1f;                \
-    li      0,_ABORT_SYSCALL;  \
-    tabort.  0;                        \
+    li       11,_ABORT_SYSCALL;        \
+    tabort.  11;               \
     .align 4;                  \
 1:
 #else
index bf2a884b99acb56c9f05bc1eb3fc2f5ac35fdb75..a9d37ad437309949c199088cb2347367de244b8e 100644 (file)
@@ -279,8 +279,8 @@ LT_LABELSUFFIX(name,_name_end): ; \
     lwz      0,TM_CAPABLE(13); \
     cmpwi    0,0;              \
     beq             1f;                \
-    li      0,_ABORT_SYSCALL;  \
-    tabort.  0;                        \
+    li       11,_ABORT_SYSCALL;        \
+    tabort.  11;               \
     .align 4;                   \
 1:
 #else
index 157e3e329611253938ea918c3e3e3857c79f24d2..44773038bc317f7130c7576d895ab8d83781f369 100644 (file)
@@ -18,6 +18,7 @@
 #include <sysdep.h>
 
 ENTRY (syscall)
+       ABORT_TRANSACTION
        mr   r0,r3
        mr   r3,r4
        mr   r4,r5