From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24268 invoked by alias); 31 Oct 2006 18:49:37 -0000 Received: (qmail 24252 invoked by uid 22791); 31 Oct 2006 18:49:35 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 31 Oct 2006 18:49:27 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Geyfs-0007za-2f; Tue, 31 Oct 2006 13:49:24 -0500 Date: Tue, 31 Oct 2006 18:49:00 -0000 From: Daniel Jacobowitz To: Andi Kleen Cc: Datoda , gdb-patches@sourceware.org Subject: Re: [rfa] Handle amd64-linux %orig_rax Message-ID: <20061031184924.GA30569@nevyn.them.org> Mail-Followup-To: Andi Kleen , Datoda , gdb-patches@sourceware.org References: <20061031181702.73135.qmail@web53714.mail.yahoo.com> <20061031182209.GA29639@nevyn.them.org> <200610311940.38617.ak@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200610311940.38617.ak@suse.de> User-Agent: Mutt/1.5.13 (2006-08-11) 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/msg00316.txt.bz2 On Tue, Oct 31, 2006 at 07:40:38PM +0100, Andi Kleen wrote: > 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. Oh dear. So if we set registers on the syscall exit path, the kernel/ISA may just eat them. And we have no reliable way to know whether we're stopped on the syscall exit path. There's gotta be a better way, but I don't know what it might be... -- Daniel Jacobowitz CodeSourcery