From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9880 invoked by alias); 31 Oct 2006 20:10:58 -0000 Received: (qmail 9870 invoked by uid 22791); 31 Oct 2006 20:10:57 -0000 X-Spam-Check-By: sourceware.org Received: from web53713.mail.yahoo.com (HELO web53713.mail.yahoo.com) (206.190.39.62) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 31 Oct 2006 20:10:44 +0000 Received: (qmail 71437 invoked by uid 60001); 31 Oct 2006 20:10:42 -0000 Message-ID: <20061031201042.71435.qmail@web53713.mail.yahoo.com> Received: from [192.52.57.34] by web53713.mail.yahoo.com via HTTP; Tue, 31 Oct 2006 12:10:42 PST Date: Tue, 31 Oct 2006 20:10:00 -0000 From: Datoda Subject: Re: [rfa] Handle amd64-linux %orig_rax To: Andi Kleen , Daniel Jacobowitz Cc: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00321.txt.bz2 I think i386 shouldn't have the same problems, as far as gdb inferior calls= are concerned, because arguments are passed in stack rather than in regist= ers.=20 ----- Original Message ---- From: Andi Kleen To: Daniel Jacobowitz Cc: Datoda ; gdb-patches@sourceware.org Sent: Tuesday, October 31, 2006 1:40:38 PM Subject: Re: [rfa] Handle amd64-linux %orig_rax On Tuesday 31 October 2006 19:22, Daniel Jacobowitz wrote: > Andi, have you got any opinion on this? The problem arises when GDB > sets %orig_rax to -1 to indicate that the interrupted syscall should > not be resumed, and then sets %rip to some other address; the kernel is > still changing %rcx on the way out to userspace. I think this sounds > like a kernel bug. You would need to complain to the x86 ISA designers. SYSRET requires us to trash %rcx, there is no other way to use it. This means IRET won't clobber any registers (and it is used in a few situations where this is critical), but it is significantly slower. Ok in theory we could check if the process is traced and then always use IRET, but then you would get different behaviour depending on being traced or not which is probably not a good idea. BTW on i386 which uses SYSEXIT sometimes there are likely similar problems. SYSEXIT also requires to clobber registers. -Andi