* [PATCH] S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit.
@ 2017-03-29 9:23 Stefan Liebler
2017-04-03 13:50 ` Stefan Liebler
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Liebler @ 2017-03-29 9:23 UTC (permalink / raw)
To: libc-alpha
[-- Attachment #1: Type: text/plain, Size: 497 bytes --]
Hi,
This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit.
This ensures that r14 isn't used to save and restore r12 while
r14 is clobbered by the bas-instruction.
As note:
r12 can't be clobbered as gcc would fail with:
error: PIC register clobbered by â12â in âasmâ
For 64bit this fix was already done in 2004 in the
commit b80af23ac6973e69df6cd23d221fa44fffb21e17.
Bye
Stefan
ChangeLog:
* sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD):
Clobber also r14.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 20170329_tls_macros_s390_31.patch --]
[-- Type: text/x-patch; name="20170329_tls_macros_s390_31.patch", Size: 2460 bytes --]
commit 3f102d08af514c1cd4094c2feaca02546548de36
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date: Wed Mar 29 11:07:02 2017 +0200
S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit.
This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit.
This ensures that r14 isn't used to save and restore r12 while
r14 is clobbered by the bas-instruction.
As note:
r12 can't be clobbered as gcc would fail with:
error: PIC register clobbered by â12â in âasmâ
For 64bit this fix was already done in 2004 in the
commit b80af23ac6973e69df6cd23d221fa44fffb21e17.
ChangeLog:
* sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD):
Clobber also r14.
diff --git a/sysdeps/s390/s390-32/tls-macros.h b/sysdeps/s390/s390-32/tls-macros.h
index 09b42aa..a4c5fff 100644
--- a/sysdeps/s390/s390-32/tls-macros.h
+++ b/sysdeps/s390/s390-32/tls-macros.h
@@ -47,7 +47,7 @@
"alr %0,%%r2\n\t" \
"lr %%r12,%1" \
: "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_LD(x) \
@@ -63,7 +63,8 @@
"bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
"l %0,12(%0)\n\t" \
"alr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#endif
@@ -83,7 +84,7 @@
"lr %0,%%r2\n\t" \
"lr %%r12,%1" \
: "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_GD(x) \
@@ -97,6 +98,7 @@
"l %%r2,8(%0)\n\t" \
"bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
"lr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit.
2017-03-29 9:23 [PATCH] S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit Stefan Liebler
@ 2017-04-03 13:50 ` Stefan Liebler
2017-04-04 11:19 ` Stefan Liebler
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Liebler @ 2017-04-03 13:50 UTC (permalink / raw)
To: libc-alpha
On 03/29/2017 11:22 AM, Stefan Liebler wrote:
> Hi,
>
> This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit.
> This ensures that r14 isn't used to save and restore r12 while
> r14 is clobbered by the bas-instruction.
>
> As note:
> r12 can't be clobbered as gcc would fail with:
> error: PIC register clobbered by â12â in âasmâ
>
> For 64bit this fix was already done in 2004 in the
> commit b80af23ac6973e69df6cd23d221fa44fffb21e17.
>
> Bye
> Stefan
>
> ChangeLog:
>
> * sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD):
> Clobber also r14.
Any objection?
Otherwise, I'll commit it tomorrow.
Bye
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit.
2017-04-03 13:50 ` Stefan Liebler
@ 2017-04-04 11:19 ` Stefan Liebler
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Liebler @ 2017-04-04 11:19 UTC (permalink / raw)
To: libc-alpha
On 04/03/2017 03:50 PM, Stefan Liebler wrote:
> On 03/29/2017 11:22 AM, Stefan Liebler wrote:
>> Hi,
>>
>> This patch also clobbers r14 in TLS_LD, TLS_GD macros on 31bit.
>> This ensures that r14 isn't used to save and restore r12 while
>> r14 is clobbered by the bas-instruction.
>>
>> As note:
>> r12 can't be clobbered as gcc would fail with:
>> error: PIC register clobbered by â12â in âasmâ
>>
>> For 64bit this fix was already done in 2004 in the
>> commit b80af23ac6973e69df6cd23d221fa44fffb21e17.
>>
>> Bye
>> Stefan
>>
>> ChangeLog:
>>
>> * sysdeps/s390/s390-32/tls-macros.h (TLS_LD, TLS_GD):
>> Clobber also r14.
>
> Any objection?
> Otherwise, I'll commit it tomorrow.
>
> Bye
> Stefan
>
Committed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-04 11:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 9:23 [PATCH] S390: Clobber also r14 in TLS_LD, TLS_GD macros on 31bit Stefan Liebler
2017-04-03 13:50 ` Stefan Liebler
2017-04-04 11:19 ` Stefan Liebler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).