From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFnff-0004Z7-3Q for qemu-devel@nongnu.org; Fri, 08 Aug 2014 13:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFnfZ-0004PN-3C for qemu-devel@nongnu.org; Fri, 08 Aug 2014 13:09:38 -0400 Received: from mail-qa0-x22a.google.com ([2607:f8b0:400d:c00::22a]:59681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFnfY-0004PC-Up for qemu-devel@nongnu.org; Fri, 08 Aug 2014 13:09:33 -0400 Received: by mail-qa0-f42.google.com with SMTP id j15so5909133qaq.1 for ; Fri, 08 Aug 2014 10:09:32 -0700 (PDT) Sender: Richard Henderson Message-ID: <53E50445.7000405@twiddle.net> Date: Fri, 08 Aug 2014 07:09:25 -1000 From: Richard Henderson MIME-Version: 1.0 References: <1407470214-10792-1-git-send-email-jmiao@redhat.com> In-Reply-To: <1407470214-10792-1-git-send-email-jmiao@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: Fix syscall instruction usermode emulation on X86_64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jincheng Miao , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@iki.fi On 08/07/2014 05:56 PM, Jincheng Miao wrote: > Currently syscall instruction is buggy on user mode X86_64, > the EIP is updated after do_syscall(), that is too late for > clone(). Because clone() will create a thread at the env->EIP > (the address of syscall insn), and then child thread enters > do_syscall() again, that is not expected. Sometimes it is tragic. > > User mode syscall insn emulation is not used MSR, so the > action should be same to INT 0x80. INT 0x80 will update EIP in > do_interrupt(), ditto for syscall() for consistency. > > Signed-off-by: Jincheng Miao > --- > linux-user/main.c | 1 - > target-i386/seg_helper.c | 4 ++-- > 2 files changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~