From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCqYd-0002b3-7k for qemu-devel@nongnu.org; Tue, 14 Jun 2016 11:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCqYY-0000W1-8R for qemu-devel@nongnu.org; Tue, 14 Jun 2016 11:47:15 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:34717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCqYY-0000Vu-3g for qemu-devel@nongnu.org; Tue, 14 Jun 2016 11:47:10 -0400 Received: by mail-qk0-x241.google.com with SMTP id j2so8780593qkf.1 for ; Tue, 14 Jun 2016 08:47:09 -0700 (PDT) Sender: Richard Henderson References: <1465854326-19160-1-git-send-email-rth@twiddle.net> <1465854326-19160-3-git-send-email-rth@twiddle.net> From: Richard Henderson Message-ID: Date: Tue, 14 Jun 2016 08:47:06 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] linux-user: Provide safe_syscall for i386 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Riku Voipio On 06/14/2016 04:58 AM, Peter Maydell wrote: >> + greg_t *pcreg = &uc->uc_mcontext.gregs[REG_EIP]; > > user-exec.c has > #ifndef REG_EIP > /* for glibc 2.1 */ > #define REG_EIP EIP > #endif > > Do we still care about glibc 2.1 ? (Probably not, 2.2 was > released fifteen years ago now...) > Heh. I would say not. We've got other much more recent requirements. >> + * >> + * This work is licensed under the terms of the GNU GPL, version 2 or later. >> + * See the COPYING file in the top-level directory. >> + */ >> + >> + .global safe_syscall_base >> + .global safe_syscall_start >> + .global safe_syscall_end >> + .type safe_syscall_base, @function > > I guess 4-space indent would match the rest of QEMU... This is assembler not C. My brain is tied to a 1-tab indent. >> + .cfi_rel_offset esi, 0 >> + push %edi > > Odd indentation here. Yeah, that's mixing code from your x86_64 version which uses spaces not tabs. >> + cmp $0, (%eax) >> + mov 8+16(%esp), %eax /* syscall number */ >> + jnz 1f > > Any particular reason for doing the jump after the mov? No. Indeed, recent cpus will fuse the cmp+jnz so they're better off together. >> + .cfi_def_cfa_offset 4 > > Shouldn't these all be ".cfi_adjust_cfa_offset -4" ? That's what glibc > uses AFAICT. Typo. Good catch. >> + .cfi_remember_state > > We don't need to remember state here I think. Correct. Cut and paste. > Other than some trivialities like order of register push/pops > this is virtually identical code to the version I had, so it > must be right :-) Heh. r~