bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] x86_64: add 64-bit syscall entry point


From: Sergey Bugaev
Subject: Re: [PATCH 5/5] x86_64: add 64-bit syscall entry point
Date: Tue, 28 Feb 2023 18:15:45 +0300

On Tue, Feb 28, 2023 at 5:37 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> Now it also has another meaning: since it clobbers memory, gcc is
> not allowed to keep values in registers, i.e. this is a memory
> synchronization barrier concerning the compiler. If for instance we have
> prepared some data in memory before issuing the wrmsr, we need it for
> the data preparation to be actually written. At least Linux does have
> this clobber in its wrmsr inlines.

Ah yes, this makes sense. Guess a comment making this intention
explicit wouldn't hurt :)

On Tue, Feb 28, 2023 at 5:39 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> Sergey Bugaev, le mar. 28 févr. 2023 17:14:05 +0300, a ecrit:
> > Do I understand it right that for the most interesting syscall (which
> > takes 7 args!), I *am* supposed to pass the 7th arg on the stack (in
> > mem[rsp + 8])
>
> That's the x86_64 ABI, yes.
>
> > -- unlike on Linux?
>
> ? Linux does put only 6 args in registers, too.

It does not look like Linux has any syscalls that take 7 args or more,
at least not on x86_64. 7th arg location is specified as just "-" in
syscall(2) for x86_64 (as well as most other architectures). The only
mention of using the stack on that man page is: "The mips/o32 system
call convention passes arguments 5 through 8 on the user stack."

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]