qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 10/27] linux-user/i386: Implement setup_sigtramp


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 10/27] linux-user/i386: Implement setup_sigtramp
Date: Tue, 28 Sep 2021 08:50:33 +0200

On Tue, Sep 28, 2021 at 3:42 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
> On 9/24/21 2:01 PM, Philippe Mathieu-Daudé wrote:
> >> +static void install_sigtramp(void *tramp)
> >> +{
> >> +    /* This is popl %eax ; movl $syscall,%eax ; int $0x80 */
> >> +    __put_user(0xb858, (uint16_t *)(tramp + 0));
> >> +    __put_user(TARGET_NR_sigreturn, (int *)(tramp + 2));
> >
> > I know this is mostly code movement, but using uint32_t would
> > make it easier to read.
>
> I'll give you int32_t here, since the value is signed.

Better, thanks.

>
> >> +    __put_user(TARGET_NR_rt_sigreturn, (int *)(tramp + 1));
> >
> > and uint32_t.
>
> Likewise.
>
> >> +    uint16_t *tramp = lock_user(VERIFY_WRITE, sigtramp_page, 2 * 8, 0);
> >
> > Shouldn't this be 8 + 7?
>
> Does it really matter if we write 15 or 16 bytes of this page?

Certainly not :)



reply via email to

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