diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2018-03-05 14:46:24 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2018-03-07 17:39:44 -0300 |
commit | e921c89e01389161c036ec09112da6e18aeaa688 (patch) | |
tree | 99d6527bc95f91501d92565021031e03c820da1a /sysdeps/unix/sysv/linux/powerpc/elision-trylock.c | |
parent | 3dc214977beccc95f0df3b90fa4ca2557fe1bdd2 (diff) | |
download | glibc-e921c89e01389161c036ec09112da6e18aeaa688.zip glibc-e921c89e01389161c036ec09112da6e18aeaa688.tar.gz glibc-e921c89e01389161c036ec09112da6e18aeaa688.tar.bz2 |
powerpc: Fix TLE build for SPE (BZ #22926)
Some SPE opcodes clashes with some recent PowerISA opcodes and
until recently gas did not complain about it. However binutils
recently changed it and now VLE configured gas does not support to
assembler some instruction that might class with VLE (HTM for
instance). It also does not help that glibc build hardware lock
elision support as default (regardless of assembler support).
Although runtime will not actually enables TLE on SPE hardware
(since kernel will not advertise it), I see little advantage on
adding HTM support on SPE built glibc. SPE uses an incompatible
ABI which does not allow share the same build with default
powerpc and HTM code slows down SPE without any benefict.
This patch fixes it by only building HTM when SPE configuration
is not used.
Checked with a powerpc-linux-gnuspe build. I also did some sniff
tests on a e500 hardware without any issue.
[BZ #22926]
* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION_IMPL): Define
empty for __SPE__.
* sysdeps/powerpc/sysdep.h (ABORT_TRANSACTION): Likewise.
* sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__lll_lock_elision):
Do not build hardware transactional code for __SPE__.
* sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
(__lll_trylock_elision): Likewise.
* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
(__lll_unlock_elision): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/elision-trylock.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/elision-trylock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c index b74a810..fabb03b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c +++ b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c @@ -30,6 +30,7 @@ int __lll_trylock_elision (int *futex, short *adapt_count) { +#ifndef __SPE__ /* Implement POSIX semantics by forbiding nesting elided trylocks. */ __libc_tabort (_ABORT_NESTED_TRYLOCK); @@ -65,5 +66,6 @@ __lll_trylock_elision (int *futex, short *adapt_count) } use_lock: +#endif return lll_trylock (*futex); } |