From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, imp@bsdimp.com, Laurent@vivier.eu
Subject: Re: [PATCH v6 04/16] linux-user/host/mips: Add safe-syscall.inc.S
Date: Mon, 29 Nov 2021 17:51:51 +0100 [thread overview]
Message-ID: <1c4e296a-5225-3c1c-a73a-d7f3fabd48c8@linaro.org> (raw)
In-Reply-To: <CAFEAcA9F772qY4GBvqUmVcd=2o1bFQ7VFFw5AmyFnugfctBxjw@mail.gmail.com>
On 11/29/21 5:40 PM, Peter Maydell wrote:
>> + lw a2, 16(sp)
>> + lw a3, 20(sp)
>> + lw t4, 24(sp)
>> + lw t5, 28(sp)
>> + lw t6, 32(sp)
>> + lw t7, 40(sp)
>> + sw t4, 16(sp)
>> + sw t5, 20(sp)
>> + sw t6, 24(sp)
>> + sw t7, 28(sp)
>
> This is a varargs call, so (unless I'm confused, which is
> quite possible) the caller will only allocate enough stack
> space for the arguments we're actually passed, right? That
> means that unless the syscall actually has 3 or more arguments
> the memory at 16(sp) will be whatever the caller had on the
> stack above the argument-passing area, and we can't write to
> it. I think we need to actually move sp down here so we have
> some space we know we can scribble on.
Yep, good catch.
r~
next prev parent reply other threads:[~2021-11-29 16:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 17:37 [PATCH for-7.0 v6 00/16] linux-user: simplify safe signal handling Richard Henderson
2021-11-23 17:37 ` [PATCH v6 01/16] linux-user: Untabify all safe-syscall.inc.S Richard Henderson
2021-11-25 10:17 ` Warner Losh
2021-11-23 17:37 ` [PATCH v6 02/16] linux-user/host/ppc64: Use r11 for signal_pending address Richard Henderson
2021-11-29 11:01 ` Peter Maydell
2021-11-29 14:30 ` Richard Henderson
2021-11-23 17:37 ` [PATCH v6 03/16] linux-user: Move syscall error detection into safe_syscall_base Richard Henderson
2021-11-25 10:25 ` Warner Losh
2021-11-23 17:37 ` [PATCH v6 04/16] linux-user/host/mips: Add safe-syscall.inc.S Richard Henderson
2021-11-25 10:22 ` Warner Losh
2021-11-29 16:40 ` Peter Maydell
2021-11-29 16:51 ` Richard Henderson [this message]
2021-11-23 17:37 ` [PATCH v6 05/16] linux-user/host/sparc64: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 06/16] linux-user: Remove HAVE_SAFE_SYSCALL and hostdep.h Richard Henderson
2021-11-23 17:37 ` [PATCH v6 07/16] linux-user: Rename TARGET_ERESTARTSYS to QEMU_ERESTARTSYS Richard Henderson
2021-11-23 17:37 ` [PATCH v6 08/16] bsd-user: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 09/16] linux-user: Rename TARGET_QEMU_ESIGRETURN to QEMU_ESIGRETURN Richard Henderson
2021-11-23 17:37 ` [PATCH v6 10/16] linux-user: Create special-errno.h Richard Henderson
2021-11-23 17:37 ` [PATCH v6 11/16] bsd-user: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 12/16] common-user: Move safe-syscall.* from linux-user Richard Henderson
2021-11-23 17:37 ` [PATCH v6 13/16] common-user: Adjust system call return on FreeBSD Richard Henderson
2021-11-23 17:37 ` [PATCH v6 14/16] linux-user: Move thunk.c from top-level Richard Henderson
2021-11-23 17:37 ` [PATCH v6 15/16] meson: Move linux_user_ss to linux-user/ Richard Henderson
2021-11-23 17:37 ` [PATCH v6 16/16] meson: Move bsd_user_ss to bsd-user/ Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c4e296a-5225-3c1c-a73a-d7f3fabd48c8@linaro.org \
--to=richard.henderson@linaro.org \
--cc=Laurent@vivier.eu \
--cc=imp@bsdimp.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).