[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 18.2/34] hurd: Port trampoline.c to x86_64
From: |
Sergey Bugaev |
Subject: |
Re: [PATCH v2 18.2/34] hurd: Port trampoline.c to x86_64 |
Date: |
Tue, 11 Apr 2023 00:33:04 +0300 |
On Mon, Apr 10, 2023 at 10:04 PM Samuel Thibault
<samuel.thibault@gnu.org> wrote:
> Sergey Bugaev, le lun. 03 avril 2023 14:56:21 +0300, a ecrit:
> > @@ -110,6 +132,10 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss,
> > const struct sigaction *action
> > ucontext_t *uctxp; /* Points to uctx, below. */
> > } posix;
> > };
> > +
> > +#ifdef __x86_64__
> > + void *_pad;
> > +#endif
>
> Please mention what that is for.
This is to make sigreturn_addr 16-byte aligned (and this is verified
by the static assert below). Our %rsp points right here at
&sigreturn_addr when we call the user's signal handler (and then
sigreturn, except we ret to it instead of call'ing it, but either way
it's pushing or popping 8 bytes), and it needs to be 16-byte aligned
before a function call per the x86_64 ABI. You're right that another
comment next to _pad itself wouldn't hurt.
Sergey