Received: from eggs.gnu.org ([2001:4830:134:3::10]:47127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCaEW-0000Zn-5d for qemu-devel@nongnu.org; Mon, 13 Jun 2016 18:21:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCaEQ-0001kb-5U for qemu-devel@nongnu.org; Mon, 13 Jun 2016 18:21:23 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCaEQ-0001kW-11 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 18:21:18 -0400 Received: by mail-qk0-x242.google.com with SMTP id j2so7127469qkf.1 for ; Mon, 13 Jun 2016 15:21:17 -0700 (PDT) Sender: Richard Henderson References: <1465854326-19160-1-git-send-email-rth@twiddle.net> <1465854326-19160-5-git-send-email-rth@twiddle.net> From: Richard Henderson Message-ID: <4b334fac-c413-aae8-cd06-2010ef512c69@twiddle.net> Date: Mon, 13 Jun 2016 15:21:14 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/6] linux-user: Provide safe_syscall for aarch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Riku Voipio 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~