From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Riku Voipio <riku.voipio@iki.fi>
Subject: Re: [Qemu-devel] [PATCH 4/6] linux-user: Provide safe_syscall for aarch64
Date: Mon, 13 Jun 2016 15:21:14 -0700 [thread overview]
Message-ID: <4b334fac-c413-aae8-cd06-2010ef512c69@twiddle.net> (raw)
In-Reply-To: <CAFEAcA-oLdJZBTy3BzCgOO7XuKUbK8kiSPg+YM3PEeRissgxGQ@mail.gmail.com>
On 06/13/2016 03:04 PM, Peter Maydell wrote:
>> + .global safe_syscall_base
>> + .global safe_syscall_start
>> + .global safe_syscall_end
>> + .type safe_syscall_base, #function
>> + .type safe_syscall_start, #function
>> + .type safe_syscall_end, #function
>
> _start and _end aren't function entry points, so is it OK
> to mark them as functions?
Yes. Indeed, if you don't, the objdump will think these are data symbols and
fail to disassemble the instructions that follow.
> (The 'as' manual doesn't document what setting .type does in much
> detail...)
It sets the Elf_Sym.st_type field.
But what that implies is very host specific.
> http://man7.org/linux/man-pages/man2/syscall.2.html
> doesn't mention a syscall argument in x7, just x0..x5.
I took glibc as definitive, since that's code that definitely works.
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/syscall.S;h=98c1b42ee96fe0fb39955849773ca16d095803e0;hb=HEAD
I'll also point you at the kernel's __sys_trace, which does in fact save and
restore all 8 registers around the tracing call-outs.
>> + mov x9, x0 /* signal_pending pointer */
>> + mov w8, w1 /* syscall number */
>
> Seems a bit odd to use a 32-bit move for this when our input
> calling convention has it as 64 bits and the kernel's calling
> convention has it as 64 bits.
I got that from glibc too.
r~
next prev parent reply other threads:[~2016-06-13 22:21 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 21:45 [Qemu-devel] [PATCH 0/6] linux-user: safe_syscall updates Richard Henderson
2016-06-13 21:45 ` [Qemu-devel] [PATCH 1/6] linux-user: fix x86_64 safe_syscall Richard Henderson
2016-06-14 11:58 ` Peter Maydell
2016-06-21 19:26 ` Riku Voipio
2016-06-13 21:45 ` [Qemu-devel] [PATCH 2/6] linux-user: Provide safe_syscall for i386 Richard Henderson
2016-06-14 11:58 ` Peter Maydell
2016-06-14 15:47 ` Richard Henderson
2016-06-13 21:45 ` [Qemu-devel] [PATCH 3/6] linux-user: Provide safe_syscall for arm Richard Henderson
2016-06-14 12:04 ` Peter Maydell
2016-06-14 15:53 ` Richard Henderson
2016-06-13 21:45 ` [Qemu-devel] [PATCH 4/6] linux-user: Provide safe_syscall for aarch64 Richard Henderson
2016-06-13 22:04 ` Peter Maydell
2016-06-13 22:21 ` Richard Henderson [this message]
2016-06-13 22:28 ` Peter Maydell
2016-06-13 22:31 ` Peter Maydell
2016-06-13 22:38 ` Richard Henderson
2016-06-13 22:40 ` Peter Maydell
2016-06-13 21:45 ` [Qemu-devel] [PATCH 5/6] linux-user: Provide safe_syscall for s390x Richard Henderson
2016-06-13 21:45 ` [Qemu-devel] [PATCH 6/6] linux-user: Provide safe_syscall for ppc64 Richard Henderson
2016-06-13 22:23 ` Peter Maydell
2016-06-13 21:53 ` [Qemu-devel] [PATCH 0/6] linux-user: safe_syscall updates Peter Maydell
2016-06-13 22:09 ` Peter Maydell
2016-06-21 19:08 ` Riku Voipio
2016-06-21 19:49 ` Peter Maydell
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=4b334fac-c413-aae8-cd06-2010ef512c69@twiddle.net \
--to=rth@twiddle.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).