From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28868 invoked by alias); 31 Oct 2006 19:33:09 -0000 Received: (qmail 28860 invoked by uid 22791); 31 Oct 2006 19:33:08 -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 19:33:00 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GezM1-0008Nk-Sa; Tue, 31 Oct 2006 14:32:58 -0500 Date: Tue, 31 Oct 2006 19:33:00 -0000 From: Daniel Jacobowitz To: Andi Kleen , Datoda , gdb-patches@sourceware.org Subject: Re: [rfa] Handle amd64-linux %orig_rax Message-ID: <20061031193257.GA32199@nevyn.them.org> Mail-Followup-To: Andi Kleen , Datoda , gdb-patches@sourceware.org References: <20061031181702.73135.qmail@web53714.mail.yahoo.com> <200610311940.38617.ak@suse.de> <20061031184924.GA30569@nevyn.them.org> <200610312011.20880.ak@suse.de> <20061031193035.GA31708@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061031193035.GA31708@nevyn.them.org> 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/msg00319.txt.bz2 On Tue, Oct 31, 2006 at 02:30:35PM -0500, Daniel Jacobowitz wrote: > On Tue, Oct 31, 2006 at 08:11:20PM +0100, Andi Kleen wrote: > > > > > 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. > > > > If you're single stepping over it you can remember it from > > one instruction before (check if the opcode is SYSCALL or SYSENTER, > > these are unique 2 byte opcodes each) > > > > If someone sets a breakpoint directly on the return point > > and doesn't single step that wouldn't work, but then you shouldn't care about > > the previous register state anyways. > > This case is usually SIGINT while inside a syscall, e.g. nanosleep. > That gives us a prompt, and if the user changes $rcx there, we write > into the register - and later it gets overridden. i.e. we're at the > ptrace_stop call in kernel/signal.c:get_signal_to_deliver. > > I'm not quite sure how we're getting into the problem case though? > I'd have guessed we were in sysret_signal and that uses iret. Datoda, what kernel version were you using? I wonder if this fixed it as a side effect: Commit: 7bf36bbc5e0c09271f9efe22162f8cc3f8ebd3d2 Author: Andi Kleen Fri, 07 Apr 2006 19:50:00 +0200 [PATCH] x86_64: When user could have changed RIP always force IRET -- Daniel Jacobowitz CodeSourcery