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: Richard Henderson
Subject: Re: [PATCH v3 10/27] linux-user/i386: Implement setup_sigtramp
Date: Mon, 27 Sep 2021 21:42:14 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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.

+    __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?


r~



reply via email to

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