mailing list of musl libc
 help / color / mirror / Atom feed
* [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

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/musl/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git