[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 :)
- [PATCH v3 03/27] linux-user/arm: Drop v1 signal frames, (continued)
- [PATCH v3 03/27] linux-user/arm: Drop v1 signal frames, Richard Henderson, 2021/09/24
- [PATCH v3 06/27] linux-user/alpha: Implement setup_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 08/27] linux-user/hexagon: Implement setup_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 11/27] linux-user/x86_64: Raise SIGSEGV if SA_RESTORER not set, Richard Henderson, 2021/09/24
- [PATCH v3 09/27] linux-user/hppa: Document non-use of setup_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 10/27] linux-user/i386: Implement setup_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 16/27] linux-user/nios2: Properly emulate EXCP_TRAP, Richard Henderson, 2021/09/24
- [PATCH v3 15/27] linux-user/mips: Implement setup_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 12/27] linux-user/m68k: Implement setup_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 14/27] linux-user/mips: Tidy install_sigtramp, Richard Henderson, 2021/09/24
- [PATCH v3 18/27] linux-user/nios2: Fixes for signal frame setup, Richard Henderson, 2021/09/24
- [PATCH v3 20/27] linux-user/ppc: Simplify encode_trampoline, Richard Henderson, 2021/09/24