* [musl] x86_64/__set_thread_area clobber of rcx and r11
@ 2020-11-09 21:48 Harald Hoyer
2020-11-09 21:59 ` Hydro Flask
0 siblings, 1 reply; 3+ messages in thread
From: Harald Hoyer @ 2020-11-09 21:48 UTC (permalink / raw)
To: musl
Hello,
In src/thread/x86_64/__set_thread_area.s, I don't see any special handling of the registers rcx and r11,
which will be clobbered by the syscall. Is that an oversight, or am I missing something?
Harald
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [musl] x86_64/__set_thread_area clobber of rcx and r11
2020-11-09 21:48 [musl] x86_64/__set_thread_area clobber of rcx and r11 Harald Hoyer
@ 2020-11-09 21:59 ` Hydro Flask
2020-11-10 8:20 ` Harald Hoyer
0 siblings, 1 reply; 3+ messages in thread
From: Hydro Flask @ 2020-11-09 21:59 UTC (permalink / raw)
To: musl
On 2020-11-09 13:48, Harald Hoyer wrote:
> In src/thread/x86_64/__set_thread_area.s, I don't see any special
> handling of the registers rcx and r11,
> which will be clobbered by the syscall. Is that an oversight, or am I
> missing something?
The x86_64 ABI states that code should assume all caller-saved
registers, which include rcx and r11, are clobbered
after the function call. __set_thread_area itself doesn't use rcx or
r11, so no other special handling is needed.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [musl] x86_64/__set_thread_area clobber of rcx and r11
2020-11-09 21:59 ` Hydro Flask
@ 2020-11-10 8:20 ` Harald Hoyer
0 siblings, 0 replies; 3+ messages in thread
From: Harald Hoyer @ 2020-11-10 8:20 UTC (permalink / raw)
To: musl
Am 09.11.20 um 22:59 schrieb Hydro Flask:
> On 2020-11-09 13:48, Harald Hoyer wrote:
>> In src/thread/x86_64/__set_thread_area.s, I don't see any special
>> handling of the registers rcx and r11,
>> which will be clobbered by the syscall. Is that an oversight, or am I
>> missing something?
>
> The x86_64 ABI states that code should assume all caller-saved registers, which include rcx and r11, are clobbered
> after the function call. __set_thread_area itself doesn't use rcx or r11, so no other special handling is needed.
>
Yeah, sorry, memorized half an hour later also. I guess it was too much inline assembly in the last weeks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-10 8:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 21:48 [musl] x86_64/__set_thread_area clobber of rcx and r11 Harald Hoyer
2020-11-09 21:59 ` Hydro Flask
2020-11-10 8:20 ` Harald Hoyer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).