<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/thread/s390x, branch master</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>s390x: shuffle register usage in __tls_get_offset to avoid r0 as address</title>
<updated>2025-10-12T20:15:47+00:00</updated>
<author>
<name>Alex Rønne Petersen</name>
<email>alex@alexrp.com</email>
</author>
<published>2025-10-12T03:35:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=1b76ff0767d01df72f692806ee5adee13c67ef88'/>
<id>1b76ff0767d01df72f692806ee5adee13c67ef88</id>
<content type='text'>
This fixes an error in 6af4f25b899e89e4b91f8c197ae5a6ce04bcce7b: The
r0 register is special in addressing modes on s390x and is interpreted
as constant zero, i.e. lg %r5, 8(%r0) would effectively become lg %r5,
8. So care should be taken to never use r0 as an address register in
s390x assembly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes an error in 6af4f25b899e89e4b91f8c197ae5a6ce04bcce7b: The
r0 register is special in addressing modes on s390x and is interpreted
as constant zero, i.e. lg %r5, 8(%r0) would effectively become lg %r5,
8. So care should be taken to never use r0 as an address register in
s390x assembly.
</pre>
</div>
</content>
</entry>
<entry>
<title>s390x: manually inline __tls_get_addr in __tls_get_offset</title>
<updated>2025-02-09T14:46:53+00:00</updated>
<author>
<name>Alex Rønne Petersen</name>
<email>alex@alexrp.com</email>
</author>
<published>2025-01-24T05:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=6af4f25b899e89e4b91f8c197ae5a6ce04bcce7b'/>
<id>6af4f25b899e89e4b91f8c197ae5a6ce04bcce7b</id>
<content type='text'>
Calling __tls_get_addr with brasl is not valid since it's a global symbol; doing
so results in an R_390_PC32DBL relocation error from lld. We could fix this by
marking __tls_get_addr hidden since it is not part of the s390x ABI, or by using
a different instruction. However, given its simplicity, it makes more sense to
just manually inline it into __tls_get_offset for performance.

The patch has been tested by applying to Zig's bundled musl copy and running the
full Zig test suite under qemu-s390x.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calling __tls_get_addr with brasl is not valid since it's a global symbol; doing
so results in an R_390_PC32DBL relocation error from lld. We could fix this by
marking __tls_get_addr hidden since it is not part of the s390x ABI, or by using
a different instruction. However, given its simplicity, it makes more sense to
just manually inline it into __tls_get_offset for performance.

The patch has been tested by applying to Zig's bundled musl copy and running the
full Zig test suite under qemu-s390x.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix failure to preserve r6 in s390x asm; per ABI it is call-saved</title>
<updated>2020-12-04T22:01:05+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2020-12-04T22:01:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=50c7935cd21f33f42013447d57bc19d2e6318aae'/>
<id>50c7935cd21f33f42013447d57bc19d2e6318aae</id>
<content type='text'>
both __clone and __syscall_cp_asm failed to restore the original value
of r6 after using it as a syscall argument register. the extent of
breakage is not known, and in some cases may be mitigated by the only
callers being internal to libc; if they used r6 but no longer needed
its value after the call, they may not have noticed the problem.
however at least posix_spawn (which uses __clone) was observed
returning to the application with the wrong value in r6, leading to
crash.

since the call frame ABI already provides a place to spill registers,
fixing this is just a matter of using it. in __clone, we also
spuriously restore r6 in the child, since the parent branch directly
returns to the caller. this takes the value from an uninitialized slot
of the child's stack, but is harmless since there is no caller to
return to in the child.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
both __clone and __syscall_cp_asm failed to restore the original value
of r6 after using it as a syscall argument register. the extent of
breakage is not known, and in some cases may be mitigated by the only
callers being internal to libc; if they used r6 but no longer needed
its value after the call, they may not have noticed the problem.
however at least posix_spawn (which uses __clone) was observed
returning to the application with the wrong value in r6, leading to
crash.

since the call frame ABI already provides a place to spill registers,
fixing this is just a matter of using it. in __clone, we also
spuriously restore r6 in the child, since the parent branch directly
returns to the caller. this takes the value from an uninitialized slot
of the child's stack, but is harmless since there is no caller to
return to in the child.
</pre>
</div>
</content>
</entry>
<entry>
<title>make arch __set_thread_area backends hidden</title>
<updated>2018-09-12T18:34:32+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2018-09-10T19:42:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=5e1019b01c968707accc85c99e63a18af665cf27'/>
<id>5e1019b01c968707accc85c99e63a18af665cf27</id>
<content type='text'>
this is not a public interface, and does not even necessarily match
the syscall on all archs that have a syscall by that name.

on archs where it's implemented in C, no action on the source file is
needed; the hidden declaration in pthread_arch.h suffices.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this is not a public interface, and does not even necessarily match
the syscall on all archs that have a syscall by that name.

on archs where it's implemented in C, no action on the source file is
needed; the hidden declaration in pthread_arch.h suffices.
</pre>
</div>
</content>
</entry>
<entry>
<title>make arch __clone backends hidden</title>
<updated>2018-09-12T18:34:31+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2018-09-10T19:36:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f5f7673d71f843b423e60bbdd7de49fd1bbcc8c1'/>
<id>f5f7673d71f843b423e60bbdd7de49fd1bbcc8c1</id>
<content type='text'>
these are not a public interface and are not intended to be callable
from anywhere but the public clone function or other places in libc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
these are not a public interface and are not intended to be callable
from anywhere but the public clone function or other places in libc.
</pre>
</div>
</content>
</entry>
<entry>
<title>add s390x port</title>
<updated>2016-11-12T04:06:21+00:00</updated>
<author>
<name>Bobby Bingham</name>
<email>koorogi@koorogi.info</email>
</author>
<published>2016-11-12T03:52:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=15094943050eb9a564f409323070e50b40f78816'/>
<id>15094943050eb9a564f409323070e50b40f78816</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
